| CURRENT | NAME | CLUSTER | NAMESPACE | |---------|--------------------|--------------------|-----------| | * | dev-local | kind-dev | default | | | staging-gcp | gke-staging | frontend | | | prod-aws | arn:aws:eks:... | prod | Here’s where most tutorials stop, but you shouldn’t. A context is actually a triple: (cluster, user, namespace) .
kubectl config current-context This tells you the active cluster. I have this aliased in my .zshrc : kubectl change context
Now go forth, switch safely, and may your deployments always land where you intend. Have a "wrong context" horror story? Or a clever alias that saves you daily? Drop it in the comments—misery loves company. | CURRENT | NAME | CLUSTER | NAMESPACE
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
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.
The terminal blinks. Then it whispers back: "deployment.apps/payment-gateway created."