Switching clusters in kubectl CLI

kubectl Dec 14, 2023

This is as my note

Show all configured clusters/contexts

> kubectl config get-contexts

Same as in config file

> cat ~/.kube/config
We can add/delete/modify directly the config file

Switch cluster/context

> kubectl config use-context [context name]

Change namespace

> kubectl config set-context --current --namespace [ns name]

Dai (Bato) Quach

Senior solution architect with strong experiences in middleware.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.