Kubectl Change Context May 2026

We’ve all been there. And the single most important command to break that curse is: kubectl config use-context . By default, kubectl doesn't care about your feelings—or your environment. It remembers the last cluster you touched. If you were troubleshooting in dev-east yesterday, you’re likely still pointing at dev-east today.

kubectl config get-contexts This outputs a tidy table showing all your available clusters, their namespaces, and which one has the * (active) star next to it. kubectl change context

You’ve just been bitten by the .

The danger isn't malice; it’s . You forget to switch contexts like you forget to un-mute your mic in a meeting. And the consequences range from "oops, I restarted the wrong dashboard" to "why is QA testing my half-written feature?" The Hero Command: kubectl config use-context The fix is simple, fast, and boring—which is exactly what you want from an infrastructure tool. We’ve all been there

alias kctx='kubectl config current-context' But the real power move is seeing everything you can switch to: It remembers the last cluster you touched