zeh
zeh

Reputation: 1317

How to change default namespace in kubernetes' context from default kops command?

I use kops export kubecfg ${NAME} to create a context for kubectl , however, I would like to change the default namespace.

I know I can create a namespace in a new context with something like:

kubectl config set-context my-context --namespace=myNamespace

But how could I change the default namespace in an already existing context?

Upvotes: 0

Views: 1049

Answers (1)

zeh
zeh

Reputation: 1317

Turns out that set-context is a misnomer and it can be user to modify a context, so the following will do just what is needed to change de default namespace in kubectl from kops command:

kubectl config set-context ${NAME} --namespace=myNamespace

Upvotes: 1

Related Questions