环境
服务联系WX:136-6258-1235
  • An RKE2 or K3s cluster with Kubernetes v1.35+
    RKE2 或 K3s 集群,使用 Kubernetes v1.35+
  • Cluster nodes with cgroup v1
    使用 cgroup v1 的集群节点
情况

In Kubernetes v1.35+, the kubelet will fail to start on nodes running with cgroup v1.
在 Kubernetes v1.35+中,运行 cgroup v1 的节点将无法启动 kubelet。

解决方案

It is possible to allow nodes to run with cgroup v1, by setting the kubelet option failCgroupV1 to false. This can be achieved in RKE2 and K3s clusters, per the following instructions.
可以通过将 kubelet 选项 failCgroupV1 设置为 false,允许节点运行 cgroup v1。这可以在 RKE2 和 K3s 集群中实现,按照以下说明。

Standalone RKE2/K3s clusters
独立 RKE2/K3s 集群

In a standalone cluster, the configuration needs to be applied per node:
在独立集群中,配置需要按节点应用:

  1. Configure the kubelet's fail-cgroupv1=false argument in the the RKE2 or K3s configuration file (/etc/rancher/rke2/config.yaml or /etc/rancher/k3s/config.yaml) per the following example:
    在 RKE2 或 K3s 配置文件(/etc/rancher/rke2/config.yaml 或 /etc/rancher/k3s/config.yaml)中配置 kubelet 的 fail-cgroupv1=false 参数,示例如下:
    <span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code>kubelet-arg:
      - "fail-cgroupv1=false"</code></span></span></span>
  2. After updating the configuration file, you will need to restart the RKE2/K3s service to apply the changes:
    更新配置文件后,您需要重启 RKE2/K3s 服务以应用以下更改:
    • On RKE2 server nodes: systemctl restart rke2-server
      在 RKE2 服务器节点上:systemctl restart rke2-server
    • On RKE2 worker nodes: systemctl restart rke2-agent
      On RKE2 worker nodes: systemctl restart rke2-agent
    • On K3s server nodes: systemctl restart k3s
      在 K3s 服务器节点上:systemctl restart k3s
    • On K3s worker nodes: systemctl restart k3s-agent
      On K3s worker nodes: systemctl restart k3s-agent

Rancher-provisioned RKE2/K3s cluster
牧场配置 RKE2/K3s 集群

In a Rancher-provisioned cluster, the configuration can be managed at the cluster-level within Rancher:
在 Rancher 配置的集群中,配置可以在 Rancher 内部的集群层级管理:

  1. Navigate to Cluster Management within the Rancher UI and click Edit Config for the relevant RKE2/K3s cluster
    在 Rancher UI 中进入集群管理  ,点击  编辑配置  以获取相关的 RKE2/K3s 集群
  2. Under Cluster Configuration click Advanced
    集群配置  中点击  高级
  3. Under For all machines, use the Kubelet args: in the section Additional Kubelet Args click Add Argument
    在 “For all machine”下,使用 Kubelet 的 args: 在 “Additional Kubelet Args ”部分 点击 “添加参数
  4. Enter fail-cgroupv1=false
    进入 fail-cgroupv1=false
  5. Click Save to apply the change 
    点击保存  以应用变更 
原因

This behaviour is the result of a change in Kubernetes v1.35, to set failCgroupV1 to true by default, per the Kubernetes v1.35 CHANGELOG.
这种行为是 Kubernetes v1.35 中根据 Kubernetes v1.35 的变更,默认将 failCgroupV1 设为 true 的结果。

更多推荐