Kubectl Switch Contexts -

CURRENT NAME CLUSTER NAMESPACE prod-us-east prod-cluster payment-system * staging-us-west staging-cluster payment-system dev-local dev-cluster default He was looking at . The alert was from production .

Then he opened his .bashrc and added three lines:

Then it hit him.

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.

kubectl logs payment-api-f9k3l-8hj2s -n payment-system --previous There it was. A connection pool exhaustion error to the Redis cache. The new deployment had increased the default pool size, and the production Redis max connections was too low. kubectl switch contexts

kubectl get pods -n payment-system The list appeared. Pods were running. That was odd. He checked the logs of the oldest one:

He looked at his terminal prompt. His shell was configured to show the current Kubernetes context in green. But today, it was… red . Twenty minutes later, Alex had rolled back the

Here’s a complete story focused on using kubectl to switch contexts, told from the perspective of a platform engineer named Alex. The Wrong Context