
K8s Multicluster
- 10 installs
- 941 repo stars
- Updated April 8, 2026
- rohitg00/kubectl-mcp-server
Helps with ai & agent building tasks during AI-assisted development.
About
k8s-multicluster is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- k8s-multicluster
- AI & Agent Building
- AI-coding skill
K8s Multicluster by the numbers
- 10 all-time installs (skills.sh)
- Ranked #11,959 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/rohitg00/kubectl-mcp-server --skill k8s-multiclusterAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 10 |
|---|---|
| repo stars | ★ 941 |
| Last updated | April 8, 2026 |
| Repository | rohitg00/kubectl-mcp-server ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Multi-Cluster Kubernetes Management
Cross-cluster operations and context management using kubectl-mcp-server's multi-cluster support.
When to Apply
Use this skill when:
- User mentions: "cluster", "context", "multi-cluster", "cross-cluster"
- Operations: switching contexts, comparing clusters, federated deployments
- Keywords: "different environment", "production vs staging", "all clusters"
Priority Rules
| Priority | Rule | Impact | Tools |
|---|---|---|---|
| 1 | Always specify context for prod | CRITICAL | context parameter |
| 2 | List contexts before switching | HIGH | list_contexts_tool |
| 3 | Compare before promoting | MEDIUM | compare_namespaces |
| 4 | Use naming conventions | LOW | prod-*, staging-* |
Quick Reference
| Task | Tool | Example |
|---|---|---|
| List contexts | list_contexts_tool | list_contexts_tool() |
| View kubeconfig | kubeconfig_view | kubeconfig_view() |
| List CAPI clusters | capi_clusters_list_tool | capi_clusters_list_tool(namespace) |
| Get CAPI kubeconfig | capi_cluster_kubeconfig_tool | capi_cluster_kubeconfig_tool(name, namespace) |
Context Management
List Available Contexts
list_contexts_tool()View Current Context
kubeconfig_view()Switch Context
CLI: kubectl-mcp-server context <context-name>
Cross-Cluster Operations
All kubectl-mcp-server tools support the context parameter:
get_pods(namespace="default", context="production-cluster")
get_pods(namespace="default", context="staging-cluster")Common Multi-Cluster Patterns
Compare Environments
compare_namespaces(
namespace1="production",
namespace2="staging",
resource_type="deployment",
context="production-cluster"
)Parallel Queries
Query multiple clusters simultaneously:
get_pods(namespace="app", context="prod-us-east")
get_pods(namespace="app", context="prod-eu-west")
get_pods(namespace="app", context="development")Cross-Cluster Health Check
for context in ["prod-1", "prod-2", "staging"]:
get_nodes(context=context)
get_pods(namespace="kube-system", context=context)Cluster API (CAPI) Management
For managing cluster lifecycle:
List Managed Clusters
capi_clusters_list_tool(namespace="capi-system")Get Cluster Details
capi_cluster_get_tool(name="prod-cluster", namespace="capi-system")Get Workload Cluster Kubeconfig
capi_cluster_kubeconfig_tool(name="prod-cluster", namespace="capi-system")Machine Management
capi_machines_list_tool(namespace="capi-system")
capi_machinedeployments_list_tool(namespace="capi-system")Scale Cluster
capi_machinedeployment_scale_tool(
name="prod-cluster-md-0",
namespace="capi-system",
replicas=5
)See CONTEXT-SWITCHING.md for detailed patterns.
Multi-Cluster Helm
Deploy charts to specific clusters:
install_helm_chart(
name="nginx",
chart="bitnami/nginx",
namespace="web",
context="production-cluster"
)
list_helm_releases(
namespace="web",
context="staging-cluster"
)Multi-Cluster GitOps
Flux Across Clusters
flux_kustomizations_list_tool(
namespace="flux-system",
context="cluster-1"
)
flux_reconcile_tool(
kind="kustomization",
name="apps",
namespace="flux-system",
context="cluster-2"
)ArgoCD Across Clusters
argocd_apps_list_tool(namespace="argocd", context="management-cluster")Federation Patterns
Secret Synchronization
get_secrets(namespace="app", context="source-cluster")
kubectl_apply(secret_manifest, namespace="app", context="target-cluster")Cross-Cluster Service Discovery
With Cilium ClusterMesh or Istio multi-cluster:
cilium_nodes_list_tool(context="cluster-1")
istio_proxy_status_tool(context="cluster-2")Best Practices
1. Naming Convention: Use descriptive context names (prod-us-east-1, staging-eu-west-1) 2. Access Control: Different kubeconfigs per environment 3. Always Specify Context: Avoid accidental cross-cluster operations 4. Cluster Groups: Organize by purpose (prod-*, staging-*, dev-*)
Related Skills
- k8s-troubleshoot - Debug across clusters
- k8s-gitops - GitOps multi-cluster
- k8s-capi - Cluster API management
Kubernetes Context Management
Patterns for managing multiple cluster contexts.
Understanding Contexts
A kubeconfig context combines:
- Cluster: API server URL and CA certificate
- User: Authentication credentials
- Namespace: Default namespace (optional)
Context Naming Conventions
By Environment
production-us-east-1
production-eu-west-1
staging-us-east-1
developmentBy Purpose
management-cluster
workload-cluster-1
workload-cluster-2
monitoring-clusterBy Team
team-a-dev
team-a-prod
team-b-dev
platform-adminMCP Commands
# List all contexts
list_contexts_tool()
# View kubeconfig (sanitized)
kubeconfig_view()Context in Every Command
All kubectl-mcp-server tools accept context parameter:
# Explicit context (recommended)
get_pods(namespace="default", context="production")
get_pods(namespace="default", context="staging")
# Current context (implicit)
get_pods(namespace="default")Multi-Cluster Patterns
Compare Environments
# Get deployments from both clusters
prod_deps = get_deployments(namespace="app", context="production")
staging_deps = get_deployments(namespace="app", context="staging")Cross-Cluster Secret Sync
# Read secret from source
secret = get_secrets(namespace="app", context="source-cluster")
# Apply to target (via manifest)
apply_manifest(secret_yaml, namespace="app", context="target-cluster")Parallel Health Checks
contexts = ["prod-1", "prod-2", "staging"]
for ctx in contexts:
nodes = get_nodes(context=ctx)
pods = get_pods(namespace="kube-system", context=ctx)
# Report statusRolling Deployment Across Clusters
# Deploy to staging first
install_helm_chart(name="app", chart="./app",
namespace="prod", context="staging")
# Verify
get_pods(namespace="prod", label_selector="app=myapp", context="staging")
# Deploy to production regions sequentially
for region in ["us-east", "us-west", "eu-west"]:
install_helm_chart(name="app", chart="./app",
namespace="prod", context=f"production-{region}")
# Wait for healthy
get_pods(namespace="prod", context=f"production-{region}")Access Control Per Context
Separate Kubeconfigs
# Different files per environment
export KUBECONFIG=~/.kube/production.yaml
export KUBECONFIG=~/.kube/development.yamlService Account Per Cluster
# Different SAs for different access levels
# Production: read-only SA
get_pods(namespace="app", context="production-readonly")
# Development: full access SA
apply_manifest(manifest, namespace="app", context="development-admin")Cluster API Management
For managing cluster lifecycle:
# List CAPI-managed clusters
capi_clusters_list_tool(namespace="capi-system")
# Get workload cluster kubeconfig
kubeconfig = capi_cluster_kubeconfig_tool(
name="workload-cluster-1",
namespace="capi-system"
)
# Use the kubeconfig to access workload cluster
# (save to file, add to contexts)Federation Patterns
Kubefed Resources
Cross-cluster resource propagation with KubeFed.
Cluster Mesh (Cilium)
# Check Cilium cluster mesh status
cilium_nodes_list_tool(context="cluster-1")
cilium_nodes_list_tool(context="cluster-2")Multi-Cluster Service Mesh (Istio)
istio_proxy_status_tool(context="primary")
istio_proxy_status_tool(context="remote")Best Practices
1. Always Use Explicit Context
# Good: explicit
get_pods(context="production")
# Risky: implicit
get_pods() # Which cluster?2. Naming Convention
- Consistent format:
<env>-<region> - Short but descriptive
3. Read-Only for Production
- Default production context: read-only
- Separate admin context for changes
4. Audit Cross-Cluster Operations
- Log which clusters are accessed
- Track who made changes
5. Separate Credentials
- Different SAs per environment
- Shorter token lifetimes for prod
Troubleshooting
Context Not Found
list_contexts_tool()
# Verify context name is correctAuthentication Failure
# Check credentials
# Token expired?
# Certificate valid?Network Issues
# API server reachable?
# VPN connected?
# Firewall rules?