debug:kubernetes
Debug Kubernetes clusters and workloads systematically with this comprehensive troubleshooting skill. Covers CrashLoopBackOff, ImagePullBackOff, OOMKilled, pending pods, service connectivity issues, PVC binding failures, and RBAC permission errors. Provides structured four-phase debugging methodology with kubectl commands, ephemeral debug containers, and essential one-liners for diagnosing pod, service, network, and storage problems across namespaces.
What this skill does
# Kubernetes Debugging Guide A systematic approach to diagnosing and resolving Kubernetes issues. Always start with the basics: check events and logs first. ## Common Error Patterns ### CrashLoopBackOff **What it means:** Container repeatedly crashes and fails to start. Kubernetes restarts it with exponential backoff (10s, 20s, 40s... up to 5 minutes). **Common causes:** - Insufficient memory/CPU resources - Missing dependencies in container image - Misconfigured liveness/readiness probes - Application code errors or misconfigurations - Missing environment variables or secrets **Debug steps:** ```bash # Check pod events and status kubectl describe pod <pod-name> -n <namespace> # View current and previous container logs kubectl logs <pod-name> -n <namespace> kubectl logs <pod-name> -n <namespace> --previous # Check resource limits vs actual usage kubectl top pod <pod-name> -n <namespace> ``` **Solutions:** - Tune probe `initialDelaySeconds` and `timeoutSeconds` - Increase resource limits if hitting memory/CPU caps - Fix missing dependencies in Dockerfile - Review application startup code for errors --- ### ImagePullBackOff **What it means:** Kubernetes cannot pull the container image. Retries with increasing delay (5s, 10s, 20s... up to 5 minutes). **Common causes:** - Incorrect image name or tag - Missing registry authentication credentials - Private registry without imagePullSecrets configured - Network connectivity issues to registry - Image does not exist in registry **Debug steps:** ```bash # Check pod events for specific error kubectl describe pod <pod-name> -n <namespace> # Verify image name in deployment kubectl get deployment <name> -n <namespace> -o yaml | grep image: # Check if imagePullSecrets are configured kubectl get pod <pod-name> -n <namespace> -o yaml | grep -A5 imagePullSecrets # Test pulling image from node (if you have node access) docker pull <image-name> ``` **Solutions:** - Correct image name/tag in deployment spec - Create and attach imagePullSecret for private registries - Verify network access to container registry - Check registry credentials haven't expired --- ### Pending Pods (Scheduling Failures) **What it means:** Pod cannot be scheduled to any node. **Common causes:** - Insufficient cluster resources (CPU/memory) - Node selectors or affinity rules cannot be satisfied - Taints without matching tolerations - PersistentVolumeClaim not bound - Resource quotas exceeded **Debug steps:** ```bash # Check why pod is pending kubectl describe pod <pod-name> -n <namespace> # View cluster events kubectl get events -n <namespace> --sort-by='.lastTimestamp' # Check node resources kubectl describe nodes | grep -A5 "Allocated resources" kubectl top nodes # Check PVC status if using persistent storage kubectl get pvc -n <namespace> ``` **Solutions:** - Scale up cluster or reduce resource requests - Adjust nodeSelector/affinity rules - Add tolerations for node taints - Create or fix PersistentVolume bindings - Increase namespace resource quotas --- ### OOMKilled **What it means:** Container was forcefully terminated (SIGKILL, exit code 137) for exceeding memory limit. **Common causes:** - Memory limit set too low for application - Memory leak in application code - Processing large files or datasets - High concurrency causing memory spikes - JVM/runtime heap misconfiguration **Debug steps:** ```bash # Check termination reason kubectl describe pod <pod-name> -n <namespace> | grep -A10 "Last State" # View logs before termination kubectl logs <pod-name> -n <namespace> --previous # Check memory limits vs usage kubectl top pod <pod-name> -n <namespace> kubectl get pod <pod-name> -n <namespace> -o yaml | grep -A5 resources: ``` **Solutions:** - Increase memory limits in deployment spec - Profile application for memory leaks - Configure application memory settings (e.g., JVM -Xmx) - Implement memory-efficient processing patterns - Add horizontal pod autoscaling for load distribution --- ### Service Not Reachable **What it means:** Cannot connect to service from within or outside cluster. **Common causes:** - Service selector doesn't match pod labels - Pod not ready (failing readiness probe) - NetworkPolicy blocking traffic - Service port mismatch with container port - Ingress/LoadBalancer misconfiguration **Debug steps:** ```bash # Check service and endpoints kubectl get svc <service-name> -n <namespace> kubectl get endpoints <service-name> -n <namespace> kubectl describe svc <service-name> -n <namespace> # Verify pod labels match service selector kubectl get pods -n <namespace> --show-labels kubectl get svc <service-name> -n <namespace> -o yaml | grep -A5 selector # Test connectivity from within cluster kubectl run debug --rm -it --image=busybox -- wget -qO- http://<service-name>.<namespace>:port # Check network policies kubectl get networkpolicy -n <namespace> ``` **Solutions:** - Fix service selector to match pod labels - Ensure pods are passing readiness probes - Update NetworkPolicy to allow required traffic - Verify port configurations match --- ### PVC Binding Failures **What it means:** PersistentVolumeClaim cannot bind to a PersistentVolume. **Common causes:** - No PV available matching PVC requirements - StorageClass not found or misconfigured - Access mode mismatch (RWO vs RWX) - Storage capacity insufficient - Zone/region constraints not met **Debug steps:** ```bash # Check PVC status kubectl get pvc -n <namespace> kubectl describe pvc <pvc-name> -n <namespace> # List available PVs kubectl get pv # Check StorageClass kubectl get storageclass kubectl describe storageclass <name> # View provisioner events kubectl get events -n <namespace> --field-selector reason=ProvisioningFailed ``` **Solutions:** - Create matching PersistentVolume manually - Fix StorageClass name or create required class - Adjust access mode or capacity requirements - Enable dynamic provisioning if available --- ### RBAC Permission Denied **What it means:** Service account lacks required permissions for API operations. **Common causes:** - Missing Role or ClusterRole - RoleBinding not created for service account - Wrong namespace for RoleBinding - Insufficient permissions in Role **Debug steps:** ```bash # Check what service account pod uses kubectl get pod <pod-name> -n <namespace> -o yaml | grep serviceAccountName # Test permissions kubectl auth can-i <verb> <resource> --as=system:serviceaccount:<namespace>:<sa-name> # List roles and bindings kubectl get roles,rolebindings -n <namespace> kubectl get clusterroles,clusterrolebindings | grep <relevant-name> # Describe specific binding kubectl describe rolebinding <name> -n <namespace> ``` **Solutions:** - Create Role/ClusterRole with required permissions - Create RoleBinding/ClusterRoleBinding - Verify binding references correct service account - Use namespace-scoped roles when possible --- ## Debugging Tools Reference ### kubectl describe Get detailed information about any resource including events. ```bash kubectl describe pod <pod-name> -n <namespace> kubectl describe node <node-name> kubectl describe svc <service-name> -n <namespace> kubectl describe deployment <name> -n <namespace> ``` ### kubectl logs View container stdout/stderr logs. ```bash kubectl logs <pod-name> -n <namespace> kubectl logs <pod-name> -n <namespace> -c <container-name> # specific container kubectl logs <pod-name> -n <namespace> --previous # previous instance kubectl logs <pod-name> -n <namespace> -f # follow/stream kubectl logs <pod-name> -n <namespace> --tail=100 # last 100 lines kubectl logs -l app=myapp -n <namespace> # by label selector ``` ### kubectl exec Execute commands inside running container. ```bash kubectl exec -it <pod-name> -n <namespace> -- /bin/sh kubectl exec -it <pod-name> -n <namespace> -- /bin/bash kubectl exec <pod-name> -n <namespace> -- cat /etc/config/app.conf kubectl exec <pod-name> -n <namespac
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.