Skip to content

Instantly share code, notes, and snippets.

@eh-am
Last active February 7, 2018 16:04
Show Gist options
  • Save eh-am/8aa042e2f11a54b21a5b6681ea454c73 to your computer and use it in GitHub Desktop.
Save eh-am/8aa042e2f11a54b21a5b6681ea454c73 to your computer and use it in GitHub Desktop.
Kubernetes/helm snippets

Exec into a pod

kubectl exec POD_NAME --namespace=NAMESPACE -i -t -- sh

Get a configmap

Linux:

kubectl get configmaps SERVICE -o yaml --namespace=NAMESPACE |  sed 's/\\n/\n/g'

Osx:

kubectl get configmaps SERVICE -o yaml --namespace=NAMESPACE | sed 's/\\n/\
/g'

Restart pod

kubectl get pod PODNAME -n NAMESPACE -o yaml | kubectl replace --force -f -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment