kubernetes 명령어#1
- cluser 작동중인지 확인
Forwarding from [::1]:8888 -> 8080
iyeonghoui-MacBook-Pro:k8s ireo$ kubectl get node
NAME STATUS ROLES AGE VERSION
gke-kubia-default-pool-79ce8f08-5rxv Ready <none> 1d v1.10.9-gke.5
gke-kubia-default-pool-79ce8f08-n6xd Ready <none> 2d v1.10.9-gke.5
gke-kubia-default-pool-79ce8f08-tb2j Ready <none> 3d v1.10.9-gke.5
iyeonghoui-MacBook-Pro:k8s ireo$ kubectl label node gke-kubia-default-pool-79ce8f08-5rxv gpu=true
node/gke-kubia-default-pool-79ce8f08-5rxv labeled
iyeonghoui-MacBook-Pro:k8s ireo$
- node 라벨=값 이 gpu=true 인 노드 조회
$kubectl get nodes -l gpu=true
- pod에 주석 추가
$kubectl annotate pod [pod명] mycompany.com/someannotation="foo bar"
- pod 주석 정보 확인
$kubectl describe pod [pod명]
- 클러스터에 있는 모든 네임스페이스 나열
$kubectl get ns
- 특정 네임스페이스에 속한 포드 조회
$kubectl get po --namespace [namespace명]