mirror of https://github.com/easzlab/kubeasz.git
fix: kubelet 1.15 删除参数--allow-privileged
parent
846f81668e
commit
ccb5686e82
|
@ -76,6 +76,22 @@
|
|||
set_fact: CLUSTER_DNS_SVC_IP={{ DNS_SVC_IP.stdout }}
|
||||
tags: restart_node
|
||||
|
||||
# 判断 kubernetes 版本
|
||||
- name: 注册变量 TMP_VER
|
||||
shell: "{{ base_dir }}/bin/kubelet --version|cut -d' ' -f2|cut -d'v' -f2"
|
||||
register: TMP_VER
|
||||
connection: local
|
||||
run_once: true
|
||||
tags: restart_node
|
||||
|
||||
- name: 获取 kubernetes 主版本号
|
||||
set_fact:
|
||||
KUBE_VER: "{{ TMP_VER.stdout.split('.')[0]|int + TMP_VER.stdout.split('.')[1]|int/100 }}"
|
||||
tags: restart_node
|
||||
|
||||
- name: debug info
|
||||
debug: var="KUBE_VER"
|
||||
|
||||
- name: 创建kubelet的systemd unit文件
|
||||
template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service
|
||||
tags: restart_node
|
||||
|
|
|
@ -12,7 +12,9 @@ ExecStartPre=/bin/mkdir -p /sys/fs/cgroup/pids/system.slice/kubelet.service
|
|||
{% endif %}
|
||||
ExecStart={{ bin_dir }}/kubelet \
|
||||
--address={{ inventory_hostname }} \
|
||||
{% if KUBE_VER|float < 1.15 %}
|
||||
--allow-privileged=true \
|
||||
{% endif %}
|
||||
--anonymous-auth=false \
|
||||
--authentication-token-webhook \
|
||||
--authorization-mode=Webhook \
|
||||
|
|
Loading…
Reference in New Issue