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.

93 lines
3.3 KiB

  1. ---
  2. - name: Common tasks for every playbooks
  3. import_playbook: boilerplate.yml
  4. - name: Gather facts
  5. import_playbook: facts.yml
  6. - name: Prepare for etcd install
  7. hosts: k8s_cluster:etcd
  8. gather_facts: False
  9. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  10. environment: "{{ proxy_disable_env }}"
  11. roles:
  12. - { role: kubespray-defaults }
  13. - { role: kubernetes/preinstall, tags: preinstall }
  14. - { role: "container-engine", tags: "container-engine", when: deploy_container_engine }
  15. - { role: download, tags: download, when: "not skip_downloads" }
  16. - name: Install etcd
  17. import_playbook: install_etcd.yml
  18. - name: Install Kubernetes nodes
  19. hosts: k8s_cluster
  20. gather_facts: False
  21. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  22. environment: "{{ proxy_disable_env }}"
  23. roles:
  24. - { role: kubespray-defaults }
  25. - { role: kubernetes/node, tags: node }
  26. - name: Install the control plane
  27. hosts: kube_control_plane
  28. gather_facts: False
  29. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  30. environment: "{{ proxy_disable_env }}"
  31. roles:
  32. - { role: kubespray-defaults }
  33. - { role: kubernetes/control-plane, tags: master }
  34. - { role: kubernetes/client, tags: client }
  35. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  36. - name: Invoke kubeadm and install a CNI
  37. hosts: k8s_cluster
  38. gather_facts: False
  39. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  40. environment: "{{ proxy_disable_env }}"
  41. roles:
  42. - { role: kubespray-defaults }
  43. - { role: kubernetes/kubeadm, tags: kubeadm}
  44. - { role: kubernetes/node-label, tags: node-label }
  45. - { role: network_plugin, tags: network }
  46. - { role: kubernetes-apps/kubelet-csr-approver, tags: kubelet-csr-approver }
  47. - name: Install Calico Route Reflector
  48. hosts: calico_rr
  49. gather_facts: False
  50. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  51. environment: "{{ proxy_disable_env }}"
  52. roles:
  53. - { role: kubespray-defaults }
  54. - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
  55. - name: Patch Kubernetes for Windows
  56. hosts: kube_control_plane[0]
  57. gather_facts: False
  58. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  59. environment: "{{ proxy_disable_env }}"
  60. roles:
  61. - { role: kubespray-defaults }
  62. - { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
  63. - name: Install Kubernetes apps
  64. hosts: kube_control_plane
  65. gather_facts: False
  66. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  67. environment: "{{ proxy_disable_env }}"
  68. roles:
  69. - { role: kubespray-defaults }
  70. - { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
  71. - { role: kubernetes-apps/network_plugin, tags: network }
  72. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  73. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  74. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  75. - { role: kubernetes-apps, tags: apps }
  76. - name: Apply resolv.conf changes now that cluster DNS is up
  77. hosts: k8s_cluster
  78. gather_facts: False
  79. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  80. environment: "{{ proxy_disable_env }}"
  81. roles:
  82. - { role: kubespray-defaults }
  83. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }