什么是kubectl
命令,列出所有没有 NoSchedule
异味的节点?
什么是kubectl
命令,列出所有具有 NoSchedule
污点的节点?
答案 0 :(得分:2)
您可以使用jsonpath
获得节点和污点。
kubectl get node -o jsonpath='{range .items[*]}{@.metadata.name}{"\t"}{@.spec.taints[*].effect}{"\n"}{end}'
具有NoSchedule
kubectl get node -o jsonpath='{range .items[*]}{@.metadata.name}{"\t"}{@.spec.taints[*].effect}{"\n"}{end}' | grep NoSchedule
没有时间表
kubectl get node -o jsonpath='{range .items[*]}{@.metadata.name}{"\t"}{@.spec.taints[*].effect}{"\n"}{end}' | grep -v NoSchedule