Ubuntu 22.04 使用 rke 安装 k8s 报 failed to get container info for "/../docker.service": unknown container "/../docker.service"

RKE 版本:

v1.2.8

Docker 版本: (docker version,docker info)

20.10.15    Cgroup Driver: systemd

操作系统和内核: (cat /etc/os-release, uname -r)

5.15.0-27-generic

主机类型和供应商: (VirtualBox/Bare-metal/AWS/GCE/DO)

exsi

cluster.yml 文件:

cluster_name: hyt-kubernetes
kubernetes_version: "v1.20.6-rancher1-1"

private_registries:
  - url: 192.168.101.30/k8s
    user: 
    password: 
    is_default: true

nodes:
- address: 10.1.7.51
  #hostname_override: master1
  user: rancher
  role:
  - controlplane
  - etcd
  - worker
  ssh_key_path: /home/rancher/.ssh/id_rsa
  port: 22
services:
  etcd:
    backup_config:
      interval_hours: 6
      enabled: true
      retention: 10
      extra_args:
        auto-compaction-retention: 240
        quota-backend-bytes: '6442450944'
      extra_binds:
        - "/etc/localtime:/etc/localtime"


  kube-api:
    service_cluster_ip_range: 10.43.0.0/16
    service_node_port_range: 30000-40000
    pod_security_policy: false
    extra_args:
      watch-cache: true
      default-watch-cache-size: 1500
      event-ttl: 1h0m0s
      max-requests-inflight: 2000
      max-mutating-requests-inflight: 2000
      kubelet-timeout: 5s
      audit-log-path: "-"
      delete-collection-workers: 3
      v: 4
    extra_binds:
      - "/etc/localtime:/etc/localtime"

  kube-controller:
    cluster_cidr: 10.42.0.0/16
    service_cluster_ip_range: 10.43.0.0/16
    extra_args:
      node-cidr-mask-size: '24'
      node-monitor-period: '5s'
      node-monitor-grace-period: '20s'
      node-startup-grace-period: '30s'
      pod-eviction-timeout: '1m'
      concurrent-deployment-syncs: 5
      concurrent-endpoint-syncs: 5
      concurrent-gc-syncs: 20
      concurrent-namespace-syncs: 10
      concurrent-replicaset-syncs: 5
      concurrent-service-syncs: 1
      concurrent-serviceaccount-token-syncs: 5
      deployment-controller-sync-period: 30s
      pvclaimbinder-sync-period: 15s
      kube-api-burst: 200
      kube-api-qps: 200
      cluster-signing-cert-file: "/etc/kubernetes/ssl/kube-ca.pem"
      cluster-signing-key-file: "/etc/kubernetes/ssl/kube-ca-key.pem"
    extra_binds:
      - "/etc/localtime:/etc/localtime"

  scheduler:
    image: ""
    extra_args: {}
    extra_binds:
      - "/etc/localtime:/etc/localtime"
    extra_env: []

  kubelet:
    cluster_domain: cluster.local
    cluster_dns_server: 10.43.0.10
    generate_serving_certificate: true
    extra_args:
      pod-infra-container-image: 'rancher/pause:3.1'
      network-plugin-mtu: '1500'
      max-pods: "250"
      sync-frequency: '3s'
      max-open-files: '2000000'
      kube-api-burst: '200'
      kube-api-qps: '200'
      enforce-node-allocatable: 'pods'
#      runtime-cgroups: '/system.slice'
#      kubelet-cgroups: '/system.slice'
#      system-reserved: 'cpu=0.1,memory=500Mi,ephemeral-storage=2Gi'
#      system-reserved-cgroup: /systemd/system.slice
#      kube-reserved: 'cpu=0.1,memory=100Mi,ephemeral-storage=2Gi'
#      kube-reserved-cgroup: /runtime.service
#      eviction-soft: "memory.available<500Mi,nodefs.available<10%,imagefs.available<10%,nodefs.inodesFree<10%"
#      eviction-soft-grace-period: "memory.available=1m30s,nodefs.available=1m30s,imagefs.available=1m30s,nodefs.inodesFree=1m30s"
#      eviction-max-pod-grace-period: "30"
#      eviction-pressure-transition-period: "30s"
    extra_binds:
      - "/etc/localtime:/etc/localtime"

  kubeproxy:
    extra_args:
      proxy-mode: ipvs
    extra_binds:
      - "/lib/modules:/lib/modules:ro"
      - "/etc/localtime:/etc/localtime"

重现步骤:

rke up
docker logs -f --tail 30 kubelet

结果:

E0508 17:23:11.220385   54992 summary_sys_containers.go:47] Failed to get system container stats for "/../docker.service": failed to get cgroup stats for "/../docker.service": failed to get container info for "/../docker.service": unknown container "/../docker.service"

Ubuntu 22.04 刚刚发布不久,还需要一段时间才能对其进行兼容。
目前官方的support-matrix还没宣称对它的支持:Support matrix | SUSE

请耐心等待。

最新版的 rke 也不支持吗,rke2支持吗

rke2 的安装要求可参考:https://docs.rke2.io/install/requirements/

至于新版的 rke 是否支持,不确定,因为我们没做过太多适配的测试。而且,你的问题是 K8s kubelet 的配置问题,如果 K8s 能部署在你的系统上,理论上,rke 问题也不大。