Search code examples
kubernetesyamlkubernetes-helmkubernetes-poddatadog

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


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?


Solution

  • 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