k8s中查看节点污点
方法一(查询单个)k describe node 节点名称显示如下方法二(查询所有节点)使用如下模板{{printf "%-50s %-12s\n" "Node" "Taint"}}{{- range .items}}{{- if $taint := (index .spec "taints") }}{{- .metadata.name }}{{ "\t" }}{{- range $taint }
·
方法一(查询单个)
k describe node 节点名称
显示如下
方法二(查询所有节点)
使用如下模板
{{printf "%-50s %-12s\n" "Node" "Taint"}}
{{- range .items}}
{{- if $taint := (index .spec "taints") }}
{{- .metadata.name }}{{ "\t" }}
{{- range $taint }}
{{- .key }}={{ .value }}:{{ .effect }}{{ "\t" }}
{{- end }}
{{- "\n" }}
{{- end}}
{{- end}}
将其保存到文件中,然后像这样引用它:
kubectl get nodes -o go-template-file="./nodes-taints.tmpl"
会得到类似如下的输出:
Node Taint
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=etcd:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=jenkins:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=etcd:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=containerlinux-canary-channel-workers:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=jenkins:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=etcd:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=etcd:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=etcd:NoSchedule
ip-xxx-xxx-xxx-xxx.us-west-2.compute.internal dedicate=jenkins:NoSchedule
参考:http://www.voidcn.com/article/p-bdtqnksi-bud.html
更多推荐
已为社区贡献5条内容
所有评论(0)