woonizzooni

kubernetes - kubectl명령으로 node에 실행중인 모든 pod 조회하기 using field-selector 본문

Kubernetes

kubernetes - kubectl명령으로 node에 실행중인 모든 pod 조회하기 using field-selector

woonizzooni 2020. 11. 9. 18:10

 

 

필드 셀력터로 노드명을 명시하고, 모든 네임스페이스의 Pod 조회.

 

ex)

$ kubectl get node
NAME                                            STATUS   ROLES    AGE    VERSION
ip-10-000-000-000.{myregion}.compute.internal   Ready    <none>   5d1h   v1.00.00-eks-cfdc00
...

$ kubectl get po --all-namespaces --field-selector "spec.nodeName=ip-10-000-000-000.{myregion}.compute.internal"
NAMESPACE     NAME                                   READY   STATUS    RESTARTS   AGE
...
kube-system   aws-node-qkddk                         1/1     Running   0          48m
kube-system   coredns-84gbp                          1/1     Running   0          47m
kube-system   fluentd-cloudwatch-9vnkp               1/1     Running   0          47m
kube-system   kube-proxy-fgn6c                       1/1     Running   0          48m
kube-system   kube-state-metrics-54d587f66c-8hjl8    1/1     Running   0          37m
...

 

[참고]

    kubernetes.io/ko/docs/concepts/overview/working-with-objects/field-selectors/

 

Comments