easzlab / kubeasz

使用Ansible脚本安装K8S集群,介绍组件交互原理,方便直接,不受国内网络环境影响
https://github.com/easzlab/kubeasz
10.54k stars 3.53k forks source link

kubeasz版本3.1.0,执行 ezctl setup 集群 05,安装node 这一步时报错 'DOCKER_VER' is undifined #1327

Closed whenandwhy closed 11 months ago

whenandwhy commented 1 year ago

What would you like to be added?

整个集群六台服务器,执行setup 05 master没问题worker node报错 (TASK [kube-node : 创建kubelet的配置文件] ** fatal: [XX.XX.XX.94]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: {%- if CONTAINER_RUNTIME == 'containerd' -%} systemd {%- else -%} {%- if DOCKER_VER|float >= 20.10 -%} systemd {%- else -%} cgroupfs {%- endif -%} {%- endif -%}: 'DOCKER_VER' is undefined"} fatal: [XX.XX.XX.95]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: {%- if CONTAINER_RUNTIME == 'containerd' -%} systemd {%- else -%} {%- if DOCKER_VER|float >= 20.10 -%} systemd {%- else -%} cgroupfs {%- endif -%} {%- endif -%}: 'DOCKER_VER' is undefined"} fatal: [XX.XX.XX.96]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: {%- if CONTAINER_RUNTIME == 'containerd' -%} systemd {%- else -%} {%- if DOCKER_VER|float >= 20.10 -%} systemd {%- else -%} cgroupfs {%- endif -%} {%- endif -%}: 'DOCKER_VER' is undefined"})

其中hosts文件配置如下

'etcd' cluster should have odd member(s) (1,3,5,...)

[etcd] XX.XX.XX.91 XX.XX.XX.92 XX.XX.XX.93

master node(s)

[kube_master] XX.XX.XX.91 XX.XX.XX.92 XX.XX.XX.93

work node(s)

[kube_node] XX.XX.XX.91 XX.XX.XX.92 XX.XX.XX.93 XX.XX.XX.94 XX.XX.XX.95 XX.XX.XX.96

Why is this needed?

求高手解答

gjmzj commented 1 year ago

之前老版本kubelet使用docker 运行时 cgroups 支持 systemd 不好,目前主流都使用containerd 运行时, 把 /root/repo/kubeasz/roles/kube-node/vars/main.yml 变量改成如下就好

CGROUP_DRIVER: "systemd"

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

whenandwhy commented 11 months ago

之前老版本kubelet使用docker 运行时 cgroups 支持 systemd 不好,目前主流都使用containerd 运行时, 把 /root/repo/kubeasz/roles/kube-node/vars/main.yml 变量改成如下就好

CGROUP_DRIVER: "systemd"

已解决,感谢高手解答