Way to get list of field references in Kubernetes

12/19/2017

In kubernetes we can easily expose certain params and values through environment variables. Examples of these can be the node IP, the container uid, etc.

Example

 - name: POD_ID
      valueFrom:
        fieldRef:
          fieldPath: metadata.uid

However, I was wondering if there is a way to list the possible references that can be included in the pod. Either in the form of an API reference or dynamically on a pod.

-- Glenn Vandamme
google-kubernetes-engine
kubernetes

1 Answer

12/19/2017

Figured it out myself, you can only reference the variables that are also exposed if you kubectl edit pod <podname> a pod.

-- Glenn Vandamme
Source: StackOverflow