Patched: Kubectl Switch Contexts
He pushed it to the team’s dotfiles repo with a single commit message: From that day on, every engineer on the team had a colorful, impossible-to-ignore shell prompt. And not once—not a single time—did anyone ever again spend ten minutes troubleshooting the wrong cluster.
He’d been debugging the wrong cluster for the last ten minutes. kubectl switch contexts
Then he opened his .bashrc and added three lines: He pushed it to the team’s dotfiles repo
Twenty minutes later, Alex had rolled back the deployment, adjusted the Redis maxclients setting, and re-deployed the fix. Latency returned to normal. The alert cleared. Then he opened his
But Alex never forgot that feeling. The cold realization that you’re looking at a mirror image of the problem, not the problem itself.
# Show k8s context in prompt export PS1='\[\e[33m\](k8s: $(kubectl config current-context 2>/dev/null))\[\e[0m\] \w \$ ' He also created an alias he’d never forget: