You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.4 KiB

  1. ---
  2. - name: Make sure dynamic kubelet configuration directory is writeable
  3. file:
  4. path: "{{ dynamic_kubelet_configuration_dir }}"
  5. mode: 0600
  6. state: directory
  7. when: dynamic_kubelet_configuration
  8. - name: Get the kubeadm version
  9. command: "{{ bin_dir }}/kubeadm version -o short"
  10. register: kubeadm_output
  11. changed_when: false
  12. - name: Set kubelet api version to v1beta1
  13. set_fact:
  14. kubeletConfig_api_version: v1beta1
  15. tags:
  16. - kubelet
  17. - kubeadm
  18. - name: Write kubelet environment config file (kubeadm)
  19. template:
  20. src: "kubelet.env.{{ kubeletConfig_api_version }}.j2"
  21. dest: "{{ kube_config_dir }}/kubelet.env"
  22. backup: yes
  23. notify: Node | restart kubelet
  24. tags:
  25. - kubelet
  26. - kubeadm
  27. - name: Write kubelet config file
  28. template:
  29. src: "kubelet-config.{{ kubeletConfig_api_version }}.yaml.j2"
  30. dest: "{{ kube_config_dir }}/kubelet-config.yaml"
  31. notify: Kubelet | restart kubelet
  32. tags:
  33. - kubelet
  34. - kubeadm
  35. - name: Write kubelet systemd init file
  36. template:
  37. src: "kubelet.service.j2"
  38. dest: "/etc/systemd/system/kubelet.service"
  39. backup: "yes"
  40. notify: Node | restart kubelet
  41. tags:
  42. - kubelet
  43. - kubeadm
  44. - name: flush_handlers and reload-systemd
  45. meta: flush_handlers
  46. - name: Enable kubelet
  47. service:
  48. name: kubelet
  49. enabled: yes
  50. state: started
  51. tags:
  52. - kubelet
  53. notify: Kubelet | restart kubelet