Rancher2.6.5页面使用rke2安装k8s集群

Rancher Server 设置

  • Rancher 版本:2.6.5
  • 安装选项 (Docker install/Helm Chart):
    • 如果是 Helm Chart 安装,需要提供 Local 集群的类型(RKE1, RKE2, k3s, EKS, 等)和版本:RKE2
  • 在线或离线部署:离线

问题描述:
自定义安装时我使用RKE2安装,配置选项中镜像仓库我配置好高级容器Mirror和仓库验证选项。
在主节点执行了注册命令,我查看rancher-system-agent,正常pull了所需的镜像,但是一直报错

日志

Jun 08 09:08:02 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:02+08:00” 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”
Jun 08 09:08:02 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:02+08:00” level=error msg=“error while appending ca cert to pool for probe kube-controller-manager”
Jun 08 09:08:02 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:02+08:00” 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”
Jun 08 09:08:02 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:02+08:00” level=error msg=“error while appending ca cert to pool for probe kube-scheduler”
Jun 08 09:08:07 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:07+08:00” 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”
Jun 08 09:08:07 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:07+08:00” level=error msg=“error while appending ca cert to pool for probe kube-controller-manager”
Jun 08 09:08:07 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:07+08:00” 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”
Jun 08 09:08:07 k8s-02 rancher-system-agent[12449]: time=“2022-06-08T09:08:07+08:00” level=error msg=“error while appending ca cert to pool for probe kube-scheduler”

我查看/var/lib/rancher/rke2/server/文件夹,里面确实没有kube-scheduler、kube-controller-manager等文件夹,我曾经用2.6.3就装成功过,没有这些问题。

报错的这些证书需要自己手动创建吗?

已解决,我的工作节点kubelet是启动的,查看kubelet日志/var/lib/rancher/rke2/agent/logs/kubelet.log,发现从私服拉取镜像失败,上传镜像后解决。

1 个赞