Skip to content

Instantly share code, notes, and snippets.

@devth
Last active May 19, 2016 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devth/4fb6346b2b9b04039be3badf0d85fbd5 to your computer and use it in GitHub Desktop.
Save devth/4fb6346b2b9b04039be3badf0d85fbd5 to your computer and use it in GitHub Desktop.
Obtain metadata in pods
# Useful for installing kubectl in a docker image
curl -L -O https://storage.googleapis.com/kubernetes-release/release/v1.2.4/bin/linux/amd64/kubectl
# obtain the node name inside a pod
KUBERNETES_NODENAME=`kubectl get pods --namespace=${KUBERNETES_NAMESPACE} ${KUBERNETES_PODNAME} -o json | jq -r .spec.nodeName`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment