国内资源:
- Rancher Releases Mirrors:https://mirror.rancher.cn/
- 阿里云镜像仓库:registry.cn-hangzhou.aliyuncs.com
root@demo-1:~# mkdir -p /etc/rancher/rke2/
root@demo-1:~# cat >/etc/rancher/rke2/config.yaml <<EOL
token: 123456
system-default-registry: registry.cn-hangzhou.aliyuncs.com
EOL
root@demo-1:~# curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | \
INSTALL_RKE2_MIRROR=cn sh -
[INFO] finding release for channel stable
[INFO] using v1.28.10-rke2r1 as release
[INFO] downloading checksums at https://rancher-mirror.rancher.cn/rke2/releases/download/v1.28.10-rke2r1/sha256sum-amd64.txt
[INFO] downloading tarball at https://rancher-mirror.rancher.cn/rke2/releases/download/v1.28.10-rke2r1/rke2.linux-amd64.tar.gz
[INFO] verifying tarball
[INFO] unpacking tarball file to /usr/local
root@demo-1:~# systemctl start rke2-server.service
root@demo-1:~# export CRI_CONFIG_FILE=/var/lib/rancher/rke2/agent/etc/crictl.yaml
root@demo-1:~# /var/lib/rancher/rke2/bin/crictl images
IMAGE TAG IMAGE ID SIZE
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-calico v3.27.3-build20240423 3564b4ac1d3dc 199MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-cluster-autoscaler v1.8.10-build20240124 cd00dc5289588 12MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-coredns v1.11.1-build20240305 00df8b41cfd2e 23.5MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-etcd v3.5.9-k3s1-build20240418 7893f7425a52a 16.6MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-flannel v0.25.1-build20240423 398c3d1a135f0 83.3MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-k8s-metrics-server v0.7.1-build20240401 6d80f01a1966b 18.4MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-kubernetes v1.28.10-rke2r1-build20240514 b7e03d90f06bb 175MB
registry.cn-hangzhou.aliyuncs.com/rancher/klipper-helm v0.8.3-build20240228 0929b4140ada6 91.2MB
registry.cn-hangzhou.aliyuncs.com/rancher/mirrored-ingress-nginx-kube-webhook-certgen v20230312-helm-chart-4.5.2-28-g66a760794 5a86b03a88d23 20.1MB
registry.cn-hangzhou.aliyuncs.com/rancher/mirrored-pause 3.6 6270bb605e12e 298kB
registry.cn-hangzhou.aliyuncs.com/rancher/mirrored-sig-storage-snapshot-controller v6.2.1 1ef6c138bd5f2 24.2MB
registry.cn-hangzhou.aliyuncs.com/rancher/mirrored-sig-storage-snapshot-validation-webhook v6.2.2 ff52c2bcf9f88 21.1MB
registry.cn-hangzhou.aliyuncs.com/rancher/nginx-ingress-controller nginx-1.9.6-hardened1 3f5b7fd2026e9 325MB
registry.cn-hangzhou.aliyuncs.com/rancher/rke2-cloud-provider v1.29.3-build20240412 3525a3daa55c9 68MB
registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime v1.28.10-rke2r1 4f23dbe9c5144 108MB
RKE2 agent 节点安装:
root@demo-2:~# mkdir -p /etc/rancher/rke2/
root@demo-2:~# cat >/etc/rancher/rke2/config.yaml <<EOL
server: https://172.16.0.98:9345
token: 123456
EOL
root@demo-2:~# curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | \
INSTALL_RKE2_MIRROR=cn \
INSTALL_RKE2_TYPE="agent" sh -
[INFO] finding release for channel stable
[INFO] using v1.28.10-rke2r1 as release
[INFO] downloading checksums at https://rancher-mirror.rancher.cn/rke2/releases/download/v1.28.10-rke2r1/sha256sum-amd64.txt
[INFO] downloading tarball at https://rancher-mirror.rancher.cn/rke2/releases/download/v1.28.10-rke2r1/rke2.linux-amd64.tar.gz
[INFO] verifying tarball
[INFO] unpacking tarball file to /usr/local
root@demo-2:~# systemctl start rke2-agent.service
root@demo-2:~# export CRI_CONFIG_FILE=/var/lib/rancher/rke2/agent/etc/crictl.yaml
root@demo-2:~# /var/lib/rancher/rke2/bin/crictl images
IMAGE TAG IMAGE ID SIZE
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-calico v3.27.3-build20240423 3564b4ac1d3dc 199MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-coredns v1.11.1-build20240305 00df8b41cfd2e 23.5MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-flannel v0.25.1-build20240423 398c3d1a135f0 83.3MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-kubernetes v1.28.10-rke2r1-build20240514 b7e03d90f06bb 175MB
registry.cn-hangzhou.aliyuncs.com/rancher/mirrored-pause 3.6 6270bb605e12e 298kB
registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime v1.28.10-rke2r1 4f23dbe9c5144 108MB
高可用安装
将第二台和第三台 RKE2 Server 加入集群::
root@demo-2:~# mkdir -p /etc/rancher/rke2/
root@demo-2:~# cat >/etc/rancher/rke2/config.yaml <<EOL
server: https://172.16.0.98:9345
token: 123456
system-default-registry: registry.cn-hangzhou.aliyuncs.com
EOL
root@demo-2:~# curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh | \
INSTALL_RKE2_MIRROR=cn sh -
[INFO] finding release for channel stable
[INFO] using v1.28.10-rke2r1 as release
[INFO] downloading checksums at https://rancher-mirror.rancher.cn/rke2/releases/download/v1.28.10-rke2r1/sha256sum-amd64.txt
[INFO] downloading tarball at https://rancher-mirror.rancher.cn/rke2/releases/download/v1.28.10-rke2r1/rke2.linux-amd64.tar.gz
[INFO] verifying tarball
[INFO] unpacking tarball file to /usr/local
root@demo-2:~# systemctl start rke2-server.service
查看第二台和第三台 RKE2 Server 镜像:
root@demo-2:~# /var/lib/rancher/rke2/bin/crictl images
IMAGE TAG IMAGE ID SIZE
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-calico v3.27.3-build20240423 3564b4ac1d3dc 199MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-coredns v1.11.1-build20240305 00df8b41cfd2e 23.5MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-etcd v3.5.9-k3s1-build20240418 7893f7425a52a 16.6MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-flannel v0.25.1-build20240423 398c3d1a135f0 83.3MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-kubernetes v1.28.10-rke2r1-build20240514 b7e03d90f06bb 175MB
registry.cn-hangzhou.aliyuncs.com/rancher/mirrored-pause 3.6 6270bb605e12e 298kB
registry.cn-hangzhou.aliyuncs.com/rancher/nginx-ingress-controller nginx-1.9.6-hardened1 3f5b7fd2026e9 325MB
registry.cn-hangzhou.aliyuncs.com/rancher/rke2-cloud-provider v1.29.3-build20240412 3525a3daa55c9 68MB
registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime v1.28.10-rke2r1 4f23dbe9c5144 108MB
root@demo-3:~# /var/lib/rancher/rke2/bin/crictl images
IMAGE TAG IMAGE ID SIZE
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-calico v3.27.3-build20240423 3564b4ac1d3dc 199MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-etcd v3.5.9-k3s1-build20240418 7893f7425a52a 16.6MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-flannel v0.25.1-build20240423 398c3d1a135f0 83.3MB
registry.cn-hangzhou.aliyuncs.com/rancher/hardened-kubernetes v1.28.10-rke2r1-build20240514 b7e03d90f06bb 175MB
registry.cn-hangzhou.aliyuncs.com/rancher/mirrored-pause 3.6 6270bb605e12e 298kB
registry.cn-hangzhou.aliyuncs.com/rancher/nginx-ingress-controller nginx-1.9.6-hardened1 3f5b7fd2026e9 325MB
registry.cn-hangzhou.aliyuncs.com/rancher/rke2-cloud-provider v1.29.3-build20240412 3525a3daa55c9 68MB
registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime v1.28.10-rke2r1 4f23dbe9c5144 108MB