CmdID

CmdID / Commands

kubectl-config

Manage Kubernetes configuration (kubeconfig) files for accessing clusters via kubectl or the Kubernetes API. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

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-contextsIdentify

Get all clusters/contexts/users in a custom kubeconfig file

kubectl config get-clusters --kubeconfig path/to/kubeconfig.yamlIdentify
--kubeconfiguse a particular kubeconfig file kubectl reference

Get the current context

kubectl config current-contextIdentify

Set 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 reference

Switch to another context

kubectl config [use context_nameIdentify

Delete clusters/contexts/users

kubectl config delete-cluster clusterIdentify

Permanently add custom kubeconfig files

export KUBECONFIG="path/to/kubeconfig1.yaml:path/to/kubeconfig2.yaml"Identify