Skip to content

Instantly share code, notes, and snippets.

@mvisonneau
Created May 1, 2019 16:47
Show Gist options
  • Save mvisonneau/e4b42ac2a585d529bc3eebff6ac3c73b to your computer and use it in GitHub Desktop.
Save mvisonneau/e4b42ac2a585d529bc3eebff6ac3c73b to your computer and use it in GitHub Desktop.
Figure out what is the current namespace configured within the current context using kubectl & jq
kubectl config view -o json | jq -r ".contexts[] | select( .name | contains(\"$(kubectl config current-context)\")) | .context.namespace"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment