kubectl 명령어

# yml 설정 배포
kubectl apply -f [yml]

# docker image 로 pod 생성
# echo 라는 pod 생성
kubectl run echo --image ghcr.io/subicura/echo:v1

# 리소스 조회
kubectl get (all | po | pod | pods | svc | service ) -o (wide | yaml | json) --show-labels
kubectl get node -o wide

# node 성능 사용량 조회
kubectl top nodes

# 리소스 상세 조회
kubectl describe (type/name | type name)

# 리소스 제거
kubectl delete (type/name | type name)

# pod 로그 조회
kubectl logs (pod 이름)
kubectl logs -f (pod 이름)

# 명령 실행
kubectl exec [-it] [pod 이름] -- [command]

# 명령 실행 - bash 접속
kubectl exec -it (pod 이름) -- bash
kubectl exec -it (Pod 이름) -- /bin/bash

# 설정
kubectl config (설정 키)
kubectl config (설정 키) (설정 값)

# 오브젝트 종류 화인
kubectl api-resources

# 오브젝트 설명 보기
kubectl explain pod

# kube endpoint ip 확인
kubectl get ep