Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active May 24, 2023 03:13
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 zulhfreelancer/f4756f1ecd0dd33c6dd8cd5e9f0a97e2 to your computer and use it in GitHub Desktop.
Save zulhfreelancer/f4756f1ecd0dd33c6dd8cd5e9f0a97e2 to your computer and use it in GitHub Desktop.
How to view/extract a specific/current context kubeconfig?

How to view/extract a specific/current context kubeconfig?

If you have multiple Kubernetes contexts (list them by kubectl config get-contexts) and you want to view or extract the kubeconfig just for current/selected context, you can use one of the following command:

$ kubectl config view --minify --flatten

OR

$ kubectl config view --minify --raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment