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.
kubectl get-contexts Her heart stopped.
CURRENT NAME CLUSTER dev-cluster dev-cluster * staging-cluster staging-cluster prod-cluster prod-cluster She wasn't in . She was in staging-cluster . kubectl get-contexts
Quickly, she corrected her mistake:
She swore under her breath. “How did I forget to switch contexts?” Maya’s terminal was a mess of green text
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 Her heart stopped
kubectl config use-context prod-cluster kubectl get-contexts CURRENT NAME CLUSTER dev-cluster dev-cluster staging-cluster staging-cluster * prod-cluster prod-cluster Now the * sat beside .