# List all contexts kubectl config get-contexts
kubectl config current-context
Let's say you have two contexts: dev-env and prod-env , and you want to switch to prod-env . Here's how you can do it: kubectl set current context
# List all contexts kubectl config get-contexts
kubectl config current-context
Let's say you have two contexts: dev-env and prod-env , and you want to switch to prod-env . Here's how you can do it: