kubernetes无法加入工人centos 7
kubernetes can not join workers centos 7
我的问题是我无法连接我们的机器(主从)
我的连接命令应该是
kubeadm join xxx:xxx:xxx:xxx:6443 --token a72x22.ofmqdjyzi7ot4l70 --discovery-token-ca-cert-hash sha256:3cfd9ddb1e655ef2172c12d914e2bb001434cc4c8a756919a7a6a9f0603e3131
我被执行了
echo 1 >/proc/sys/net/bridge/bridge-nf-call-iptables
echo 1 >/proc/sys/net/ipv4/ip_forward
swapoff -a
我得到了错误
[kubelet-start] Downloading configuration for the kubelet from the
"kubelet-config-1.15" ConfigMap in the kube-system namespace error
execution phase kubelet-start: configmaps "kubelet-config-1.15" is
forbidden: User "system:bootstrap:a61x22" can
not get resource "configmaps" in API group "" in the namespace
"kube-system"
主 kubectl 版本
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
从属 kubectl 版本
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
也许我的问题与主机或端口有关?
我该如何解决这个问题?
使用以下命令检查 configmaps "kubelet-config-1.15" 是否存在。
kubectl -n kube-system 获取配置映射 kubelet-config-1.15
也许你的master版本是1.14,而你的新节点下载了一个kubelet 1.15版本。
在那种情况下,您的 configmap 不存在并且您有一个 configmap kubelet-config-1.14。
将您的主节点升级到 v 1.15 或将 kubernetes v1.14 安装到您的工作节点中。
你可以看到你的节点是什么版本
kubectl 获取节点
[root@master /]# k 获取节点
名称状态角色年龄版本
master Ready master 32d v1.14.0
node6 就绪 32d v1.14.2
nodo2 Ready 32d v1.14.2
我的问题是我无法连接我们的机器(主从) 我的连接命令应该是
kubeadm join xxx:xxx:xxx:xxx:6443 --token a72x22.ofmqdjyzi7ot4l70 --discovery-token-ca-cert-hash sha256:3cfd9ddb1e655ef2172c12d914e2bb001434cc4c8a756919a7a6a9f0603e3131
我被执行了
echo 1 >/proc/sys/net/bridge/bridge-nf-call-iptables
echo 1 >/proc/sys/net/ipv4/ip_forward
swapoff -a
我得到了错误
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.15" ConfigMap in the kube-system namespace error execution phase kubelet-start: configmaps "kubelet-config-1.15" is forbidden: User "system:bootstrap:a61x22" can
not get resource "configmaps" in API group "" in the namespace "kube-system"
主 kubectl 版本
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
从属 kubectl 版本
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
也许我的问题与主机或端口有关?
我该如何解决这个问题?
使用以下命令检查 configmaps "kubelet-config-1.15" 是否存在。
kubectl -n kube-system 获取配置映射 kubelet-config-1.15
也许你的master版本是1.14,而你的新节点下载了一个kubelet 1.15版本。 在那种情况下,您的 configmap 不存在并且您有一个 configmap kubelet-config-1.14。 将您的主节点升级到 v 1.15 或将 kubernetes v1.14 安装到您的工作节点中。
你可以看到你的节点是什么版本
kubectl 获取节点
[root@master /]# k 获取节点
名称状态角色年龄版本
master Ready master 32d v1.14.0
node6 就绪 32d v1.14.2
nodo2 Ready 32d v1.14.2