install

rancher 安装 docker
https://rancher.com/docs/rancher/v2.5/en/installation/requirements/installing-docker/

1
2
curl <https://releases.rancher.com/install-docker/20.10.sh> | sh

dockerd-rootless-setuptool.sh

install
查看docker版本
docker version

Untitled.png

登陆docker 账号
sudo docker login

安装单个Node
https://rancher.com/docs/rancher/v2.5/en/installation/other-installation-methods/single-node-docker/

1
2
3
4
5
6
7
sudo docker run -d --restart=unless-stopped \\
-p 80:80 \\
-p 443:443 \\
-v /opt/rancher:/var/lib/rancher \\
--privileged \\
rancher/rancher:latest

通过docker 查看安装密码

Untitled 1.png

Untitled 2.png

1
sudo docker logs  container-id  2>&1 | grep "Bootstrap Password:"

创建单节点 kubernetes

Untitled 3.png

Untitled 4.png

Untitled 5.png
Untitled 6.png

1
restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run  rancher/rancher-agent:v2.6.2 --server <https://10.0.0.6> --token hv5fx5m5g82fdbtzlt2dm6tw9s5p5cvdwpzbxkl9gvzf54hrw6t52t --ca-checksum 678bc8d2331c35b0274ffdea8a363b6e8f51a979894a4285fa0f6e0d4592e9f2 --etcd --controlplane --worker