|
1 | 1 | kind: Cluster |
2 | 2 | name: {{ kind_cluster_name }} |
3 | 3 | apiVersion: kind.x-k8s.io/v1alpha4 |
4 | | -{% if feature_gates is defined %} |
| 4 | +{% if feature_gates is defined %} |
5 | 5 | featureGates: |
6 | | -{% for gate, enabled in feature_gates.items() %} |
| 6 | +{% for gate, enabled in feature_gates.items() %} |
7 | 7 | {{ gate }}: {{ enabled }} |
8 | | -{% endfor %} |
9 | | -{% endif %} |
| 8 | +{% endfor %} |
| 9 | +{% endif %} |
10 | 10 | networking: |
11 | 11 | {% if api_server_address is defined %} |
12 | 12 | apiServerAddress: '{{ api_server_address }}' |
| 13 | +{% endif %} |
| 14 | +{% if api_server_port is defined %} |
| 15 | + apiServerPort: {{ api_server_port }} |
13 | 16 | {% endif %} |
14 | 17 | disableDefaultCNI: {{ disableDefaultCNI | default(false) }} |
15 | 18 | kubeProxyMode: {{ kubeProxyMode | default("none") }} |
16 | 19 | nodes: |
17 | | -{% for i in range(count_controlplane_nodes | int) %} |
| 20 | +{% for i in range(count_controlplane_nodes | int) %} |
18 | 21 | - role: control-plane |
19 | 22 | image: kindest/node:v{{ kubectl_version }} |
20 | | -{% if enable_ingress_ports or custom_control_plane_ports %} |
21 | | -{% if node_labels is defined %} |
| 23 | +{% if enable_ingress_ports or custom_control_plane_ports %} |
| 24 | +{% if node_labels is defined %} |
22 | 25 | kubeadmConfigPatches: |
23 | 26 | - | |
24 | 27 | kind: InitConfiguration |
25 | 28 | nodeRegistration: |
26 | 29 | kubeletExtraArgs: |
27 | 30 | node-labels: {{ node_labels }} |
28 | | -{% endif %} |
| 31 | +{% endif %} |
29 | 32 | extraPortMappings: |
30 | | -{% if custom_control_plane_ports is defined %} |
31 | | -{% for port_mapping in custom_control_plane_ports %} |
| 33 | +{% if custom_control_plane_ports is defined %} |
| 34 | +{% for port_mapping in custom_control_plane_ports %} |
| 35 | +{% if port_mapping.containerPort != 6443 %} |
32 | 36 | - containerPort: {{ port_mapping.containerPort }} |
33 | 37 | hostPort: {{ port_mapping.hostPort }} |
34 | | -{% if port_mapping.protocol is defined %} |
| 38 | +{% if port_mapping.protocol is defined %} |
35 | 39 | protocol: {{ port_mapping.protocol }} |
36 | | -{% endif %} |
37 | | -{% endfor %} |
38 | | -{% elif enable_ingress_ports is defined %} |
| 40 | +{% endif %} |
| 41 | +{% endif %} |
| 42 | +{% endfor %} |
| 43 | +{% elif enable_ingress_ports is defined %} |
39 | 44 | - containerPort: 80 |
40 | 45 | hostPort: 80 |
41 | 46 | protocol: TCP |
42 | 47 | - containerPort: 443 |
43 | 48 | hostPort: 443 |
44 | 49 | protocol: TCP |
45 | | -{% endif %} |
46 | | -{% endif %} |
47 | | -{% endfor %} |
48 | | -{% for i in range(count_worker_nodes | int) %} |
| 50 | +{% endif %} |
| 51 | +{% endif %} |
| 52 | +{% endfor %} |
| 53 | +{% for i in range(count_worker_nodes | int) %} |
49 | 54 | - role: worker |
50 | 55 | image: kindest/node:v{{ kubectl_version }} |
51 | | -{% if enable_host_paths %} |
| 56 | +{% if enable_host_paths %} |
52 | 57 | extraMounts: |
53 | | -{% if worker_node_mounts and worker_node_mounts[i] is defined %} |
54 | | -{% for mount in worker_node_mounts[i] %} |
| 58 | +{% if worker_node_mounts and worker_node_mounts[i] is defined %} |
| 59 | +{% for mount in worker_node_mounts[i] %} |
55 | 60 | - hostPath: {{ mount.hostPath }} |
56 | 61 | containerPath: {{ mount.containerPath }} |
57 | | -{% endfor %} |
58 | | -{% else %} |
59 | | - - hostPath: /mnt/data-node{{ i + 1 }} |
| 62 | +{% endfor %} |
| 63 | +{% else %} |
| 64 | + - hostPath: /mnt/{{ kind_cluster_name }}-data-node{{ i + 1 }} |
60 | 65 | containerPath: /data |
61 | | -{% endif %} |
62 | | -{% endif %} |
63 | | -{% endfor %} |
64 | | -{% if containerd_config_patches is defined %} |
| 66 | +{% endif %} |
| 67 | +{% endif %} |
| 68 | +{% endfor %} |
| 69 | +{% if containerd_config_patches is defined %} |
65 | 70 | containerdConfigPatches: |
66 | 71 | {% for patch in containerd_config_patches %} |
67 | 72 | - |- |
68 | 73 | {{ patch | indent(4, first=True) }} |
69 | 74 | {% endfor %} |
70 | | -{% endif %} |
| 75 | +{% endif %} |
0 commit comments