查找所有没有NoSchedule污染的节点?

时间:2020-10-08 12:00:36

标签: kubernetes

什么是kubectl命令,列出所有没有 NoSchedule异味的节点?

什么是kubectl命令,列出所有具有 NoSchedule污点的节点?

1 个答案:

答案 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