如何在Kubernetes节点上列出污点? [英] How can I list the taints on Kubernetes nodes?

查看:1041
本文介绍了如何在Kubernetes节点上列出污点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档非常适合说明如何设置污染一个节点,或删除一个.而且我可以使用kubectl describe node来获得一个节点的详细描述,包括其污点.但是,如果我忘记了创建的异味的名称,或者忘记将其设置在哪个节点上,该怎么办?我可以列出我所有的节点,以及它们上存在的污点吗?

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, including its taints. But what if I've forgotten the name of the taint I created, or which nodes I set it on? Can I list all of my nodes, with any taints that exist on them?

推荐答案

kubectl get nodes -o json | jq '.items[].spec'

这将给出带有节点名称的完整规范,或者:

which will give the complete spec with node name, or:

kubectl get nodes -o json | jq '.items[].spec.taints'

将生成每个节点的污点列表

will produce the list of the taints per each node

这篇关于如何在Kubernetes节点上列出污点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆