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.

63 lines
1.4 KiB

9 years ago
  1. ---
  2. - set_fact:
  3. standalone_kubelet: >-
  4. {%- if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] -%}true{%- else -%}false{%- endif -%}
  5. tags: facts
  6. - include: pre_upgrade.yml
  7. tags: kubelet
  8. - name: Ensure /var/lib/cni exists
  9. file:
  10. path: /var/lib/cni
  11. state: directory
  12. mode: 0755
  13. - include: install.yml
  14. tags: kubelet
  15. - include: nginx-proxy.yml
  16. when: is_kube_master == false and loadbalancer_apiserver_localhost|default(true)
  17. tags: nginx
  18. - name: Write kubelet config file
  19. template:
  20. src: kubelet.j2
  21. dest: "{{ kube_config_dir }}/kubelet.env"
  22. backup: yes
  23. notify: restart kubelet
  24. tags: kubelet
  25. - name: write the kubecfg (auth) file for kubelet
  26. template:
  27. src: node-kubeconfig.yaml.j2
  28. dest: "{{ kube_config_dir }}/node-kubeconfig.yaml"
  29. backup: yes
  30. notify: restart kubelet
  31. tags: kubelet
  32. - name: Ensure nodePort range is reserved
  33. sysctl:
  34. name: net.ipv4.ip_local_reserved_ports
  35. value: "{{ kube_apiserver_node_port_range }}"
  36. sysctl_set: yes
  37. state: present
  38. reload: yes
  39. when: kube_apiserver_node_port_range is defined
  40. tags: kube-proxy
  41. - name: Write proxy manifest
  42. template:
  43. src: manifests/kube-proxy.manifest.j2
  44. dest: "{{ kube_manifest_dir }}/kube-proxy.manifest"
  45. tags: kube-proxy
  46. # reload-systemd
  47. - meta: flush_handlers
  48. - name: Enable kubelet
  49. service:
  50. name: kubelet
  51. enabled: yes
  52. state: started
  53. tags: kubelet