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