From 92abf26d2938f01178c494608f9bc5527cbdfdc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Unai=20Arr=C3=ADen?= Date: Thu, 6 Jan 2022 08:56:28 +0100 Subject: [PATCH] Ensure taint configuration for secondary control-plane nodes (#8363) --- .../templates/kubeadm-controlplane.v1beta2.yaml.j2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta2.yaml.j2 b/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta2.yaml.j2 index a03aa5f96..f73a85fe9 100644 --- a/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta2.yaml.j2 +++ b/roles/kubernetes/control-plane/templates/kubeadm-controlplane.v1beta2.yaml.j2 @@ -19,3 +19,10 @@ controlPlane: nodeRegistration: name: {{ kube_override_hostname|default(inventory_hostname) }} criSocket: {{ cri_socket }} +{% if inventory_hostname in groups['kube_control_plane'] and inventory_hostname not in groups['kube_node'] %} + taints: + - effect: NoSchedule + key: node-role.kubernetes.io/master +{% else %} + taints: [] +{% endif %} \ No newline at end of file