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.

94 lines
3.4 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: kubernetes/node-taint, tags: node-taint }
  46. - { role: network_plugin, tags: network }
  47. - { role: kubernetes-apps/kubelet-csr-approver, tags: kubelet-csr-approver }
  48. - name: Install Calico Route Reflector
  49. hosts: calico_rr
  50. gather_facts: False
  51. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  52. environment: "{{ proxy_disable_env }}"
  53. roles:
  54. - { role: kubespray-defaults }
  55. - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
  56. - name: Patch Kubernetes for Windows
  57. hosts: kube_control_plane[0]
  58. gather_facts: False
  59. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  60. environment: "{{ proxy_disable_env }}"
  61. roles:
  62. - { role: kubespray-defaults }
  63. - { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
  64. - name: Install Kubernetes apps
  65. hosts: kube_control_plane
  66. gather_facts: False
  67. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  68. environment: "{{ proxy_disable_env }}"
  69. roles:
  70. - { role: kubespray-defaults }
  71. - { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
  72. - { role: kubernetes-apps/network_plugin, tags: network }
  73. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  74. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  75. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  76. - { role: kubernetes-apps, tags: apps }
  77. - name: Apply resolv.conf changes now that cluster DNS is up
  78. hosts: k8s_cluster
  79. gather_facts: False
  80. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  81. environment: "{{ proxy_disable_env }}"
  82. roles:
  83. - { role: kubespray-defaults }
  84. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }