资源名称: nodes, 缩写: no
$ kubectl get no # 显示所有节点信息
# 显示所有节点的更多信息
$ kubectl get no -o wide
$ kubectl describe no # 显示节点详情
# 以yaml格式,显示节点详情
$ kubectl get no -o yaml
# 筛选指定标签的节点
$ kubectl get node --selector=[label_name]
# 输出 jsonpath 表达式定义的字段信息
$ kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
# 显示节点(CPU/内存/存储)使用情况
$ kubectl top node [node_name]
资源名称: pods, 缩写: po
$ kubectl get po # 显示所有容器组信息
$ kubectl get po -o wide
$ kubectl describe po
$ kubectl get po --show-labels # 查看容器组的labels
$ kubectl get po -l app=nginx
$ kubectl get po -o yaml
$ kubectl get pod [pod_name] -o yaml --export
$ kubectl get pod [pod_name] -o yaml --export > nameoffile.yaml
# 以yaml格式导出容器组信息到yaml文件
$ kubectl get pods --field-selector status.phase=Running
# 使用字段选择器筛选出容器组信息