Skip to content

kubernetes-ts-guestbook: #2776

@ChrisEineke

Description

@ChrisEineke

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:

                labels: labels,

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSome behavior is incorrect or out of specneeds-triageNeeds attention from the triage team

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions