kubectl-config
Manage Kubernetes configuration (kubeconfig) files for accessing clusters via kubectl or the Kubernetes API. tldr-pages
On several platforms
Several platforms
Manage Kubernetes configuration (kubeconfig) files for accessing clusters via kubectl or the Kubernetes API. By default, the Kubernetes will get its configuration from ${HOME}/.kube/config.
Get all contexts in the default kubeconfig file
kubectl config get-contextsIdentifyGet all clusters/contexts/users in a custom kubeconfig file
kubectl config get-clusters --kubeconfig path/to/kubeconfig.yamlIdentify--kubeconfiguse a particular kubeconfig file kubectl referenceGet the current context
kubectl config current-contextIdentifySet the default namespace of the current context
kubectl config set-context --current --namespace namespaceIdentify--currentModify the current context kubectl reference--namespacenamespace for the context entry in kubeconfig kubectl referenceSwitch to another context
kubectl config [use context_nameIdentifyDelete clusters/contexts/users
kubectl config delete-cluster clusterIdentifyPermanently add custom kubeconfig files
export KUBECONFIG="path/to/kubeconfig1.yaml:path/to/kubeconfig2.yaml"Identify