2023-03-27 17:25:55 +08:00
|
|
|
---
|
2023-12-05 06:24:00 +08:00
|
|
|
- name: Common tasks for every playbooks
|
|
|
|
import_playbook: boilerplate.yml
|
2023-03-27 17:25:55 +08:00
|
|
|
|
|
|
|
- name: Gather facts
|
|
|
|
import_playbook: facts.yml
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Prepare for etcd install
|
|
|
|
hosts: k8s_cluster:etcd
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: kubernetes/preinstall, tags: preinstall }
|
|
|
|
- { role: "container-engine", tags: "container-engine", when: deploy_container_engine }
|
|
|
|
- { role: download, tags: download, when: "not skip_downloads" }
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Install etcd
|
2023-12-05 06:24:00 +08:00
|
|
|
import_playbook: install_etcd.yml
|
2023-03-27 17:25:55 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Install Kubernetes nodes
|
|
|
|
hosts: k8s_cluster
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: kubernetes/node, tags: node }
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Install the control plane
|
|
|
|
hosts: kube_control_plane
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: kubernetes/control-plane, tags: master }
|
|
|
|
- { role: kubernetes/client, tags: client }
|
|
|
|
- { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Invoke kubeadm and install a CNI
|
|
|
|
hosts: k8s_cluster
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: kubernetes/kubeadm, tags: kubeadm}
|
|
|
|
- { role: kubernetes/node-label, tags: node-label }
|
2024-01-23 22:46:13 +08:00
|
|
|
- { role: kubernetes/node-taint, tags: node-taint }
|
2023-03-27 17:25:55 +08:00
|
|
|
- { role: network_plugin, tags: network }
|
2023-05-11 08:49:09 +08:00
|
|
|
- { role: kubernetes-apps/kubelet-csr-approver, tags: kubelet-csr-approver }
|
2023-03-27 17:25:55 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Install Calico Route Reflector
|
|
|
|
hosts: calico_rr
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Patch Kubernetes for Windows
|
|
|
|
hosts: kube_control_plane[0]
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Install Kubernetes apps
|
|
|
|
hosts: kube_control_plane
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
|
|
|
|
- { role: kubernetes-apps/network_plugin, tags: network }
|
|
|
|
- { role: kubernetes-apps/policy_controller, tags: policy-controller }
|
|
|
|
- { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
|
|
|
|
- { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
|
|
|
|
- { role: kubernetes-apps, tags: apps }
|
|
|
|
|
|
|
|
- name: Apply resolv.conf changes now that cluster DNS is up
|
|
|
|
hosts: k8s_cluster
|
|
|
|
gather_facts: False
|
|
|
|
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults }
|
|
|
|
- { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }
|