RKE2 mirrors加速配置

cat >>/etc/rancher/rke2/registries.yaml <<EOF
mirrors:
  "docker.io":
    endpoint:
      - "https://docker.nju.edu.cn/"
      - "https://registry-1.docker.io"
EOF


查看配置是否生效
cat /var/lib/rancher/rke2/agent/etc/containerd/certs.d/docker.io/hosts.toml

k3s

cat >>/etc/rancher/k3s/registries.yaml <<EOF
mirrors:
  "docker.io":
    endpoint:
      - "https://docker.nju.edu.cn/"
      - "https://registry-1.docker.io"
EOF


查看配置
cat /var/lib/rancher/k3s/agent/etc/containerd/certs.d/docker.io/hosts.toml