Kubectl Switch Contexts ✯ [NEWEST]

kubectl port-forward service/payment-api 8080:80 -n payment-system Fast. Responsive. 20ms responses. Something was wrong—not with the code, but with his assumptions .

Then he opened his .bashrc and added three lines:

Now he ran the same commands.

alias kctx='kubectl config get-contexts -o name | fzf | xargs kubectl config use-context' Finally, he wrote a quick script for the team’s shared tooling: kubectl-warning.sh . It would flash a bright red warning if the context was anything other than prod-us-east and the --namespace flag was missing or set to default .