kubectl config
all
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`. See also: `kubectx`, `kubens`.
More info →Options (1)
booleanSwitch to another context
Example:
kubectl config {{[use|use-context]}} {{context_name}}Examples (7)
Get all contexts in the default kubeconfig file
kubectl config get-contextsGet all clusters/contexts/users in a custom kubeconfig file
kubectl config get-clusters|get-contexts|get-users --kubeconfig path/to/kubeconfig.yamlGet the current context
kubectl config current-contextSet the default namespace of the current context
kubectl config set-context --current --namespace namespaceSwitch to another context
kubectl config [use|use-context] context_nameDelete clusters/contexts/users
kubectl config delete-cluster|delete-context|delete-user cluster|context|userPermanently add custom kubeconfig files
export KUBECONFIG="path/to/kubeconfig1.yaml:path/to/kubeconfig2.yaml"made by @shridhargupta | data from tldr-pages