| name | managing-kubernetes |
| description | Manages Kubernetes clusters via kubectl. Supports pod/deployment/service management, log viewing, port-forwarding, and debugging. Use for "k8s", "kubectl", "파드", cluster management tasks. |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob |
Kubernetes Management
Quick Reference
kubectl config current-context
kubectl config use-context <name>
kubectl get pods -n <namespace>
kubectl get deployments
kubectl get services
kubectl logs <pod> -f
kubectl logs <pod> -c <container>
kubectl describe pod <name>
kubectl exec -it <pod> -- /bin/sh
kubectl port-forward <pod> 8080:80
Common Workflows
Check Pod Status
kubectl get pods -n production
kubectl describe pod <name> -n production
View Logs
kubectl logs <pod> -f --tail=100
kubectl logs <pod> --previous
Scale Deployment
kubectl scale deployment <name> --replicas=3
kubectl rollout status deployment <name>
Port Forward
kubectl port-forward svc/<service> 8080:80
kubectl port-forward pod/<pod> 5432:5432
Apply Manifest
kubectl apply -f manifest.yaml
kubectl apply -k ./kustomize/
Rollback
kubectl rollout undo deployment <name>
kubectl rollout history deployment <name>
Debugging Commands
| Issue | Command |
|---|
| Pod not starting | kubectl describe pod <name> |
| CrashLoopBackOff | kubectl logs <pod> --previous |
| Image pull error | kubectl get events --sort-by=.lastTimestamp |
| Service not reachable | kubectl get endpoints <svc> |
Namespace Operations
kubectl get namespaces
kubectl create namespace <name>
kubectl config set-context --current --namespace=<name>
See references/kubectl-cheatsheet.md for full command reference.