1、修改 hosts 的 配置
10.136.195.44 master
10.136.195.150 node1
最好重新的启动 虚拟机。
2、清理上次生成的初始化文件
rm -rf /etc/kubernetes/*
rm -rf ~/.kube/*
rm -rf /var/lib/etcd/*
3、关闭端口占用的进程
[init] Using Kubernetes version: v1.23.6
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Port-10259]: Port 10259 is in use
[ERROR Port-10257]: Port 10257 is in use
[ERROR Port-10250]: Port 10250 is in use
4、kubeadm reset
5、执行初始化的命令
kubeadm init \
--apiserver-advertise-address=10.136.195.44 \
--image-repository registry.aliyuncs.com/google_containers \
--kubernetes-version v1.15.0 \
--service-cidr=10.1.0.0/16 \
--pod-network-cidr=10.244.0.0/16