Kubectl | Set-context

export KUBECONFIG=~/.kube/config:~/secrets/gke-config kubectl set-context gke-prod --cluster=gke-prod --user=gke-user

Need to repoint a context to a different cluster? You can do that without deleting and recreating it. kubectl set-context

kubectl set-context modifies your (usually ~/.kube/config ). You can see the changes directly: export KUBECONFIG=~/

# Update the currently active context kubectl config set-context --current --namespace=backend kubectl set-context