mirror of https://github.com/easzlab/kubeasz.git
fix: kubelet 1.15 删除参数--allow-privileged
parent
f50779bade
commit
1a7deaf9ad
|
@ -99,6 +99,21 @@
|
|||
set_fact: CLUSTER_DNS_SVC_IP={{ DNS_SVC_IP.stdout }}
|
||||
tags: restart_node
|
||||
|
||||
# 判断 kubernetes 版本
|
||||
- name: 注册变量 TMP_VER
|
||||
shell: "{{ base_dir }}/bin/kube-apiserver --version|cut -d' ' -f2|cut -d'v' -f2"
|
||||
register: TMP_VER
|
||||
connection: local
|
||||
tags: upgrade_k8s, restart_node
|
||||
|
||||
- name: 获取 kubernetes 主版本号
|
||||
set_fact:
|
||||
KUBE_VER: "{{ TMP_VER.stdout.split('.')[0]|int + TMP_VER.stdout.split('.')[1]|int/100 }}"
|
||||
tags: upgrade_k8s, 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: upgrade_k8s, 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.13 %}
|
||||
--allow-privileged=true \
|
||||
{% endif %}
|
||||
--anonymous-auth=false \
|
||||
--authentication-token-webhook \
|
||||
--authorization-mode=Webhook \
|
||||
|
|
Loading…
Reference in New Issue