K8

k8s-multicluster

Manages contexts and configurations to switch between and inspect multiple Kubernetes clusters.

Install

mkdir -p .claude/skills/k8s-multicluster && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3858" && unzip -o skill.zip -d .claude/skills/k8s-multicluster && rm skill.zip

Installs to .claude/skills/k8s-multicluster

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Manage multiple Kubernetes clusters, switch contexts, and perform cross-cluster operations. Use when working with multiple clusters, comparing environments, or managing cluster lifecycle.
187 chars✓ has a “when” trigger
Advanced

Key capabilities

  • →Switch between multiple Kubernetes cluster contexts
  • →Perform cross-cluster operations and queries
  • →List and manage Cluster API (CAPI) clusters
  • →Deploy Helm charts to specific clusters
  • →Execute GitOps reconciliations across clusters

How it works

It manages kubeconfig contexts and passes them as parameters to tools to perform operations on specific clusters.

Inputs & outputs

You give it
Context name and operation
You get back
Cross-cluster resource state or action result

When to use k8s-multicluster

  • →Switch between staging and production clusters
  • →List all available kubeconfig contexts
  • →Compare namespaces across different clusters
  • →View current cluster context

About this skill

Multi-Cluster Kubernetes Management

Cross-cluster operations and context management using kubectl-mcp-server's multi-cluster support.

Requires the capi, cilium, diagnostics, gitops, istio, multicluster toolsets: start kubectl-mcp-server with --toolsets default,capi,cilium,diagnostics,gitops,istio,multicluster (or MCP_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/.

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

PriorityRuleImpactTools
1Always specify context for prodCRITICALcontext parameter
2List contexts before switchingHIGHlist_contexts
3Compare before promotingMEDIUMcompare_namespaces
4Use naming conventionsLOWprod-*, staging-*

Quick Reference

TaskToolExample
List contextslist_contextslist_contexts()
View kubeconfigkubeconfig_viewkubeconfig_view()
List CAPI clusterscapi_list_clusterscapi_list_clusters(namespace)
Get CAPI kubeconfigcapi_get_cluster_kubeconfigcapi_get_cluster_kubeconfig(name, namespace)

Context Management

List Available Contexts

list_contexts()

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:

kubectl_get(resource_type="pods", namespace="default", context="production-cluster")

kubectl_get(resource_type="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:

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")

Cross-Cluster Health Check

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)

Cluster API (CAPI) Management

For managing cluster lifecycle:

List Managed Clusters

capi_list_clusters(namespace="capi-system")

Get Cluster Details

capi_get_cluster(name="prod-cluster", namespace="capi-system")

Get Workload Cluster Kubeconfig

capi_get_cluster_kubeconfig(name="prod-cluster", namespace="capi-system")

Machine Management

capi_list_machines(namespace="capi-system")
capi_list_machinedeployments(namespace="capi-system")

Scale Cluster

capi_scale_machinedeployment(
    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"
)

helm_list(
    namespace="web",
    context="staging-cluster"
)

Multi-Cluster GitOps

Flux Across Clusters

gitops_apps_list(
    namespace="flux-system",
    context="cluster-1"
)

gitops_app_sync(
    kind="kustomization",
    name="apps",
    namespace="flux-system",
    context="cluster-2"
)

ArgoCD Across Clusters

gitops_apps_list(namespace="argocd", context="management-cluster")

Federation Patterns

Secret Synchronization

kubectl_get(resource_type="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_list_nodes(context="cluster-1")
istio_proxy_status(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

When not to use it

  • →When a single cluster environment is sufficient

Prerequisites

kubectl-mcp-server

Limitations

  • →Requires distinct kubeconfigs for each environment
  • →Naming conventions are necessary for effective management

How it compares

It enables parallel operations across multiple clusters instead of switching contexts manually for every command.

Compared to similar skills

k8s-multicluster side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
k8s-multicluster (this skill)19moNo flagsAdvanced
linkerd-patterns68moReviewAdvanced
storage-networking610moReviewAdvanced
k8s-helm89moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by rohitg00

View all by rohitg00 →

You might also like

linkerd-patterns

wshobson

Implement Linkerd service mesh patterns for lightweight, security-focused service mesh deployments. Use when setting up Linkerd, configuring traffic policies, or implementing zero-trust networking with minimal overhead.

672

storage-networking

pluginagentmarketplace

Master Kubernetes storage management and networking architecture. Learn persistent storage, network policies, service discovery, and ingress routing.

663

k8s-helm

rohitg00

Manage Helm charts, releases, and repositories. Use for Helm installations, upgrades, rollbacks, chart development, and release management.

857

kubernetes-architect

sickn33

Expert Kubernetes architect specializing in cloud-native infrastructure, advanced GitOps workflows (ArgoCD/Flux), and enterprise container orchestration. Masters EKS/AKS/GKE, service mesh (Istio/Linkerd), progressive delivery, multi-tenancy, and platform engineering. Handles security, observability, cost optimization, and developer experience. Use PROACTIVELY for K8s architecture, GitOps implementation, or cloud-native platform design.

636

gitops-workflow

sickn33

Implement GitOps workflows with ArgoCD and Flux for automated, declarative Kubernetes deployments with continuous reconciliation. Use when implementing GitOps practices, automating Kubernetes deployments, or setting up declarative infrastructure management.

521

devops-iac-engineer

davila7

Implements infrastructure as code using Terraform, Kubernetes, and cloud platforms. Designs scalable architectures, CI/CD pipelines, and observability solutions. Provides security-first DevOps practices and site reliability engineering guidance.

223

Search skills

Search the agent skills registry