What happened?
I have an encountered an issue with the kubernetes-ts-guestbook example. On line 41, the code references the labels from the deployment's metadata:
this.service = new k8s.core.v1.Service(name, {
metadata: {
name: name,
labels: this.deployment.metadata.labels,
},
but here those labels aren't attached to the Service. In fact, the labels property is completely missing. I thought that I may need to apply the metadata first:
labels: this.deployment.metadata.apply(metadata => metadata.labels),
or the labels:
labels: this.deployment.metadata.labels.apply(labels => labels),
but even that didn't work. Instead, I can only get it to work by referencing the same local labels as in the Deployment resource:
Example
- pulumi v3.242.0 (latest homebrew)
- pulumi libraries exactly as in package.json
- kind v0.31.0 go1.25.5 linux/amd64 w/ kindest/node:v1.35.0
Output of pulumi about
CLI
Version 3.242.0
Go Version go1.26.3
Go Compiler gc
Plugins
KIND NAME VERSION
resource kubernetes 4.28.0
language nodejs 3.242.0-dev.0
Host
OS ubuntu
Version 26.04
Arch x86_64
This project is written in nodejs: executable='/home/ceineke/.nvm/versions/node/v24.16.0/bin/node' version='v24.16.0' packagemanager='npm' packagemanagerVersion='11.15.0'
Current Stack://
TYPE URN
----8<---SNIPPED FOR BREVITY----8<----
Found no pending operations associated with
Backend
Name pulumi.com
URL https://app.pulumi.com/
User
Organizations
Token type personal
Dependencies:
NAME VERSION
@pulumi/kubernetes 4.28.0
@pulumi/pulumi 3.228.0
@types/node 22.13.14
typescript 5.9.3
Pulumi locates its logs in /tmp by default
Additional context
kind configuration:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30000
hostPort: 30000
listenAddress: "0.0.0.0"
protocol: TCP
- role: worker
- role: worker
- role: worker
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
What happened?
I have an encountered an issue with the kubernetes-ts-guestbook example. On line 41, the code references the labels from the deployment's metadata:
but here those labels aren't attached to the Service. In fact, the labels property is completely missing. I thought that I may need to
applythe metadata first:or the labels:
but even that didn't work. Instead, I can only get it to work by referencing the same local
labelsas in the Deployment resource:Example
Output of
pulumi aboutCLI
Version 3.242.0
Go Version go1.26.3
Go Compiler gc
Plugins
KIND NAME VERSION
resource kubernetes 4.28.0
language nodejs 3.242.0-dev.0
Host
OS ubuntu
Version 26.04
Arch x86_64
This project is written in nodejs: executable='/home/ceineke/.nvm/versions/node/v24.16.0/bin/node' version='v24.16.0' packagemanager='npm' packagemanagerVersion='11.15.0'
Current Stack://
TYPE URN
----8<---SNIPPED FOR BREVITY----8<----
Found no pending operations associated with
Backend
Name pulumi.com
URL https://app.pulumi.com/
User
Organizations
Token type personal
Dependencies:
NAME VERSION
@pulumi/kubernetes 4.28.0
@pulumi/pulumi 3.228.0
@types/node 22.13.14
typescript 5.9.3
Pulumi locates its logs in /tmp by default
Additional context
kind configuration:
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).