解决k8s分布式集群,子节点加入到主节点失败的问题

1.问题情况

Master主节点在 使用 kubeadm init 成功进行初始化后,如下所示

复制代码
Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

  export KUBECONFIG=/etc/kubernetes/admin.conf

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of control-plane nodes by copying certificate authorities
and service account keys on each node and then running the following as root:

  kubeadm join cluster-endpoint:6443 --token k5fx27.0lio5aod7s8b03md \
    --discovery-token-ca-cert-hash sha256:44dbbd0bb7495be1eb25f78a21103e0b52857df4671bab577af0f5e11ba6f7f1 \
    --control-plane

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join cluster-endpoint:6443 --token k5fx27.0lio5aod7s8b03md \
    --discovery-token-ca-cert-hash sha256:44dbbd0bb7495be1eb25f78a21103e0b52857df4671bab577af0f5e11ba6f7f1

但是子节点在使用 join cluster-endpoint加入到集群时报错

2.解决方法

两台子节点在加入集群时出错,通过docker 的配置文件daemon.json 内容

将内容删除 修改至 只有 mirrors镜像配置 如上图所示 保存后重启docker

复制代码
#在子节点运行
#重启docker
systemctl stop docker
systemctl daemon-reload
systemctl restart docker

#重置 子节点的集群加载配置
kubeadm reset

#重新加入主节点集群
kubectl join cluster-endpoint:8888 ................................
相关推荐
优秀的颜36 分钟前
计算机基础知识(第五篇)
java·开发语言·分布式
MickeyCV7 小时前
使用Docker部署MySQL&Redis容器与常见命令
redis·mysql·docker·容器·wsl·镜像
棠十一8 小时前
Rabbitmq
分布式·docker·rabbitmq
Lansonli8 小时前
大数据Spark(六十一):Spark基于Standalone提交任务流程
大数据·分布式·spark
藥瓿亭9 小时前
K8S认证|CKS题库+答案| 6. 创建 Secret
运维·ubuntu·docker·云原生·容器·kubernetes·cks
2302_809798329 小时前
【JavaWeb】Docker项目部署
java·运维·后端·青少年编程·docker·容器
嵌入式大圣9 小时前
Neko虚拟浏览器远程协作方案:Docker+内网穿透技术部署实践
运维·docker·容器
孔令飞9 小时前
Kubernetes 节点自动伸缩(Cluster Autoscaler)原理与实践
ai·云原生·容器·golang·kubernetes
Theodore_102210 小时前
大数据(2) 大数据处理架构Hadoop
大数据·服务器·hadoop·分布式·ubuntu·架构
极简网络科技11 小时前
Docker、Wsl 打包迁移环境
运维·docker·容器