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

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

问题描述

docs 非常适合解释如何设置污染一个节点,或删除一个.我可以使用 kubectl describe node 来获取一个节点的详细描述,包括它的污点.但是,如果我忘记了我创建的 taint 的名称,或者我将它设置在哪些节点上怎么办?我可以列出我的所有节点,以及它们上存在的任何污点吗?

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天全站免登陆