如何在 Kubernetes 中为节点添加角色? [英] How to add roles to nodes in Kubernetes?

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

问题描述

当我使用 kubeadm 配置 Kubernetes 集群时,我的节点被标记为无".这是 Kubernetes 中的一个已知错误,目前正在进行 PR.

When I provision a Kubernetes cluster using kubeadm, I get my nodes tagged as "none". It's a known bug in Kubernetes and currently a PR is in progress.

但是,我想知道是否可以选择为节点手动添加角色名称.

However, I would like to know if there is an option to add a Role name manually for the node.

root@ip-172-31-14-133:~# kubectl get nodes
NAME               STATUS    ROLES     AGE       VERSION
ip-172-31-14-133   Ready     master    19m       v1.9.3
ip-172-31-6-147    Ready     <none>    16m       v1.9.3

推荐答案

这对我有用:

kubectl 标签节点 cb2.4xyz.couchbase.com node-role.kubernetes.io/worker=worker

NAME                                          STATUS    ROLES           AGE       VERSION
cb2.4xyz.couchbase.com                          Ready     custom,worker   35m       v1.11.1
cb3.5xyz.couchbase.com                          Ready     worker          29m       v1.11.1

我无法删除/更新旧标签,但我可以忍受它.

I could not delete/update the old label, but I can live with it.

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

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