Provides common Kubernetes diagnostic commands and troubleshooting steps for K3s clusters.

Install

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

Installs to .claude/skills/k8s-debug

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.

Kubernetes debugging commands and troubleshooting for the K3s cluster
69 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Check the status of all Kubernetes resources
  • View logs for specific pods (frontend, backend, database)
  • Describe pods to diagnose errors
  • Inspect Kubernetes services and ingress configurations
  • Troubleshoot pods not starting (CrashLoopBackOff)
  • Diagnose 502 Bad Gateway errors

How it works

The skill provides a collection of `kubectl` commands and troubleshooting scenarios to diagnose common issues in a K3s cluster running on AWS.

Inputs & outputs

You give it
A Kubernetes debugging scenario or a request for cluster status
You get back
Kubernetes commands and troubleshooting steps

When to use k8s-debug

  • Debugging pod failures
  • Checking cluster health
  • Inspecting ingress/services

About this skill

🔧 Kubernetes Debugging

This skill provides debugging commands and troubleshooting guides for the K3s cluster on AWS.

Cluster Overview

ComponentDetails
CloudAWS (Tel Aviv region)
InstanceEC2 t3.small
KubernetesK3s
IngressNGINX Ingress Controller
TLScert-manager + Let's Encrypt
GitOpsArgoCD

Quick Status Commands

Check All Resources

kubectl get all

Check Pods

# All pods
kubectl get pods

# With more details
kubectl get pods -o wide

# Watch for changes
kubectl get pods -w

Check Specific App Pods

kubectl get pods -l app=barak-web           # Frontend
kubectl get pods -l app=barak-web-backend   # Backend
kubectl get pods -l app=barak-web-db        # Database

Common Debugging Commands

View Pod Logs

# Frontend logs
kubectl logs -l app=barak-web

# Backend logs
kubectl logs -l app=barak-web-backend

# Follow logs in real-time
kubectl logs -f -l app=barak-web-backend

# Last 100 lines
kubectl logs -l app=barak-web --tail=100

Describe Pod (for errors)

kubectl describe pod <pod-name>

# Example
kubectl describe pod barak-web-backend-xxx-xxx

Check Services

kubectl get svc

# Expected:
# barak-web-service         ClusterIP   80/TCP
# barak-web-backend-service ClusterIP   80/TCP
# barak-web-db-service      ClusterIP   5432/TCP

Check Ingress

kubectl get ingress

# Detailed
kubectl describe ingress barak-web-ingress

Check Secrets

kubectl get secrets

# View secret (base64 encoded)
kubectl get secret barak-web-secrets -o yaml

Troubleshooting Scenarios

1. Pods Not Starting (CrashLoopBackOff)

# Check pod status
kubectl get pods

# If CrashLoopBackOff, check logs
kubectl logs <pod-name>

# Check events
kubectl describe pod <pod-name>

Common Causes:

  • Missing secrets
  • Database connection failed
  • Image pull error

2. 502 Bad Gateway

# Check if pods are running
kubectl get pods

# Check ingress backend
kubectl describe ingress barak-web-ingress

# Check service endpoints
kubectl get endpoints

Common Causes:

  • Pod not ready
  • Service selector mismatch
  • Health check failing

3. Database Connection Issues

# Check DB pod
kubectl get pods -l app=barak-web-db

# Check DB logs
kubectl logs -l app=barak-web-db

# Test connection from backend
kubectl exec -it <backend-pod> -- sh
> nc -zv barak-web-db-service 5432

4. TLS/Certificate Issues

# Check certificate
kubectl get certificate

# Check cert-manager logs
kubectl logs -n cert-manager -l app=cert-manager

# Check secret
kubectl get secret barak-web-tls

5. ArgoCD Sync Issues

# Check ArgoCD app status
argocd app get barak-web

# Force sync
argocd app sync barak-web

# Check sync status
argocd app list

Useful One-Liners

# Restart deployment (trigger rollout)
kubectl rollout restart deployment/barak-web
kubectl rollout restart deployment/barak-web-backend

# Check rollout status
kubectl rollout status deployment/barak-web

# Scale deployment
kubectl scale deployment/barak-web --replicas=2

# Execute shell in pod
kubectl exec -it <pod-name> -- /bin/sh

# Port forward for local testing
kubectl port-forward svc/barak-web-service 8080:80
kubectl port-forward svc/barak-web-backend-service 3000:80

# Get pod resource usage
kubectl top pods

Check Resource Limits

# Current usage
kubectl top pods

# Configured limits (from app.yaml)
# Frontend: 64Mi-128Mi, 250m-500m CPU
# Backend: No limits configured (should add!)
# Database: No limits configured

SSH to EC2 (If Needed)

ssh -i <key.pem> ec2-user@<ec2-public-ip>

# Then use kubectl as normal
kubectl get pods

Quick Health Check Checklist

  • All pods are Running (not CrashLoopBackOff or Pending)
  • Services have endpoints
  • Ingress has ADDRESS assigned
  • TLS certificate is valid
  • ArgoCD shows Synced status
  • Website loads at https://dogs.barakaloni.com
  • Admin dashboard loads at /admin

When not to use it

  • The cluster is not K3s on AWS EC2
  • The issue is unrelated to Kubernetes debugging
  • The task requires modifying application code instead of diagnosing infrastructure

Limitations

  • It is specific to K3s clusters on AWS
  • It focuses on debugging commands and troubleshooting guides
  • It covers specific components like NGINX Ingress Controller and cert-manager

How it compares

This skill offers specific `kubectl` commands and troubleshooting steps tailored for a K3s cluster on AWS, providing direct solutions rather than general Kubernetes advice.

Compared to similar skills

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

SkillInstallsUpdatedSafetyDifficulty
k8s-debug (this skill)06moReviewIntermediate
debug-cluster28moReviewIntermediate
storage-networking67moReviewAdvanced
k8s-helm86moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

debug-cluster

openshift

Provides systematic debugging approaches for HyperShift hosted-cluster issues. Auto-applies when debugging cluster problems, investigating stuck deletions, or troubleshooting control plane issues.

25

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

mlops-engineer

sickn33

Build comprehensive ML pipelines, experiment tracking, and model registries with MLflow, Kubeflow, and modern MLOps tools. Implements automated training, deployment, and monitoring across cloud platforms. Use PROACTIVELY for ML infrastructure, experiment management, or pipeline automation.

333

senior-devops

davila7

Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.

720

Search skills

Search the agent skills registry