Rancher中k3无法从私库拉取镜像

离线环境部署rancher,k3s无法从私库中拉取镜像

环境信息:
RKE2 版本:
rancher:v2.7.10

节点 CPU 架构,操作系统和版本:
ARM64,centos,docker单节点部署

问题描述:
rancher容器中的k3s无法从私库中拉取镜像

重现步骤:

  • 安装 RKE2 的命令:
    docker启动rancher指令:
    docker run -itd --privileged --restart=unless-stopped -p 28088:80 --name rancher -e CATTLE_SYSTEM_DEFAULT_REGISTRY=192.1.5.4:5000 -e CRICTL_INSECURE_SKIP_TLS_VERIFY=true -e CATTLE_SYSTEM_CATALOG=bundled -v /etc/rancher/k3s/registries.yaml:/etc/rancher/k3s/registries.yaml rancher/rancher:v2.7.10

实际结果:
执行了 kubectl get pods -A


这是执行了kubectl describe pod helm-operation-2fk9h -n cattle-system

这是我rancher容器中k3s从私库拉取镜像的报错

大概率是镜像仓库的配置有问题

问题是我容器内部k3s挂载的私库配置和宿主机k3s的私库配置一样,同一个registries.yaml,我想如果是配置文件的问题的话我宿主机的k3s应该从私库拉取镜像也是失败的

在 rancher 容器内部可以访问到 http://192.1.5.4:5000 么?

镜像拉取问题我换成rancher2.8.0已经解决,但是我目前单节点部署rancher,内部k3s中的cattle-fleet-local-system 无法启动

这是rancher启动日志报的错误

2024/06/26 01:41:11 [ERROR] failed to call leader func: failed to add management data: failed to fetch images from extensions: Get “https://api.github.com/repos/rancher/ui-plugin-charts/releases”: dial tcp: lookup api.github.com: i/o timeout
2024/06/26 01:41:19 [ERROR] error syncing ‘fleet-local/local’: handler cluster-create: server url is missing, can’t generate kubeconfig for fleet import cluster, requeuing
2024/06/26 01:41:23 [ERROR] error syncing ‘server-url’: handler apiservice-settings: secrets “tls-rancher-internal-ca” not found, requeuing

v2.8.0 从 github url 拉取 ui-plugin,不支持离线环境启动,这是一个 bug 建议升级到 v2.8.1 以后的版本

大佬,我现在升级到2.8.3,但是启动还是报错,我想请教一下,如果我要在amr64架构系统环境下离线部署rancher,哪个版本是最稳妥的,或者说是有成功案例的

这是我2.8.3的启动的报错日志

2024/07/08 09:43:31 [ERROR] namespaceHandler: Sync: error adding project id label to namespace err=Operation cannot be fulfilled on namespaces “cattle-fleet-clusters-system”: the object has been modified; please apply your changes to the latest version and try again
2024/07/08 09:43:32 [ERROR] defaultSvcAccountHandler: Sync: error handling default ServiceAccount of namespace key=cattle-fleet-clusters-system, err=Operation cannot be fulfilled on namespaces “cattle-fleet-clusters-system”: the object has been modified; please apply your changes to the latest version and try again
2024/07/08 09:43:32 [ERROR] defaultSvcAccountHandler: Sync: error handling default ServiceAccount of namespace key=cattle-fleet-clusters-system, err=Operation cannot be fulfilled on namespaces “cattle-fleet-clusters-system”: the object has been modified; please apply your changes to the latest version and try again
2024/07/08 09:43:32 [ERROR] namespaceHandler: Sync: error adding project id label to namespace err=Operation cannot be fulfilled on namespaces “cluster-fleet-local-local-1a3d67d0a899”: the object has been modified; please apply your changes to the latest version and try again
2024/07/08 09:43:32 [ERROR] defaultSvcAccountHandler: Sync: error handling default ServiceAccount of namespace key=cluster-fleet-local-local-1a3d67d0a899, err=Operation cannot be fulfilled on namespaces “cluster-fleet-local-local-1a3d67d0a899”: the object has been modified; please apply your changes to the latest version and try again