How can I list the taints on Kubernetes nodes?

前端 未结 11 1554
别那么骄傲
别那么骄傲 2021-01-30 08:47

The docs are great about explaining how to set a taint on a node, or remove one. And I can use kubectl describe node to get a verbose description of one node, inclu

11条回答
  •  臣服心动
    2021-01-30 09:13

    The CMD kubectl provides an arguments jsonpath to search and format the output after getting. You can check the doc k8s jsonpath for detail.

     kubectl get node  -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.taints}{"\n"}{end}'
    

    For further info, you can check the source code that reflect the source data with the method FindResults

提交回复
热议问题