일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- LLM
- Windows
- pandas
- format
- Package
- list
- file
- Container
- enV
- docker
- KAKAO
- pytorch
- Laravel
- Linux
- numpy
- Paper
- AI
- Converting
- Database
- Mac
- CUDA
- DB
- evaluation
- judge
- git
- Flask
- GitLab
- PostgreSQL
- TORCH
- Python
Archives
- Today
- Total
Daily Develope
[Kubernetes] kubectl 명령어 정리 본문
명령 포맷
kubectl {command} {type} {name} {flag}
# command = 실행 동작 (create, get, delete)
# type = 자원 유형 (pod, service, ingress)
# name = 자원 이름
# flag = 옵션
조회
kubectl get all -A # 모든 개체정보 출력 (namespace 무시)
kubectl get {type} -o wide # 간략정보 추가 확인
kubectl describe {type} {name} # 세부정보 추가 확인
kubectl top {type} # 현재 자원 사용량 확인
kubectl api-resources # api 확인 (기본경로 = $HOME/.kube/config)
kubectl logs -f {pod} # 로그 확인
제어
ㅇ pod 실행
kubectl run {pod_name} --image {image} --port={port} {options} # pod 실행
ㅇ 실행 중 명령
kubectl delete pods {pod_name} # 실행중인 pod 종료
kubectl edit pod {pod_name} # 실행중인 pod 속성 변경/적용
kubectl scale deploy {pod_name} ...{수정옵션}... # 배포된 서비스 수정/적용
kubectl exec -it {pod_name} sh # 실행중인 pod 터미널 접속 (sh, bash, bin/bash 터미널 중 하나)
ㅇ Rollout
(history / undo / status / pause / resume / restart)
kubectl rollout history deploy {deployment_name} # deployment 전체 수정내역 조회
kubectl rollout history deploy {deployment_name} --revision={version} # 특정 버전 상세조회
kubectl rollout undo deploy {deployment_name} # 직전 수정버전으로 롤백
kubectl rollout undo deploy {deployment_name} --to-revision={version} # 특정 버전으로 롤백
kubectl rollout status # deployment 진행상태 확인
kubectl rollout pause deployment/{deployment_name} # deployment 정지
kubectl rollout resume deployment/{deployment_name} # deployment 재개
kubectl rollout restart deployment/{deployment_name} # deployment 재시작
ㅇ YAML
kubectl apply -f {yaml_file} # YAML 실행
kubectl delete -f {yaml_file} # 실행중인 YAML 종료
Comments