kubeadm添加主从节点

本文涉及的产品
容器服务 Serverless 版 ACK Serverless,952元额度 多规格
容器服务 Serverless 版 ACK Serverless,317元额度 多规格
简介: kubeadm添加主从节点

添加master和node节点(使用多master的时候添加)

1、按照上述内容部署kubectl组建

2、首先在master上生成新的token


2.1 为了加入node
[root@k8s-00001 ~]# kubeadm token create --print-join-command
kubeadm join 172.28.149.6:6443 --token km6vem.3zapw7cwe1km7e98 --discovery-token-ca-cert-hash sha256:f5c9d504a850a6de70637270572b0ff6752b0d247b016241b37eefb530aea435 

3、在master上生成用于新master加入的证书


[root@k8s-00001 ~]# kubeadm init phase upload-certs --experimental-upload-certs
unknown flag: --experimental-upload-certs
To see the stack trace of this error execute with --v=5 or higher

解决:之前版本为v1.4.0时该命令正常执行
解决办法:  将–experimental-upload-certs 替换为 --upload-certs
[root@k8s-00001 ~]# kubeadm init phase upload-certs  --upload-certs
[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[upload-certs] Using certificate key:
b7721beec3d4926941a5c243e1c1c4c9124e2b61719e591aa3560d9514fa2de4

4、添加新master,把红色部分加到–experimental-control-plane --certificate-key后。

[root@k8s-00004 ~]#kubeadm join 172.28.149.6:6443 --token km6vem.3zapw7cwe1km7e98 --discovery-token-ca-cert-hash sha256:f5c9d504a850a6de70637270572b0ff6752b0d247b016241b37eefb530aea435 --control-plane --certificate-key b7721beec3d4926941a5c243e1c1c4c9124e2b61719e591aa3560d9514fa2de4

问题:
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight:
One or more conditions for hosting a new control plane instance is not satisfied.

unable to add a new control plane instance a cluster that doesn't have a stable controlPlaneEndpoint address

Please ensure that:
* The cluster has a stable controlPlaneEndpoint address.
* The certificates that must be shared among control plane instances are provided.


To see the stack trace of this error execute with --v=5 or higher

5、添加新node

[root@k8s-00005 ~]#kubeadm join 172.28.149.6:6443 --token km6vem.3zapw7cwe1km7e98 --discovery-token-ca-cert-hash sha256:f5c9d504a850a6de70637270572b0ff6752b0d247b016241b37eefb530aea435 


微信公众号,需要的话就关注下我~

相关实践学习
容器服务Serverless版ACK Serverless 快速入门:在线魔方应用部署和监控
通过本实验,您将了解到容器服务Serverless版ACK Serverless 的基本产品能力,即可以实现快速部署一个在线魔方应用,并借助阿里云容器服务成熟的产品生态,实现在线应用的企业级监控,提升应用稳定性。
云原生实践公开课
课程大纲 开篇:如何学习并实践云原生技术 基础篇: 5 步上手 Kubernetes 进阶篇:生产环境下的 K8s 实践 相关的阿里云产品:容器服务 ACK 容器服务 Kubernetes 版(简称 ACK)提供高性能可伸缩的容器应用管理能力,支持企业级容器化应用的全生命周期管理。整合阿里云虚拟化、存储、网络和安全能力,打造云端最佳容器化应用运行环境。 了解产品详情: https://www.aliyun.com/product/kubernetes
目录
相关文章
|
8月前
|
存储 NoSQL 网络安全
Redis安装(单机、主从、哨兵、集群)
Redis安装(单机、主从、哨兵、集群)
140 1
|
1月前
|
Kubernetes 应用服务中间件 nginx
使用kubeadm搭建生产环境的多master节点k8s高可用集群
使用kubeadm搭建生产环境的多master节点k8s高可用集群
191 0
|
8月前
|
缓存 Kubernetes 数据安全/隐私保护
安装kubernetes1.17.3多master节点的高可用集群(上)
安装kubernetes1.17.3多master节点的高可用集群
|
8月前
|
Kubernetes 监控 前端开发
安装kubernetes1.17.3多master节点的高可用集群(下)
安装kubernetes1.17.3多master节点的高可用集群
|
11月前
|
监控 NoSQL Redis
Redis主从、哨兵、 Cluster集群一锅端! 1
Redis主从、哨兵、 Cluster集群一锅端!
|
11月前
|
存储 NoSQL 算法
Redis主从、哨兵、 Cluster集群一锅端! 2
Redis主从、哨兵、 Cluster集群一锅端!
|
Kubernetes 容器
【k8s】单节点master部署
文章目录 前言 一、部署k8s(二进制) 1.1 架构
309 0
|
Kubernetes 网络安全 Docker
|
Kubernetes Shell Docker
kubeadm 一主两从配置 V1.22.4
kubeadm 一主两从配置 V1.22.4
350 1
|
存储 NoSQL Redis
Redis集群:主从节点添加和删除
Redis集群:主从节点添加和删除
550 0
Redis集群:主从节点添加和删除