Kubectl Get-contexts ((exclusive)) -
The Context Switch
From that day forward, she aliased a new command in her .bashrc :
alias kctx="kubectl get-contexts && echo '---' && kubectl config current-context" And every time she opened a terminal, she knew exactly which universe she was about to change. kubectl get-contexts
Maya’s terminal was a mess of green text. She was trying to debug why payment latency had spiked to four seconds in . Her fingers flew across the keyboard.
CURRENT NAME CLUSTER dev-cluster dev-cluster * staging-cluster staging-cluster prod-cluster prod-cluster She wasn't in . She was in staging-cluster . The Context Switch From that day forward, she
She re-ran the scale command, watched the new pods spin up, and saw the latency graph finally flatten.
Later, at the post-mortem meeting, her manager asked, “What was the root cause?” Her fingers flew across the keyboard
She swore under her breath. “How did I forget to switch contexts?”