Is it just me or Pulumi has trouble interpolating ...
# general
d
Is it just me or Pulumi has trouble interpolating values using Downward API? I have the following set in my Deployment, but
DISCOVERY_HOSTNAME
resolves to a blank value.
Copy code
env: [
  {
    name: 'DISCOVERY_HOSTNAME',
    valueFrom: {
      fieldRef: {
        fieldPath: 'status.podIP'
      }
    }
  },
],
g
It worked when I tried the following:
Copy code
const appLabels = { app: "nginx" };
const deployment = new k8s.apps.v1.Deployment("nginx", {
    spec: {
        selector: { matchLabels: appLabels },
        replicas: 1,
        template: {
            metadata: { labels: appLabels },
            spec: {
                containers: [
                    {
                        name: "test-container",
                        image: "<http://k8s.gcr.io/busybox|k8s.gcr.io/busybox>",
                        command: ["sh", "-c"],
                        args: ["while true; do echo $MY_POD_IP; sleep 10; done;"],
                        env: [
                            {
                                name: 'MY_POD_IP',
                                valueFrom: {
                                    fieldRef: {
                                        fieldPath: 'status.podIP'
                                    }
                                }
                            },
                        ],
                    },
                ],
            },
        },
    },
},
);
Copy code
$ kubectl logs nginx-0trh4a3d-6745788d76-2qrvk
10.1.7.68
d
Interesting. I must have it wrong somewhere. Thank you for the reply