Get

# default namespace pod조회 $ kubectl get pods
# 모든 namespace pod조회 $ kubectl get pods --all-namespaces
# pod 정보 자세히 보기 $ kubectl get pod -o wide
# pod watch mode로 보기 $ kubectl get pod -w
# default namespace deployment조회 $ kubectl get deploy
# 모든 namespace의 모든 deployment조회 $ kubectl get deploy --all-namespaces
# default namespace service조회 $ kubectl get service
$ kubectl get svc
# 모든 namespace의 모든 service조회 $ kubectl get service --all-namespaces
$ kubectl get svc --all-namespaces
#node 조회 $ kubectl get node

 Create

# test.yaml파일 작성 후 create하면 yaml파일의 내용이 생성 $ kubectl create -f test.yaml
# yaml파일의 문법이 맞는지 확인하기 $ kubectl create -f test.yaml --dry-run=client
# 명령어로 create yaml 파일로 만들기 $ kubectl create deploy test-deploy --image=nginx --dry-run=client -o yaml > nginx.yaml

 Delete

#test.yaml 파일로 생성된 내용 삭제 $ kubectl delete -f test.yaml
# 모든 자원 삭제 $ kubectl delete all --all
# 원하는 파드만 삭제 $ kubectl get pod
$ kubectl delete {pod
이름}

 Describe

# node 정보 $ kubectl get nodes
$ kubectl describe nodes {node
이름}
# pod 정보 $ kubectl get pods
$ kubectl describe pod {pod
이름}

 Exec

# Pod bash로 들어가기 $ kubectl get pods
$ kubectl exec -it {pod
이름} /bin/bash
# 특정 Pod에서 curl 실행하기 $ kubectl get pods
$ kubectl exec {pod
이름} -- curl localhost:8080

 Log

# 특정 pod의 로그 확인 $ kubectl get pods
$ kubectl logs {pod
이름}
# 특정 pod의 로그 tail $ kubectl get pods
$ kubectl logs -f {pod
이름}



'기술(Azure 만...) > [MS]Azure PaaS' 카테고리의 다른 글

App service 플랜 비교(STD vs Premium)  (0) 2024.04.30
Azure Function 정리  (0) 2023.04.13
Azure Postgresql 요약 총정리  (0) 2023.04.04
azure sql databse pass 방화벽 설정  (0) 2022.10.13
Azure Vmware Solution  (0) 2021.09.14

+ Recent posts