
Managing Multiple Kubernetes Clusters Without Losing Your Mind
If you work with Kubernetes in production, you probably don't have just one cluster. You might have regional replicas, a staging environment, a dev cluster, maybe a sandbox for experiments. Your kubeconfig has a dozen contexts and growing. And every time you need to check something across clusters, you do this dance: kubectl config use-context prod-us-east-1 kubectl get pods -n backend kubectl config use-context prod-eu-west-1 kubectl get pods -n backend kubectl config use-context staging-us-east-1 kubectl get pods -n backend # ... you get the idea Or maybe you've written a shell loop: for ctx in prod-us-east-1 prod-eu-west-1 ; do echo "=== $ctx ===" kubectl --context " $ctx " get pods -n backend done This works until it doesn't — hardcoded cluster names, no parallelism, no error handling, no timeout for that one cluster with flaky networking. Every team ends up with their own version of this script. A better way I built kubectl-xctx to solve this properly. It's a kubectl plugin that t
Continue reading on Dev.to DevOps
Opens in a new tab



