skills/devops-sre/k8s/SKILL.md
Expertise in orchestrating and managing containerized applications at scale using Kubernetes.
npx skillsauth add alphaonedev/openclaw-graph k8sInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables the AI to orchestrate and manage containerized applications using Kubernetes, focusing on scaling, deployment, and maintenance of pods, services, and deployments in a cluster.
Use this skill for deploying multi-container apps, scaling workloads dynamically, managing resources in production environments, or troubleshooting cluster issues. Apply it when handling container orchestration beyond basic Docker, such as in CI/CD pipelines or microservices architectures.
Always authenticate with a valid kubeconfig file, set via the $KUBECONFIG environment variable. For declarative setups, write YAML files and apply them; for imperative tasks, use kubectl directly. Pattern: Load context with kubectl config use-context my-context, then perform actions. Include error checks in scripts, e.g., verify command exit codes.
Example 1: Deploy a simple Nginx pod.
kubectl run nginx-pod --image=nginx --port=80kubectl expose pod nginx-pod --type=NodePort --port=80kubectl get pods -l run=nginx-podExample 2: Scale a deployment.
kubectl apply -f deployment.yamlapiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-container image: my-imagekubectl scale deployment my-app --replicas=5kubectl get deployments my-appUse kubectl for CLI interactions; for API access, target the Kubernetes API server at endpoints like /api/v1/pods. Always specify namespaces with --namespace flag if needed.
kubectl get pods --namespace=default -o wide (flags: -o for output format, --namespace for scope)kubectl apply -f pod.yaml --record (flags: -f for file, --record for history)kubectl delete deployment my-app --cascade=foreground (flags: --cascade for dependent cleanup)kubectl set image deployment/my-app my-container=my-image:new-tagcurl -k -H "Authorization: Bearer $KUBE_TOKEN" https://api.example.com/api/v1/namespaces/default/podsapiVersion: v1 kind: Pod metadata: name: example spec: containers: - name: example image: nginxIntegrate Kubernetes with other tools via the Kubernetes API or operators. For authentication, use $KUBECONFIG for kubeconfig files or $KUBE_API_KEY for API tokens. Pattern: In scripts, check if $KUBECONFIG is set; if not, prompt or error out. For CI/CD, use tools like Argo CD or Jenkins plugins; example: Helm charts for packaging, installed via helm install my-chart ./chart-dir. Ensure compatibility with cloud providers like AWS EKS by setting provider-specific configs in kubeconfig.
Always check kubectl exit codes; if non-zero, use kubectl describe <resource> for details. Common errors: "NotFound" for missing resources—handle by checking existence first with kubectl get; "Forbidden" for permissions—verify RBAC roles. In code, wrap commands in try-catch blocks, e.g., in Python: import subprocess; try: subprocess.run(['kubectl', 'get', 'pods'], check=True) except subprocess.CalledProcessError as e: print(f"Error: {e}"). For API calls, handle HTTP errors like 403 or 500 by retrying with exponential backoff. Log events with kubectl get events --namespace=default to diagnose issues.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui