Install
openclaw skills install @rohitg00/k8s-multiclusterManage multiple Kubernetes clusters, switch contexts, and perform cross-cluster operations. Use when working with multiple clusters, comparing environments, or managing cluster lifecycle.
openclaw skills install @rohitg00/k8s-multiclusterCross-cluster operations and context management using kubectl-mcp-server's multi-cluster support.
Requires the
capi,cilium,diagnostics,gitops,istio,multiclustertoolsets: start kubectl-mcp-server with--toolsets default,capi,cilium,diagnostics,gitops,istio,multicluster(orMCP_TOOLSETS=default,capi,cilium,diagnostics,gitops,istio,multicluster). For deep work, the project-maintained MCP servers may fit better: Argo CD: https://github.com/argoproj-labs/mcp-for-argocd; Flux: https://fluxoperator.dev/mcp-server/.
Use this skill when:
| Priority | Rule | Impact | Tools |
|---|---|---|---|
| 1 | Always specify context for prod | CRITICAL | context parameter |
| 2 | List contexts before switching | HIGH | list_contexts |
| 3 | Compare before promoting | MEDIUM | compare_namespaces |
| 4 | Use naming conventions | LOW | prod-*, staging-* |
| Task | Tool | Example |
|---|---|---|
| List contexts | list_contexts | list_contexts() |
| View kubeconfig | kubeconfig_view | kubeconfig_view() |
| List CAPI clusters | capi_list_clusters | capi_list_clusters(namespace) |
| Get CAPI kubeconfig | capi_get_cluster_kubeconfig | capi_get_cluster_kubeconfig(name, namespace) |
list_contexts()
kubeconfig_view()
CLI: kubectl-mcp-server context <context-name>
All kubectl-mcp-server tools support the context parameter:
kubectl_get(resource_type="pods", namespace="default", context="production-cluster")
kubectl_get(resource_type="pods", namespace="default", context="staging-cluster")
compare_namespaces(
namespace1="production",
namespace2="staging",
resource_type="deployment",
context="production-cluster"
)
Query multiple clusters simultaneously:
kubectl_get(resource_type="pods", namespace="app", context="prod-us-east")
kubectl_get(resource_type="pods", namespace="app", context="prod-eu-west")
kubectl_get(resource_type="pods", namespace="app", context="development")
for context in ["prod-1", "prod-2", "staging"]:
kubectl_get(resource_type="nodes", context=context)
kubectl_get(resource_type="pods", namespace="kube-system", context=context)
For managing cluster lifecycle:
capi_list_clusters(namespace="capi-system")
capi_get_cluster(name="prod-cluster", namespace="capi-system")
capi_get_cluster_kubeconfig(name="prod-cluster", namespace="capi-system")
capi_list_machines(namespace="capi-system")
capi_list_machinedeployments(namespace="capi-system")
capi_scale_machinedeployment(
name="prod-cluster-md-0",
namespace="capi-system",
replicas=5
)
See CONTEXT-SWITCHING.md for detailed patterns.
Deploy charts to specific clusters:
install_helm_chart(
name="nginx",
chart="bitnami/nginx",
namespace="web",
context="production-cluster"
)
helm_list(
namespace="web",
context="staging-cluster"
)
gitops_apps_list(
namespace="flux-system",
context="cluster-1"
)
gitops_app_sync(
kind="kustomization",
name="apps",
namespace="flux-system",
context="cluster-2"
)
gitops_apps_list(namespace="argocd", context="management-cluster")
kubectl_get(resource_type="secrets", namespace="app", context="source-cluster")
kubectl_apply(secret_manifest, namespace="app", context="target-cluster")
With Cilium ClusterMesh or Istio multi-cluster:
cilium_list_nodes(context="cluster-1")
istio_proxy_status(context="cluster-2")
prod-us-east-1, staging-eu-west-1)prod-*, staging-*, dev-*)