目录
#操作系统Centos7.9#基础环境:这里我选择3个master,2个work,1个vip对外访问。
#操作系统Centos7.9
#基础环境:这里我选择3个master,2个work,1个vip对外访问。
主机 | IP | 需要安装的软件 |
k8s-master1 | 192.168.1.201 | docker,etcd,nginx,keepalived |
k8s-master2 | 192.168.1.202 | docker,etcd,nginx,keepalived |
k8s-master3 | 192.168.1.203 | docker,etcd,nginx,keepalived |
k8s-node1 | 192.168.1.204 | docker |
k8s-node2 | 192.168.1.205 | docker |
负载均衡器对外IP | 192.168.1.88 | (VIP) |
#最终环境
#模板准备
准备一台机器做基础模板,配置好ip,例如:192.168.1.254预先安装一些环境,直接复用,不用等每台机器启动后在去安装。
#预安装一些工具方便后续使用
yum install -y vim net-tools wget bash-com* git unzip lrzsz ntpdate -y
#同步下时间
ntpdate time.windows.com
# 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
# 关闭selinux
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
# 关闭swap
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
# 将桥接的IPv4流量传递到iptables的链
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system # 生效
# 添加hosts
cat >> /etc/hosts << EOF
192.168.1.201 k8s-master1
192.168.1.202 k8s-master2
192.168.1.203 k8s-master3
192.168.1.204 k8s-node1
192.168.1.205 k8s-node2
EOF
#安装docker
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O\
/etc/yum.repos.d/docker-ce.repo
yum -y install docker-ce
systemctl enable docker && systemctl start docker
#配置阿里云镜像加速器,可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
mkdir -p /etc/docker
cat > /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://ufc53gaa.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
systemctl daemon-reload
systemctl restart docker
#配置k8s阿里云镜像
cat > /etc/yum.repos.d/kubernetes.repo << EOF
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
#关机 用于模板
init 0
#修改主机名和IP
#k8s-master1执行 #我的模板机ip是192.168.1.254所以这里用201替换254
hostnamectl set-hostname k8s-master1
sed -i 's/254/201/g' /etc/sysconfig/network-scripts/ifcfg-ens33
reboot
#k8s-master2执行
hostnamectl set-hostname k8s-master2
sed -i 's/254/202/g' /etc/sysconfig/network-scripts/ifcfg-ens33
reboot
#k8s-master3执行
hostnamectl set-hostname k8s-master3
sed -i 's/254/203/g' /etc/sysconfig/network-scripts/ifcfg-ens33
reboot
#k8s-node1执行
hostnamectl set-hostname k8s-node1
sed -i 's/254/204/g' /etc/sysconfig/network-scripts/ifcfg-ens33
reboot
#k8s-node2执行
hostnamectl set-hostname k8s-node2
sed -i 's/254/205/g' /etc/sysconfig/network-scripts/ifcfg-ens33
reboot
#在3台主节点执行,安装nginx+keepalive
[root@k8s-master1 ~]# yum install epel-release nginx keepalived -y
[root@k8s-master2 ~]# yum install epel-release nginx keepalived -y
[root@k8s-master3 ~]# yum install epel-release nginx keepalived -y
#3台都要执行,配置nginx.conf自行修改ip
cat > /etc/nginx/nginx.conf << "EOF"
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
stream {
log_format main '$remote_addr $upstream_addr - [$time_local] $status $upstream_bytes_sent';
access_log /var/log/nginx/k8s-access.log main;
upstream k8s-apiserver {
server 192.168.1.201:6443; # Master1 APISERVER IP:PORT
server 192.168.1.202:6443; # Master2 APISERVER IP:PORT
server 192.168.1.203:6443; # Master3 APISERVER IP:PORT
}
server {
listen 36443; # 由于nginx与master节点复用,这个监听端口不能是6443,否则会冲突
proxy_pass k8s-apiserver;
}
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
}
EOF
#全部master都要装
yum install -y nginx-mod-stream.x86_64
#keepalived配置
##[root@k8s-master1 ~]#
cat > /etc/keepalived/keepalived.conf << EOF
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id NGINX_MASTER
}
vrrp_script check_nginx {
script "/etc/keepalived/check_nginx.sh" # 判断返回状态码
}
vrrp_instance VI_1 {
state MASTER
interface ens33 # 修改为实际网卡名
virtual_router_id 1 # 2 VRRP 路由 ID实例,每个实例是唯一的
priority 100 # 优先级,备服务器设置 90,80
advert_int 1 # 指定VRRP 心跳包通告间隔时间
authentication {
auth_type PASS
auth_pass 1111
}
# 虚拟IP
virtual_ipaddress {
192.168.1.88/24 #虚拟ip
}
track_script {
check_nginx
}
}
EOF
##[root@k8s-master2 ~]#
cat > /etc/keepalived/keepalived.conf << EOF
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id NGINX_BACKUP
}
vrrp_script check_nginx {
script "/etc/keepalived/check_nginx.sh" # 判断返回状态码
}
vrrp_instance VI_1 {
state BACKUP
interface ens33 # 修改为实际网卡名
virtual_router_id 2 # 2 VRRP 路由 ID实例,每个实例是唯一的
priority 90 # 优先级,备服务器设置 90,80
advert_int 1 # 指定VRRP 心跳包通告间隔时间
authentication {
auth_type PASS
auth_pass 1111
}
# 虚拟IP
virtual_ipaddress {
192.168.1.88/24 #虚拟ip
}
track_script {
check_nginx
}
}
EOF
##[root@k8s-master3 ~]#
cat > /etc/keepalived/keepalived.conf << EOF
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id NGINX_BACKUP
}
vrrp_script check_nginx {
script "/etc/keepalived/check_nginx.sh" # 判断返回状态码
}
vrrp_instance VI_1 {
state BACKUP2
interface ens33 # 修改为实际网卡名
virtual_router_id 3 # 2 VRRP 路由 ID实例,每个实例是唯一的
priority 80 # 优先级,备服务器设置 90,80
advert_int 1 # 指定VRRP 心跳包通告间隔时间
authentication {
auth_type PASS
auth_pass 1111
}
# 虚拟IP
virtual_ipaddress {
192.168.1.88/24 #虚拟ip
}
track_script {
check_nginx
}
}
EOF
#配置nginx 36443端口检测脚本
#全部master
cat > /etc/keepalived/check_nginx.sh << "EOF"
#!/bin/bash
code=$(curl -k https://127.0.0.1:36443/version -s -o /dev/null -w %{http_code})
if [ "$code" -ne 200 ];then
exit 1
else
exit 0
fi
EOF
chmod +x /etc/keepalived/check_nginx.sh
systemctl daemon-reload
systemctl start nginx
systemctl start keepalived
systemctl enable nginx
systemctl enable keepalived
#部署master1的etcd,二进制文件包部署。
准备cfssl证书生成工具
wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
wget https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64
chmod +x cfssl_linux-amd64 cfssljson_linux-amd64 cfssl-certinfo_linux-amd64
mv cfssl_linux-amd64 /usr/local/bin/cfssl
mv cfssljson_linux-amd64 /usr/local/bin/cfssljson
mv cfssl-certinfo_linux-amd64 /usr/bin/cfssl-certinfo
#----下载可能会很慢--------------------------------
#我这里有准备我直接使用下载好的。
tar zxvf cfssl.tar.gz -C /usr/bin/
--------------------------------------------------
mkdir -p ~/etcd_tls
cd ~/etcd_tls
#[root@k8s-master1 etcd_tls]#
cat > ca-config.json << EOF
{
"signing": {
"default": {
"expiry": "87600h"
},
"profiles": {
"www": {
"expiry": "87600h",
"usages": [
"signing",
"key encipherment",
"server auth",
"client auth"
]
}
}
}
}
EOF
#[root@k8s-master1 etcd_tls]#
cat > ca-csr.json << EOF
{
"CN": "etcd CA",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"L": "Beijing",
"ST": "Beijing"
}
]
}
EOF
cfssl gencert -initca ca-csr.json | cfssljson -bare ca -
#[root@k8s-master1 etcd_tls]#
cat > server-csr.json << EOF
{
"CN": "etcd",
"hosts": [
"192.168.1.201",
"192.168.1.202",
"192.168.1.203"
],
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"L": "BeiJing",
"ST": "BeiJing"
}
]
}
EOF
cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=www \
server-csr.json | cfssljson -bare server
#下载etcd二进制包,https://github.com/etcd-io/etcd/releases/download/v3.4.9/etcd-v3.4.9-linux-amd64.tar.gz
cd ~
wgt https://github.com/etcd-io/etcd/releases/download/v3.4.9/etcd-v3.4.9-linux-amd64.tar.gz
mkdir /opt/etcd/{bin,cfg,ssl} -p
tar zxvf etcd-v3.4.9-linux-amd64.tar.gz
mv etcd-v3.4.9-linux-amd64/{etcd,etcdctl} /opt/etcd/bin/
[root@k8s-master1 ~]#
cat > /opt/etcd/cfg/etcd.conf << EOF
#[Member]
ETCD_NAME="etcd-1"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="https://192.168.1.201:2380"
ETCD_LISTEN_CLIENT_URLS="https://192.168.1.201:2379"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.1.201:2380"
ETCD_ADVERTISE_CLIENT_URLS="https://192.168.1.201:2379"
ETCD_INITIAL_CLUSTER="etcd-1=https://192.168.1.201:2380,etcd-2=https://192.168.1.202:2380,etcd-3=https://192.168.1.203:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"
EOF
cp ~/etcd_tls/ca*pem ~/etcd_tls/server*pem /opt/etcd/ssl/
#配置etcd systemctl管理和集群
[root@k8s-master1 ~]#
cat > /usr/lib/systemd/system/etcd.service << EOF
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
EnvironmentFile=/opt/etcd/cfg/etcd.conf
ExecStart=/opt/etcd/bin/etcd \
--cert-file=/opt/etcd/ssl/server.pem \
--key-file=/opt/etcd/ssl/server-key.pem \
--trusted-ca-file=/opt/etcd/ssl/ca.pem \
--peer-cert-file=/opt/etcd/ssl/server.pem \
--peer-key-file=/opt/etcd/ssl/server-key.pem \
--peer-trusted-ca-file=/opt/etcd/ssl/ca.pem \
--logger=zap
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
EOF
scp -r /opt/etcd/ root@192.168.1.202:/opt/
scp /usr/lib/systemd/system/etcd.service root@192.168.1.202:/usr/lib/systemd/system/
scp -r /opt/etcd/ root@192.168.1.203:/opt/
scp /usr/lib/systemd/system/etcd.service root@192.168.1.203:/usr/lib/systemd/system/
[root@k8s-master2 ~]#
cat > /opt/etcd/cfg/etcd.conf << EOF
#[Member]
ETCD_NAME="etcd-2"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="https://192.168.1.202:2380"
ETCD_LISTEN_CLIENT_URLS="https://192.168.1.202:2379"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.1.202:2380"
ETCD_ADVERTISE_CLIENT_URLS="https://192.168.1.202:2379"
ETCD_INITIAL_CLUSTER="etcd-1=https://192.168.1.201:2380,etcd-2=https://192.168.1.202:2380,etcd-3=https://192.168.1.203:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"
EOF
[root@k8s-master3 ~]#
cat > /opt/etcd/cfg/etcd.conf << EOF
#[Member]
ETCD_NAME="etcd-3"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="https://192.168.1.203:2380"
ETCD_LISTEN_CLIENT_URLS="https://192.168.1.203:2379"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.1.203:2380"
ETCD_ADVERTISE_CLIENT_URLS="https://192.168.1.203:2379"
ETCD_INITIAL_CLUSTER="etcd-1=https://192.168.1.201:2380,etcd-2=https://192.168.1.202:2380,etcd-3=https://192.168.1.203:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"
EOF
#全部master节点执行
systemctl daemon-reload
systemctl start etcd
systemctl enable etcd
[root@k8s-master1 ~]# 验证etcd集群状态
ETCDCTL_API=3 /opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem --cert=/opt/etcd/ssl/server.pem --key=/opt/etcd/ssl/server-key.pem --endpoints="https://192.168.1.201:2379,https://192.168.1.202:2379,https://192.168.1.203:2379" endpoint health --write-out=table
+----------------------------+--------+-------------+-------+
| ENDPOINT | HEALTH | TOOK | ERROR |
+----------------------------+--------+-------------+-------+
| https://192.168.1.201:2379 | true | 34.022926ms | |
| https://192.168.1.203:2379 | true | 34.623155ms | |
| https://192.168.1.202:2379 | true | 36.930235ms | |
+----------------------------+--------+-------------+-------+
#安装kubeadm,kubelet和kubectl
yum list --showduplicates kubeadm #列出版本,我选择1.23.0
#3台master和node节点都安装
yum install -y kubelet-1.23.0 kubeadm-1.23.0 kubectl-1.23.0
systemctl enable kubelet
#初始化master1
[root@k8s-master1 ~]#
cat > kubeadm-config.yaml << EOF
apiVersion: kubeadm.k8s.io/v1beta2
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
token: 9037x2.tcaqnpaqkra9vsbw
ttl: 24h0m0s
usages:
- signing
- authentication
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 192.168.1.201
bindPort: 6443
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: k8s-master1
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
---
apiServer:
certSANs: # 包含所有Master/LB/VIP IP,为了方便后期扩容可以多写几个预留的IP。
- k8s-master1
- k8s-master2
- k8s-master3
- 192.168.1.201
- 192.168.1.202
- 192.168.1.203
- 192.168.1.88
- 127.0.0.1
extraArgs:
authorization-mode: Node,RBAC
timeoutForControlPlane: 4m0s
apiVersion: kubeadm.k8s.io/v1beta2
certificatesDir: /etc/kubernetes/pki
clusterName: kubernetes
controlPlaneEndpoint: 192.168.1.88:36443 # 负载均衡虚拟IP(VIP)和端口
controllerManager: {}
dns:
type: CoreDNS
etcd:
external: # 使用外部etcd
endpoints:
- https://192.168.1.201:2379 # etcd集群3个节点
- https://192.168.1.202:2379
- https://192.168.1.203:2379
caFile: /opt/etcd/ssl/ca.pem # 连接etcd所需证书
certFile: /opt/etcd/ssl/server.pem
keyFile: /opt/etcd/ssl/server-key.pem
imageRepository: registry.aliyuncs.com/google_containers # 指定阿里云镜像仓库地址
kind: ClusterConfiguration
kubernetesVersion: v1.23.0 # K8s版本,与上面安装的一致
networking:
dnsDomain: cluster.local
podSubnet: 10.244.0.0/16 # Pod网络,与下面部署的CNI网络组件yaml中保持一致
serviceSubnet: 10.96.0.0/12 # 集群内部虚拟网络,Pod统一访问入口
scheduler: {}
EOF
[root@k8s-master1 ~]# kubeadm init --config kubeadm-config.yaml
#记录以下2段加入集群命令
#加入mastser节点,现在不执行
kubeadm join 192.168.1.88:36443 --token 9037x2.tcaqnpaqkra9vsbw \
--discovery-token-ca-cert-hash sha256:4ddaaac6961b4ec8adef93529f76e53af5a31b182b24c4007835d5007064124a \
--control-plane
#加入node节点
kubeadm join 192.168.1.88:36443 --token 9037x2.tcaqnpaqkra9vsbw \
--discovery-token-ca-cert-hash sha256:4ddaaac6961b4ec8adef93529f76e53af5a31b182b24c4007835d5007064124a
#拷贝配置文件和证书
[root@k8s-master1 ~]#
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
#kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master1 NotReady control-plane,master 7m48s v1.23.0
scp -r /etc/kubernetes/pki/ 192.168.1.202:/etc/kubernetes/
scp -r /etc/kubernetes/pki/ 192.168.1.203:/etc/kubernetes/
[root@k8s-master2 ~]#
kubeadm join 192.168.1.88:36443 --token 9037x2.tcaqnpaqkra9vsbw \
--discovery-token-ca-cert-hash sha256:4ddaaac6961b4ec8adef93529f76e53af5a31b182b24c4007835d5007064124a \
--control-plane
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master1 NotReady control-plane,master 7m3s v1.23.0
k8s-master2 NotReady control-plane,master 86s v1.23.0
[root@k8s-master3 ~]#
kubeadm join 192.168.1.88:36443 --token 9037x2.tcaqnpaqkra9vsbw \
--discovery-token-ca-cert-hash sha256:4ddaaac6961b4ec8adef93529f76e53af5a31b182b24c4007835d5007064124a \
--control-plane
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master1 NotReady control-plane,master 11m v1.23.0
k8s-master2 NotReady control-plane,master 5m58s v1.23.0
k8s-master3 NotReady control-plane,master 86s v1.23.0
#node节点加入
[root@k8s-node1 ~]
kubeadm join 192.168.1.88:36443 --token 9037x2.tcaqnpaqkra9vsbw \
--discovery-token-ca-cert-hash sha256:4ddaaac6961b4ec8adef93529f76e53af5a31b182b24c4007835d5007064124a
systemctl enable kubelet
[root@k8s-node2 ~]
kubeadm join 192.168.1.88:36443 --token 9037x2.tcaqnpaqkra9vsbw \
--discovery-token-ca-cert-hash sha256:4ddaaac6961b4ec8adef93529f76e53af5a31b182b24c4007835d5007064124a
systemctl enable kubelet
[root@k8s-master1 ~]# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master1 NotReady control-plane,master 35m v1.23.0
k8s-master2 NotReady control-plane,master 30m v1.23.0
k8s-master3 NotReady control-plane,master 25m v1.23.0
k8s-node1 NotReady <none> 5m40s v1.23.0
k8s-node2 NotReady <none> 17s v1.23.0
#安装网络插件calico
#下载calico
wget https://docs.projectcalico.org/manifests/calico.yaml
[root@k8s-master1 ~]
kubectl apply -f calico.yaml
[root@k8s-master1 ~]# kubectl get pods -n kube-system #查看进度
NAME READY STATUS RESTARTS AGE
calico-kube-controllers-d4bfdcb9-z8smn 1/1 Running 0 7m21s
calico-node-2m8mn 1/1 Running 0 7m21s
calico-node-7htf2 1/1 Running 0 7m21s
calico-node-psbsx 1/1 Running 0 7m21s
calico-node-rs8hv 1/1 Running 0 7m21s
calico-node-s6mlh 1/1 Running 0 7m21s
coredns-6d8c4cb4d-vwpw5 1/1 Running 0 52m
coredns-6d8c4cb4d-zlcjl 1/1 Running 0 52m
kube-apiserver-k8s-master1 1/1 Running 0 52m
kube-apiserver-k8s-master2 1/1 Running 0 46m
kube-apiserver-k8s-master3 1/1 Running 0 42m
kube-controller-manager-k8s-master1 1/1 Running 0 52m
kube-controller-manager-k8s-master2 1/1 Running 0 46m
kube-controller-manager-k8s-master3 1/1 Running 0 42m
kube-proxy-9pd5s 1/1 Running 0 22m
kube-proxy-mzqpg 1/1 Running 0 16m
kube-proxy-pkml9 1/1 Running 0 42m
kube-proxy-tw45x 1/1 Running 0 52m
kube-proxy-x7gj6 1/1 Running 0 46m
kube-scheduler-k8s-master1 1/1 Running 0 52m
kube-scheduler-k8s-master2 1/1 Running 0 46m
kube-scheduler-k8s-master3 1/1 Running 0 42m
[root@k8s-master1 ~]# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master1 Ready control-plane,master 52m v1.23.0
k8s-master2 Ready control-plane,master 46m v1.23.0
k8s-master3 Ready control-plane,master 42m v1.23.0
k8s-node1 Ready <none> 22m v1.23.0
k8s-node2 Ready <none> 17m v1.23.0
部署完毕,可以关闭master1节点的etcd,测试集群是否仍然能正常访问,这里就不测试了。
有部署问题可以联系我。