Prompt
How do I manage multiple Kubernetes clusters from one place?
Latest observation
Oct 19, 2026
OpenAI APIWeb search: off
The usual way is to use a single kubeconfig that contains credentials and contexts for all your clusters, then switch between them with kubectl.
1) Merge multiple clusters into one kubeconfig
You can combine configs like this:
KUBECONFIG=~/.kube/config:~/kubeconfigs/cluster1:~/kubeconfigs/cluster2 \
kubectl config view --merge --flatten > ~/.kube/config
Or set KUBECONFIG to multiple files and let kubectl read them together:
export KUBECONFIG=~/.kube/config:~/kubeconfigs/cluster1:~/kubeconfigs/cluster2
2) Switch between clusters
List contexts:
kubectl config get-contexts
Use one:
kubectl config use-context my-cluster-context
Check current context:
kubectl config current-context
3) Manage resources across clusters
Once the context is selected, all kubectl commands target that cluster:
kubectl get nodes
kubectl get pods -A
4) If you want a true “single pane of glass”
For centralized multi-cluster management, people often use tools like:
- Rancher — cluster management UI and access control
- Argo CD — GitOps deployment across many clusters
- Lens / OpenLens — desktop UI for multiple clusters
- kubectl plugins and scripts for bulk operations
- Kubernetes Federation (KubeFed) — for selected multi-cluster use cases
5) Best practices
- Give each cluster a clear context name.
- Use RBAC and separate service accounts per cluster.
- Keep kubeconfigs secure; they contain credentials.
- Prefer short-lived credentials if your cloud provider supports them.
- For automation, use separate kubeconfig files per environment and merge only when needed.
If you want, I can show you:
- how to set up a merged kubeconfig step by step, or
- how to manage many clusters with Rancher/Argo CD.