When I do :

$ kubectl config get-contexts

CURRENT   NAME                          CLUSTER                                                            AUTHINFO                                                           NAMESPACE
          kubernetes-admin@kubernetes   kubernetes                                                         kubernetes-admin
*         qa-1                        arn:aws:eks:xxxxxx150:cluster/ocean-qa   xxx:xxx:cluster/xxxx-RH36mmA4   xx-xx-tulw

I have multiple contexts defined in the config file. I would like to set 'kubernetes-admin@kubernetes' cluster as the default each time I use kubectl.

I can't find the command ..

2 Answers 2


kubectl config use-context kubernetes-admin@kubernetes should be the command you are lookin for.

To check if it worked, use kubectl config current-context.

If in doubt, check its help with kubectl config set-context --help.


Alternatively run grep current-context ~/.kube/config to see the current context.

If it's not set to the desired one, edit ~/.kube/config and change that line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.