클러스터 정보
kubectl cluster-info
현재 컨텍스트 확인
kubectl config current-context
노드정보
kubectl get nodes
파드목록
kubectl get pods
kubectl get pods -n [namespace]
파드상세정보
kubectl describe pod [pod-name]
kubectl describe pod [pod-name] -n [namespace]
파드 로그 보기
kubectl logs [pod-name]
kubectl logs [pod-name] - n [namespace]
kubectl logs -f [pod-name]
파드생성 및 삭제
kubectl run [pod-name] --image=[image]
kubectl delete pod [pod-name]
디플로이먼트 목록
kubectl get deployments
kubectl get deployment -n -[namespace]
디플로이먼트 상세 정보
kubectl describe deployment [deployment-name]
kubectl describe deployment [deployment-name] -n [namespace]
디플로이먼트 업데이트
kubectl set image deployment/[deployment-name] [container-name]=[new-image]
kubectl rollout status deployment/[deployment-name]
서비스 관리
kubectl get services
kubectl get svc
서비스 상세 정보
kubectl describe service [service-name]
kubectl describe svc [service-name]
포트 포워딩
kubectl port-forward [pod-name] [local-port]:[remote-port]
네임스페이스 목록
kubectl get namespaces
kubectl get ns
네임스페이스 생성 및 삭제
kubectl create namespace [namespace]
kubectl delete namespace [namespace]
클러스터에 yml 파일 적용
kubectl apply -f [file.yml]
클러스터에 적용된 yml 리소스 삭제
kubectl delete -f [file.yml]
리소스 사용량 보기
kubectl top codes
kubectl top pods
'Devops Skill Up > Kubernetes' 카테고리의 다른 글
[k8s] 마스터 노드 구성을 알아보아욤 (0) | 2024.08.12 |
---|---|
[k8s] helm 차트 설치, bitnami 사용하기 (0) | 2024.07.22 |
[k8s] k3s 를 설치해보자 (linux) (0) | 2024.07.22 |
[k8s] k8s를 알아보자 (0) | 2024.07.11 |
[k8s] k3로 쿠버네티스 연습하기 (1) | 2024.07.05 |