2019-05-08 20:38:36 +00:00
|
|
|
---
|
|
|
|
- name: Make sure dynamic kubelet configuration directory is writeable
|
|
|
|
file:
|
|
|
|
path: "{{ dynamic_kubelet_configuration_dir }}"
|
|
|
|
mode: 0600
|
|
|
|
state: directory
|
|
|
|
when: dynamic_kubelet_configuration
|
|
|
|
|
|
|
|
- name: gets the kubeadm version
|
|
|
|
command: "{{ bin_dir }}/kubeadm version -o short"
|
|
|
|
register: kubeadm_output
|
|
|
|
|
2020-05-08 07:45:43 +00:00
|
|
|
- name: sets kubelet api version to v1beta1
|
2019-05-08 20:38:36 +00:00
|
|
|
set_fact:
|
2020-05-08 07:45:43 +00:00
|
|
|
kubeletConfig_api_version: v1beta1
|
2019-05-08 20:38:36 +00:00
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
|
|
|
- name: Write kubelet environment config file (kubeadm)
|
|
|
|
template:
|
2020-05-08 07:45:43 +00:00
|
|
|
src: "kubelet.env.{{ kubeletConfig_api_version }}.j2"
|
2019-05-08 20:38:36 +00:00
|
|
|
dest: "{{ kube_config_dir }}/kubelet.env"
|
|
|
|
backup: yes
|
2020-03-20 20:54:08 +00:00
|
|
|
notify: Node | restart kubelet
|
2019-05-08 20:38:36 +00:00
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
|
|
|
- name: Write kubelet config file
|
|
|
|
template:
|
2020-05-08 07:45:43 +00:00
|
|
|
src: "kubelet-config.{{ kubeletConfig_api_version }}.yaml.j2"
|
2019-05-08 20:38:36 +00:00
|
|
|
dest: "{{ kube_config_dir }}/kubelet-config.yaml"
|
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
|
|
|
- name: Write kubelet systemd init file
|
|
|
|
template:
|
|
|
|
src: "kubelet.service.j2"
|
|
|
|
dest: "/etc/systemd/system/kubelet.service"
|
|
|
|
backup: "yes"
|
2020-03-20 20:54:08 +00:00
|
|
|
notify: Node | restart kubelet
|
2019-05-08 20:38:36 +00:00
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- kubeadm
|
|
|
|
|
|
|
|
- name: flush_handlers and reload-systemd
|
|
|
|
meta: flush_handlers
|
|
|
|
|
|
|
|
- name: Enable kubelet
|
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
tags:
|
2019-10-02 09:21:07 +00:00
|
|
|
- kubelet
|