Rke2配置了registries.yaml,配置的私库没有生效,certs.d未正常创建,不知是不是和安装时配置修改了data-dir有关

环境信息:
RKE2 版本:
rke2 version v1.33.6+rke2r1 (2c2298232b55a94bd16b059f893c76a950811489)
go version go1.24.9 X:boringcrypto

节点 CPU 架构,操作系统和版本:
Linux k8sqa16 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

集群配置:
3 servers, 3 agents

问题描述:
rke2安装时,配置了config.yaml中
system-default-registry: “repo.test.com:12343
private-registry: “repo.test.com:12343
配置了/etc/rancher/rke2/registries.yaml为
mirrors:
docker.io:
endpoint:
- “https://repo.test.com:12343
集群安装后,系统组件pod的镜像都是repo.test.com:12343,部署自己的应用,应用的镜像却还是从docker.io拉取,没有从私库拉取

重现步骤:

/etc/rancher/rke2/registries.yaml文件的内容如下:
mirrors:
docker.io:
endpoint:
- “https://repo.test.com:12343
安装命令:
INSTALL_RKE2_VERSION=“v1.33.6+rke2r1” INSTALL_RKE2_TYPE=“server” INSTALL_RKE2_METHOD=“tar” INSTALL_RKE2_ARTIFACT_PATH=/space/data/rkeairgap sh install.sh

agent节点的安装配置:
/etc/rancher/rke2/config.yaml的内容为:
server: “https://rancher.test.com:9345
token: “demo-cluster”
data-dir: “/space/lib/rancher/rke2”
system-default-registry: “repo.test.com:12343
private-registry: “repo.test.com:12343

/etc/rancher/rke2/registries.yaml内容为:
mirrors:
docker.io:
endpoint:
- “https://repo.test.com:12343
agent节点的安装命令为:
INSTALL_RKE2_VERSION=“v1.33.6+rke2r1” INSTALL_RKE2_TYPE=“agent” INSTALL_RKE2_METHOD=“tar” INSTALL_RKE2_ARTIFACT_PATH=/space/data/rkeairgap sh install.sh

预期结果:
安装成功的集群,在集群中部署应用:
kubectl create deployment hello-world-test --image=rancher/hello-world --replicas=1 -n test
该应用应该从镜像仓库repo.test.com:12343 拉取镜像
实际结果:
该应用从docker.io拉取镜像,拉取不下来

日志


Failed to pull image “rancher/hello-world”: rpc error: code = DeadlineExceeded desc = failed to pull and unpack image “docker.io/rancher/hello-world:latest”: failed to resolve reference “docker.io/rancher/hello-world:latest”: failed to do request: Head “https://registry-1.docker.io/v2/rancher/hello-world/manifests/latest”: dial tcp 50.17.213.32:443: i/o timeout

你的私有镜像仓库中有这个镜像么?可以直接 pull 下来么?

有私库的,可以直接pull下来。
私库没有问题,之前安装了一个rancher v2.11.3,通过rancher的ui直接创建的rke2,配置的registries也是可以使用的。

他的路径好像是data-dir: “/space/lib/rancher/rke2”,不是使用默认的