-
Notifications
You must be signed in to change notification settings - Fork 76
/
00_pre_flight_checklist.yml
75 lines (66 loc) · 3.07 KB
/
00_pre_flight_checklist.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
- name: Pre-flight checklist before installing k8s
hosts: vm_host
vars_files:
- vars/k8s_cluster.yml
tasks:
- name: Check if kubernetes version is supported by the provisioner
ansible.builtin.fail:
msg: The chosen version is not supported, only versions >= 1.26 are supported
when: k8s.cluster_version is version('1.28', '<')
- name: Check if distribution is supported
ansible.builtin.fail:
msg: Your distribution is actually unsupported. Supported values are 'Fedora', 'CentOS', 'Ubuntu'
when:
- ansible_distribution != 'CentOS'
- ansible_distribution != 'Fedora'
- ansible_distribution != 'Ubuntu'
- name: Check if target distribution is correct
ansible.builtin.fail:
msg: Target distribution is not supported. Supported values are 'Ubuntu', 'CentOS'
when:
- k8s.cluster_os != 'CentOS'
- k8s.cluster_os != 'Ubuntu'
# - name: Check if cri-o is selected on 1.29
# ansible.builtin.fail:
# msg: Please select a different container runtime as cri-o packages are not yet available for {{ k8s.cluster_version }} and {{ k8s.cluster_os }}
# when:
# - k8s.container_runtime == 'crio'
# - k8s.cluster_version is version('1.29', '==')
# # - k8s.cluster_os == 'CentOS'
- name: Check at least one vm for control plane is defined
ansible.builtin.fail:
msg: At least one control plane should be selected
when:
- k8s.control_plane.vms is not defined or k8s.control_plane.vms <= 0
- name: Check if master is schedulable in case of clusters composed by control plane VMs
ansible.builtin.fail:
msg: When provisioning a cluster without workers, you need to set k8s.master_schedulable to true in vars.
when:
- k8s.worker_nodes.vms is not defined or k8s.worker_nodes.vms <= 0
- not k8s.master_schedulable
- name: Fail fast if Rook cluster size exceeds worker nodes.
ansible.builtin.fail:
msg: You can't have less worker nodes than Rook cluster size
when:
- k8s.worker_nodes.vms < rook_ceph.rook_cluster_size
- rook_ceph.install_rook
- name: Fail fast if no container runtime is defined
ansible.builtin.fail:
msg: Select at least container runtime, 'containerd', 'crio'
when:
- k8s.container_runtime != 'crio'
- k8s.container_runtime != 'containerd'
- name: Fail fast if no ingress controller is selected
ansible.builtin.fail:
msg: If you want to install an ingress controller, select one among 'nginx', 'haproxy' or 'contour'
when:
- ingress_controller.install_ingress_controller
- ingress_controller.type != 'nginx' and ingress_controller.type != 'haproxy' and ingress_controller.type != 'contour'
- name: Fail fast if no container plugin selected
ansible.builtin.fail:
msg: Select at least a CNI plugin 'calico' or 'flannel'
when:
- k8s.network.cni_plugin != 'calico'
- k8s.network.cni_plugin != 'flannel'
- k8s.network.cni_plugin != 'cilium'