Skip to content

Instantly share code, notes, and snippets.

@gladiatr72
Last active December 16, 2021 20:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gladiatr72/f9d70de915eb8fe61a2b074f1b9ea951 to your computer and use it in GitHub Desktop.
Save gladiatr72/f9d70de915eb8fe61a2b074f1b9ea951 to your computer and use it in GitHub Desktop.
pull status elements into environment
spec:
containers:
-
name: misc
image: gladiatr72/misc:util-21
env:
-
name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
Name Description
spec.nodename The name of the node where the Pod is running
status.hostIP The IP address of the node where the Pod us running
metadata.name The Pod name (notice that this is different than the container’s name. A Pod may have more than one container
metadata.namespace The namespace of the Pod
status.podIP The IP address of the Pod
spec.serviceAccountName The service account that was used with the Pod
metadata.uid The UID of the running Po
metadata.labels[‘label’] The value of the label put on the Pod. For example, if a Pod is labeled env=prod, then metadata.labels[‘env’] returns ‘prod’
metadata.annotations[‘annotation’] Similar to labels, it gets the value of the specified annotation
Name Description
requests.cpu The amount of CPU specified in the requests field of the Pod definition
requests.memory The amount of memory specified in the requests field of the Pod definition
limits.cpu The CPU limit of the Pod
limits.memory The memory limit of the Pod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment