ctl get pods empty-dir-pd -o jsonpath={.spec.containers[*].name} -n namespace
例子:
[root@k8s-master 11:46:01~/kubernets/nfs]# kubectl get pods empty-dir-pd -o jsonpath={.spec.containers[*].name} -n default nginx-emptydir01 nginx-emptydir02
ctl get pods empty-dir-pd -o jsonpath={.spec.containers[*].name} -n namespace
例子:
[root@k8s-master 11:46:01~/kubernets/nfs]# kubectl get pods empty-dir-pd -o jsonpath={.spec.containers[*].name} -n default nginx-emptydir01 nginx-emptydir02