kubectl config

kubeconfig, and

Syntax

kubectl config <subcommand> [flags]

Parameters

ParametersDescriptionExamplesLevel
get-contexts kubectl config get-contexts Common
current-context kubectl config current-context Common
use-context kubectl config use-context production Common
set-context kubectl config set-context --current --namespace=dev Advanced
view kubeconfig kubectl config view --minify Common

Examples

kubectl config get-contexts
*

kubectl config use-context production-cluster

kubectl config set-context --current --namespace=my-app
-n Parameters

kubectl config view --minify
--minify

kubectl config delete-context old-cluster

Common Errors

context not foundget-contexts
unable to connect to the server, VPN

Tips

Related Commands