1 自签ETCD SSL证书
1.1 安装cfssl
1 | curl -L https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -o /usr/local/bin/cfssl |
1.2 生成自签证书
1 | mkdir -p /root/k8s/etcd-cert |
2 创建etcd集群脚本并执行脚本
2.1 创建etcd.sh 脚本
1 | mkdir -p /root/shell-script |
2.2 启动etcd集群
1 | cp /root/k8s/etcd-cert/ca*pem /root/k8s/etcd-cert/server*pem /opt/etcd/ssl |
3 启动另外两个etcd节点
1 | # 先复制证书和配置等信息 |
4 检查集群启动是否成功 etcdctl v3
1 | $ /opt/etcd/bin/etcdctl --endpoints=https://192.168.0.201:2379 --key=/opt/etcd/ssl/server-key.pem --cert=/opt/etcd/ssl/server.pem --cacert=/opt/etcd/ssl/ca.pem member list |
4 检查集群启动是否成功 etcdctl v2
1 | $ export ETCDCTL_API=2 |