Kubectl Change Context -

kubectl config current-context This tells you the active cluster. I have this aliased in my .zshrc :

You’ve just been bitten by the .

Mastering the art of kubectl config use-context before you accidentally deploy your test app to the live cluster. Let me paint a picture. It’s 3:00 PM on a Tuesday. You’ve been debugging a tricky authentication bug in your staging environment for two hours. You finally fix it. You type kubectl apply -f deployment.yaml and hit Enter. kubectl change context

alias kctx='kubectl config current-context' But the real power move is seeing everything you can switch to: kubectl config current-context This tells you the active

To change your active cluster, you don't need to re-enter API keys, re-download certs, or pray to the cloud gods. You just run: kubectl change context