2019-05-09 04:38:36 +08:00
|
|
|
---
|
2020-06-16 15:24:03 +08:00
|
|
|
- name: Set kubelet api version to v1beta1
|
2019-05-09 04:38:36 +08:00
|
|
|
set_fact:
|
2020-05-08 15:45:43 +08:00
|
|
|
kubeletConfig_api_version: v1beta1
|
2019-05-09 04:38:36 +08:00
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
|
|
|
- name: Write kubelet environment config file (kubeadm)
|
|
|
|
template:
|
2020-05-08 15:45:43 +08:00
|
|
|
src: "kubelet.env.{{ kubeletConfig_api_version }}.j2"
|
2019-05-09 04:38:36 +08:00
|
|
|
dest: "{{ kube_config_dir }}/kubelet.env"
|
2021-08-28 05:20:53 +08:00
|
|
|
setype: "{{ (preinstall_selinux_state != 'disabled') | ternary('etc_t', omit) }}"
|
2019-05-09 04:38:36 +08:00
|
|
|
backup: yes
|
2023-07-24 10:24:11 +08:00
|
|
|
mode: 0600
|
2020-03-21 04:54:08 +08:00
|
|
|
notify: Node | restart kubelet
|
2019-05-09 04:38:36 +08:00
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
|
|
|
- name: Write kubelet config file
|
|
|
|
template:
|
2020-05-08 15:45:43 +08:00
|
|
|
src: "kubelet-config.{{ kubeletConfig_api_version }}.yaml.j2"
|
2019-05-09 04:38:36 +08:00
|
|
|
dest: "{{ kube_config_dir }}/kubelet-config.yaml"
|
2023-07-24 10:24:11 +08:00
|
|
|
mode: 0600
|
2020-05-20 01:13:37 +08:00
|
|
|
notify: Kubelet | restart kubelet
|
2019-05-09 04:38:36 +08:00
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
|
|
|
- name: Write kubelet systemd init file
|
|
|
|
template:
|
|
|
|
src: "kubelet.service.j2"
|
|
|
|
dest: "/etc/systemd/system/kubelet.service"
|
|
|
|
backup: "yes"
|
2023-03-28 12:48:22 +08:00
|
|
|
mode: 0600
|
2020-03-21 04:54:08 +08:00
|
|
|
notify: Node | restart kubelet
|
2019-05-09 04:38:36 +08:00
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Flush_handlers and reload-systemd
|
2019-05-09 04:38:36 +08:00
|
|
|
meta: flush_handlers
|
|
|
|
|
|
|
|
- name: Enable kubelet
|
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
tags:
|
2019-10-02 17:21:07 +08:00
|
|
|
- kubelet
|
2020-05-20 01:13:37 +08:00
|
|
|
notify: Kubelet | restart kubelet
|