1

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

0

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.

0

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.

New contributor
thiagowfx is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.