内容简介:原本用在master节点上执行步骤1-4,在从节点(将要加入集群的机器)上执行步骤5从现有角色绑定 “kubeadm:kubelet-config-1.11” 创建一个新角色绑定 “kubeadm:kubelet-config-1.12”
原本用 kubeadm
安装的的kubernetes 1.11.x集群升级到1.12.x 后(使用 kubeadm upgrade
升级)发现无法将新的node加入到集群中,会出现以下报错信息
[preflight] running pre-flight checks [WARNING RequiredIPVSKernelModulesAvailable]: the IPVS proxier will not be used, because the following required kernel modules are not loaded: [ip_vs_sh ip_vs ip_vs_rr ip_vs_wrr] or no builtin kernel ipvs support: map[ip_vs_rr:{} ip_vs_wrr:{} ip_vs_sh:{} nf_conntrack_ipv4:{} ip_vs:{}] you can solve this problem with following methods: 1. Run 'modprobe -- ' to load missing kernel modules; 2. Provide the missing builtin kernel ipvs support [discovery] Trying to connect to API Server "172.19.170.254:6443" [discovery] Created cluster-info discovery client, requesting info from "https://172.19.170.254:6443" [discovery] Requesting info from "https://172.19.170.254:6443" again to validate TLS against the pinned public key [discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "172.19.170.254:6443" [discovery] Successfully established connection with API Server "172.19.170.254:6443" [kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.12" ConfigMap in the kube-system namespace configmaps "kubelet-config-1.12" is forbidden: User "system:bootstrap:y1zgt7" cannot get configmaps in the namespace "kube-system"
修复方法
在master节点上执行步骤1-4,在从节点(将要加入集群的机器)上执行步骤5
步骤一
从现有的”ConfigMap kubelet-config-1.11” 创建一个新的ConfigMap “kubelet-config-1.12”
$ kubectl get cm --all-namespaces $ kubectl -n kube-system get cm kubelet-config-1.11 -o yaml --export > kubelet-config-1.12-cm.yaml $ vim kubelet-config-1.12-cm.yaml #modify at the bottom: #name: kubelet-config-1.12 #delete selfLink $ kubectl -n kube-system create -f kubelet-config-1.12-cm.yaml
步骤二:获取令牌前缀
$ kubeadm token list #if no output, then create a token: $ kubeadm token create TOKEN ... ... a0b1c2.svn4my9ifft4zxgg ... ... # Token prefix is "a0b1c2"
步骤三
从现有角色“kubeadm:kubelet-config-1.11”创建一个新角色“kubeadm:kubelet-config-1.12”
$ kubectl get roles --all-namespaces $ kubectl -n kube-system get role kubeadm:kubelet-config-1.11 -o yaml > kubeadm:kubelet-config-1.12-role.yaml $ vim kubeadm\:kubelet-config-1.12-role.yaml #modify the following: #name: kubeadm:kubelet-config-1.12 #resourceNames: kubelet-config-1.12 #delete creationTimestamp, resourceVersion, selfLink, uid (because --export option is not supported) $ kubectl -n kube-system create -f kubeadm\:kubelet-config-1.12-role.yaml
步骤四
从现有角色绑定 “kubeadm:kubelet-config-1.11” 创建一个新角色绑定 “kubeadm:kubelet-config-1.12”
$ kubectl get rolebindings --all-namespaces $ kubectl -n kube-system get rolebinding kubeadm:kubelet-config-1.11 -o yaml > kubeadm:kubelet-config-1.12-rolebinding.yaml $ vim kubeadm\:kubelet-config-1.12-rolebinding.yaml #modify the following: #metadata/name: kubeadm:kubelet-config-1.12 #roleRef/name: kubeadm:kubelet-config-1.12 #delete creationTimestamp, resourceVersion, selfLink, uid (because --export option is not supported) - apiGroup: rbac.authorization.k8s.io #add these 3 lines as another group in "subjects:" at the bottom, with the 6 character token prefix from STEP 2 kind: Group name: system:bootstrap:a0b1c2 $ kubectl -n kube-system create -f kubeadm\:kubelet-config-1.12-rolebinding.yaml
步骤5:从工作节点启动kubeadm join
$ sudo kubeadm join --token <token> <master-IP>:6443 --discovery-token-ca-cert-hash sha256:<key-value> # If you receive 2 ERRORS, run kubeadm join again with the following options: $ sudo kubeadm join --token <token> <master-IP>:6443 --discovery-token-ca-cert-hash sha256:<key-value> --ignore-preflight-errors=FileAvailable--etc-kubernetes-bootstrap-kubelet.conf,FileAvailable--etc-kubernetes-pki-ca.crt
以上所述就是小编给大家介绍的《kuberenetes 升级后新加入节点报错》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- xml创建节点(根节点、子节点)
- Vultr VPS 节点选择方法 | 各节点延迟一览
- 1.19 JQuery2:节点插入与节点选取
- POC分布式节点算法机制下的超级节点计划
- tikv节点下线缩容后改造成tidb节点记录
- Redis 哨兵节点之间相互自动发现机制(自动重写哨兵节点的配置文件)
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
URL 编码/解码
URL 编码/解码
RGB HSV 转换
RGB HSV 互转工具