DevOps Cheat Sheet

실무에서 자주 쓰는 핵심 명령어 모음

kubectl get pods -A 모든 네임스페이스의 Pod 조회
kubectl describe pod <name> Pod 상세 정보 확인
kubectl logs -f <pod> -c <container> 컨테이너 로그 실시간 확인
kubectl exec -it <pod> -- /bin/sh Pod 내부 쉘 접속
kubectl top pods --sort-by=memory 메모리 사용량 기준 정렬
kubectl get events --sort-by=.lastTimestamp 최근 이벤트 조회
kubectl rollout restart deploy/<name> Deployment 재시작
kubectl rollout undo deploy/<name> 이전 버전으로 롤백
kubectl scale deploy/<name> --replicas=3 레플리카 수 조정
kubectl port-forward svc/<name> 8080:80 로컬 포트 포워딩
kubectl get nodes -o wide 노드 상세 정보 (IP, OS 등)
kubectl drain <node> --ignore-daemonsets 노드 유지보수 모드
kubectl taint nodes <node> key=value:NoSchedule 노드 테인트 설정
kubectl get pvc -A 전체 PVC 상태 확인
kubectl config use-context <ctx> 클러스터 컨텍스트 전환