Empty variable when using `status.hostIP` as reference field for my env variable in kubernetes

10/12/2020

I'm deploying a kubernetes pod using helm v3, my kubectl client and server are above 1.7 so it should support reference fields. However when i deploy, the value is just empty.

using

environment:
  - name: DD_AGENT_HOST
    valueFrom:
      fieldRef:
        fieldPath: status.hostIP

Where the DD_AGENT_HOST is my env variable that should be given the host ip.

Any idea on why this might be happening?

-- Maxim
datadog
kubernetes
kubernetes-helm
kubernetes-pod
yaml

1 Answer

10/13/2020

Had to add it this to the container specification directly, not passing from an env and using include from helm as that doesn't work

-- Maxim
Source: StackOverflow