Manage Kubernetes clusters via kubectl and Helm - get resources, deploy applications, troubleshoot pods, manage nodes, and perform cluster operations with optional non-destructive mode for safe read-only access.
Manage Kubernetes clusters through kubectl and Helm operations. This skill provides comprehensive cluster management capabilities including resource inspection, application deployment, pod troubleshooting, node management, and Helm chart operations.
Before using this skill, ensure you have:
1. **kubectl** installed and available in your PATH
2. A valid **kubeconfig** file with contexts configured (default: `~/.kube/config`)
3. Access to a Kubernetes cluster (minikube, Rancher Desktop, GKE, EKS, AKS, etc.)
4. **Helm v3** installed (optional, only if using Helm operations)
Verify your connection by running `kubectl get pods` to ensure cluster access works without credential issues.
To view cluster resources:
```
Use kubectl_get to list all pods in the default namespace
Use kubectl_get with namespace parameter to list resources in a specific namespace
Use kubectl_describe to get detailed information about a specific pod, deployment, or service
Use kubectl_logs to retrieve logs from a container in a pod
```
To deploy applications to the cluster:
```
Use kubectl_create with a YAML manifest to create new resources
Use kubectl_apply with YAML to create or update resources declaratively
Use kubectl_scale to adjust the number of replicas for a deployment
Use kubectl_rollout to check rollout status or restart a deployment
```
When pods are failing or misbehaving:
```
Invoke the k8s-diagnose prompt with a keyword (e.g., pod name prefix) and optional namespace
Follow the autonomous troubleshooting flow to identify issues
Use kubectl_logs to examine container logs for errors
Use kubectl_describe to check pod events and status
Use cleanup_pods to remove stuck pods in states like CrashLoopBackOff or ImagePullBackOff
```
To deploy and manage Helm charts:
```
Use install_helm_chart to install a chart from a repository
Use upgrade_helm_chart to update an existing release with new values
Use uninstall_helm_chart to remove a Helm release
Use helm_template_apply as an alternative that renders templates and applies with kubectl (avoids auth issues)
Use helm_template_uninstall to uninstall charts using the template approach
```
To perform node maintenance operations:
```
Use node_management with action "cordon" to mark a node as unschedulable
Use node_management with action "drain" to safely evict pods before maintenance
Use node_management with action "uncordon" to return a node to service
```
To debug applications locally:
```
Use port_forward to forward a local port to a pod or service
Access the application on localhost at the forwarded port
Use stop_port_forward when done to terminate the forwarding session
```
For read-only or create/update-only access (no deletions):
```
All kubectl_get, kubectl_describe, kubectl_logs operations remain available
kubectl_apply, kubectl_create, kubectl_scale, kubectl_patch, kubectl_rollout remain available
Destructive operations like kubectl_delete, uninstall_helm_chart, and cleanup_pods are disabled
Configure in Claude Desktop by setting env var: ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true
```
**List all pods in the kube-system namespace:**
```
Use kubectl_get to list pods in namespace kube-system
```
**Deploy a new application from YAML:**
```
Use kubectl_apply with the following YAML manifest: [provide manifest]
```
**Troubleshoot a failing pod:**
```
Invoke k8s-diagnose prompt with keyword "my-app" and namespace "production"
```
**Scale a deployment to 5 replicas:**
```
Use kubectl_scale to set deployment/my-app to 5 replicas in namespace default
```
**Install a Helm chart:**
```
Use install_helm_chart to install nginx-ingress from the ingress-nginx repository
```
**Forward local port 8080 to a service:**
```
Use port_forward to forward local port 8080 to service/my-service on port 80 in namespace default
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/kubernetes-cluster-management/raw