Rancher v2.6.5创建下游集群v1.23.7-rke2r2失败

Rancher Server 设置

  • Rancher 版本:V2.6.5
  • 安装选项:Helm Chart
    • local 集群类型:k3s (版本v1.23.6+k3s1)
    • 默认使用aliyun镜像
  • 在线部署

下游集群信息

  • Kubernetes 版本: rke2或k3s

用户信息

  • 登录用户的角色:初始admin管理员

问题描述:

  • 使用rancher创建rke2集群或k3s集群后,节点注册失败

重现步骤:

结果:

  • rancher报错 error applying plan – check rancher-system-agent.service logs on node …
  • 在节点查看rancher-system-agent.service的日志(见下方日志

预期结果:

  • 成功创建下游集群

截图:

其他上下文信息:

日志
level=info msg="[Applyinator] Extracting image registry.cn-hangzhou.aliyuncs.com/rancher/system-agent-installer-rke2:v1.23.7-rke2r2 to directory /var/lib/rancher/agent/work/20220617-034001/dca32c8e1254d24c2629802bf5749446b2dda0cbeed41918ea35006c3160df25_0"
level=info msg="Using private registry config file at /etc/rancher/agent/registries.yaml"
level=info msg="Pulling image registry.cn-hangzhou.aliyuncs.com/rancher/system-agent-installer-rke2:v1.23.7-rke2r2"
level=error msg="error while staging: GET https://registry.cn-hangzhou.aliyuncs.com/v2/rancher/system-agent-installer-rke2/manifests/v1.23.7-rke2r2: MANIFEST_UNKNOWN: manifest unknown; map[Tag:v1.23.7-rke2r2]: failed to get image registry.cn-hangzhou.aliyuncs.com/rancher/system-agent-installer-rke2:v1.23.7-rke2r2"
level=error msg="error executing instruction 0: GET https://registry.cn-hangzhou.aliyuncs.com/v2/rancher/system-agent-installer-rke2/manifests/v1.23.7-rke2r2: MANIFEST_UNKNOWN: manifest unknown; map[Tag:v1.23.7-rke2r2]: failed to get image registry.cn-hangzhou.aliyuncs.com/rancher/system-agent-installer-rke2:v1.23.7-rke2r2"
level=error msg="error encountered during parsing of last run time: parsing time \"\" as \"Mon Jan _2 15:04:05 MST 2006\": cannot parse \"\" as \"Mon\""
level=info msg="[Applyinator] No image provided, creating empty working directory /var/lib/rancher/agent/work/20220617-034001/dca32c8e1254d24c2629802bf5749446b2dda0cbeed41918ea35006c3160df25_0"
level=info msg="[Applyinator] Running command: sh [-c rke2 etcd-snapshot list --etcd-s3=false 2>/dev/null]"
level=info msg="[Applyinator] Command sh [-c rke2 etcd-snapshot list --etcd-s3=false 2>/dev/null] finished with err: <nil> and exit code: 127"
level=error msg="error loading CA cert for probe (kube-scheduler) /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.crt: open /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.crt: no such file or directory"
level=error msg="error while appending ca cert to pool for probe kube-scheduler"
level=error msg="error loading x509 client cert/key for probe kube-apiserver (/var/lib/rancher/rke2/server/tls/client-kube-apiserver.crt//var/lib/rancher/rke2/server/tls/client-kube-apiserver.key): open /var/lib/rancher/rke2/server/tls/client-kube-apiserver.crt: no such file or directory"
level=error msg="error loading CA cert for probe (kube-apiserver) /var/lib/rancher/rke2/server/tls/server-ca.crt: open /var/lib/rancher/rke2/server/tls/server-ca.crt: no such file or directory"
level=error msg="error while appending ca cert to pool for probe kube-apiserver"
level=error msg="error loading CA cert for probe (kube-controller-manager) /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.crt: open /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.crt: no such file or directory"
level=error msg="error while appending ca cert to pool for probe kube-controller-manager"
level=error msg="error encountered during parsing of last run time: parsing time \"\" as \"Mon Jan _2 15:04:05 MST 2006\": cannot parse \"\" as \"Mon\""
level=error msg="error loading x509 client cert/key for probe kube-apiserver (/var/lib/rancher/rke2/server/tls/client-kube-apiserver.crt//var/lib/rancher/rke2/server/tls/client-kube-apiserver.key): open /var/lib/rancher/rke2/server/tls/client-kube-apiserver.crt: no such file or directory"

日志中可以明显看出,镜像拉取不到,仓库中应该不存在此镜像。
registry.cn-hangzhou.aliyuncs.com 是面向国内社区的镜像mirror,由社区志愿者维护。镜像同步通常存在滞后性。

实际上,官方镜像都会发布在dockerhub上。
https://hub.docker.com/r/rancher/system-agent-installer-rke2

看起来你使用的是1.23.7,该版本是昨天刚刚发布的,镜像同步一般没那么快。

非常感谢!改用DockerHub镜像就可以成功创建了。

我也报这个错
Jun 23 16:11:16 k8s-01 rancher-system-agent[22319]: time=“2022-06-23T16:11:16+08:00” level=error msg=“error encountered during parsing of last run time: parsing time “” as “Mon Jan _2 15:04:05 MST 2006”: cannot parse “” as “Mon””
但是我没有拉取镜像报错

1 个赞

me too. marked!

你是如何操作的?请列出详细的操作步骤