Rancher安装后重复启动

Rancher Server 设置

  • Rancher 版本:2.7.10
  • 安装选项 (Docker install/Helm Chart): Docker install
  • 在线或离线部署:在线

下游集群信息

  • Kubernetes 版本:
  • Cluster Type (Local/Downstream):
    • 如果 Downstream,是什么类型的集群?(自定义/导入或为托管 等):

用户信息

  • 登录用户的角色是什么? 管理员
    • 如果自定义,自定义权限集:

主机操作系统:
centos7
问题描述:
docker run 安装的rancher,重复启动。
重现步骤:
docker run -d --restart=always
-p 8080:80 -p 8443:443
-v /opt/data/rancher_data:/var/lib/rancher
-v /etc/localtime:/etc/localtime
–privileged
–name rancher-2-7-10
rancher/rancher:v2.7.10
结果:

预期结果:

截图:


其他上下文信息:

日志

k3s日志
E0315 11:49:02.609481 100 leaderelection.go:367] Failed to update lock: Put “https://127.0.0.1:6444/apis/coordination.k8s.io/v1/namespaces/kube-system/leases/kube-scheduler?timeout=5s”: context deadline exceeded
I0315 11:49:02.609574 100 leaderelection.go:283] failed to renew lease kube-system/kube-scheduler: timed out waiting for the condition
E0315 11:49:02.609609 100 leaderelection.go:367] Failed to update lock: Put “https://127.0.0.1:6444/apis/coordination.k8s.io/v1/namespaces/kube-system/leases/kube-controller-manager?timeout=5s”: context deadline exceeded
I0315 11:49:02.609757 100 leaderelection.go:283] failed to renew lease kube-system/kube-controller-manager: timed out waiting for the condition
E0315 11:49:02.609858 100 writers.go:122] apiserver was unable to write a JSON response: http: Handler timeout
E0315 11:49:02.609892 100 status.go:71] apiserver received an error that is not an metav1.Status: &errors.errorString{s:“http: Handler timeout”}: http: Handler timeout
E0315 11:49:02.609958 100 controllermanager.go:294] “leaderelection lost”
E0315 11:49:02.609476 100 leaderelection.go:367] Failed to update lock: Put “https://127.0.0.1:6444/apis/coordination.k8s.io/v1/namespaces/kube-system/leases/k3s-cloud-controller-manager?timeout=5s”: context deadline exceeded

docker logs
2024/03/15 17:21:11 [ERROR] Failed to install system chart fleet: failed to install , pod cattle-system/helm-operation-4vctq exited 123
W0315 17:22:05.410867 46 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineHealthCheck is deprecated; use cluster.x-k8s.io/v1beta1 MachineHealthCheck
2024/03/15 17:22:49 httputil: ReverseProxy read error during body copy: unexpected EOF
2024/03/15 17:22:49 [ERROR] error syncing ‘pod-impersonation-helm-op-2gf7r’: handler auth-prov-v2-crole: Put “https://127.0.0.1:6444/apis/rbac.authorization.k8s.io/v1/clusterroles/pod-impersonation-helm-op-2gf7r”: read tcp 127.0.0.1:48234->127.0.0.1:6444: read: connection reset by peer, requeuing
2024/03/15 17:22:49 [ERROR] error syncing ‘pod-impersonation-helm-op-2gf7r’: handler auth-prov-v2-crole: Put “https://127.0.0.1:6444/apis/rbac.authorization.k8s.io/v1/clusterroles/pod-impersonation-helm-op-2gf7r”: read tcp 127.0.0.1:41550->127.0.0.1:6444: read: connection reset by peer, requeuing
2024/03/15 17:22:49 [ERROR] error syncing ‘pod-impersonation-helm-op-2gf7r’: handler auth-prov-v2-crole: Put “https://127.0.0.1:6444/apis/rbac.authorization.k8s.io/v1/clusterroles/pod-impersonation-helm-op-2gf7r”: dial tcp 127.0.0.1:6444: connect: connection refused, requeuing
2024/03/15 17:22:49 [FATAL] k3s exited with: exit status 1

2024/03/15 17:21:11 [ERROR] Failed to install system chart fleet: failed to install , pod cattle-system/helm-operation-4vctq exited 123
W0315 17:22:05.410867 46 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineHealthCheck is deprecated; use cluster.x-k8s.io/v1beta1 MachineHealthCheck
2024/03/15 17:22:49 httputil: ReverseProxy read error during body copy: unexpected EOF
2024/03/15 17:22:49 [ERROR] error syncing ‘pod-impersonation-helm-op-2gf7r’: handler auth-prov-v2-crole: Put “https://127.0.0.1:6444/apis/rbac.authorization.k8s.io/v1/clusterroles/pod-impersonation-helm-op-2gf7r”: read tcp 127.0.0.1:48234->127.0.0.1:6444: read: connection reset by peer, requeuing
2024/03/15 17:22:49 [ERROR] error syncing ‘pod-impersonation-helm-op-2gf7r’: handler auth-prov-v2-crole: Put “https://127.0.0.1:6444/apis/rbac.authorization.k8s.io/v1/clusterroles/pod-impersonation-helm-op-2gf7r”: read tcp 127.0.0.1:41550->127.0.0.1:6444: read: connection reset by peer, requeuing
2024/03/15 17:22:49 [ERROR] error syncing ‘pod-impersonation-helm-op-2gf7r’: handler auth-prov-v2-crole: Put “https://127.0.0.1:6444/apis/rbac.authorization.k8s.io/v1/clusterroles/pod-impersonation-helm-op-2gf7r”: dial tcp 127.0.0.1:6444: connect: connection refused, requeuing
2024/03/15 17:22:49 [FATAL] k3s exited with: exit status 1

启动过程中,可以 exec 到 容器内,然后 查看 k3s.log 的日志,然后才能确定 K3s 为什么会退出,导致 rancher 无法启动