参考文档 https://rancher2.docs.rancher.cn/docs/installation/options/tls-secrets/_index/
参考文档
配置机器免密登录
输入命令ssh-keygen
按三次回车,完成生成私钥和公钥
/root/.ssh目录下可看到刚刚那条命令生成的私钥和公钥
将免密公钥推送集群内三台主机的 rancher账户(或其他可以使用docker的账号,centos不能使用root账号)三台机器都推送,包括自身
ssh-copy-id -i ~/.ssh/id_rsa.pub rancher@ip1
下载rke http://mirror.cnrancher.com/
chmod +x rke_linux-amd64
mv rke_linux-amd64 /usr/bin/rke
rke --version
kubectl、helm安装参考k3s安装
创建一个名为rancher-cluster.yml的 Kubernetes 集群配置文件
nodes:
- address: 10.0.0.3
user: root
role: [controlplane, worker, etcd]
- address: 10.0.0.4
user: root
role: [controlplane, worker, etcd]
- address: 10.0.0.5
user: root
role: [controlplane, worker, etcd]
services:
etcd:
snapshot: true
creation: 6h
retention: 24h
rke up --config ./rancher-cluster.yml
测试集群
当您运行 rke up 时,RKE 应该已经创建了一