Use control-plane label for nodeSelector and Tolerations

Upstream has deprecated 'node-role.kubernetes.io/master'
to use 'node-role.kubernetes.io/control-plane' in k8s 1.24.

Platform and applications need to be updated to use 'control-plane'
with nodeSelector/Tolerations so we may upgrade from 'master'.

This updates pod nodeSelector to use
'node-role.kubernetes.io/control-plane' instead of
'node-role.kubernetes.io/master'.

This updates pod Tolerations to support both:
- 'node-role.kubernetes.io/master'
- 'node-role.kubernetes.io/control-plane'

Test Plan:
Apply both taints to controller nodes
PASS: Perform all application lifecycle actions:
      upload/apply/remove/delete.
PASS: Ensure that pods are running on the controller nodes.

Story: 2010301
Task: 46675

Signed-off-by: Sachin Gopala Krishna <saching.krishna@windriver.com>
Change-Id: Ie6f951021e0c82310b4a63a095412efc9f6385eb
This commit is contained in:
Sachin Gopala Krishna 2022-10-28 06:46:39 -04:00 committed by Saba Touheed Mujawar
parent 039ab18be9
commit dc401f5290
3 changed files with 33 additions and 20 deletions

View File

@ -1,26 +1,30 @@
From 8901108acc3b364c9121481f9556acbf2e4edb6d Mon Sep 17 00:00:00 2001
From: Rafael Camargos <RafaelLucas.Camargos@windriver.com>
Date: Mon, 27 Sep 2021 22:31:26 -0300
From 6951585d3ee91cf0c7ebcf65fd86293515523875 Mon Sep 17 00:00:00 2001
From: Sachin Gopala Krishna <saching.krishna@windriver.com>
Date: Fri, 28 Oct 2022 05:45:20 -0400
Subject: [PATCH] Add toleration to daemonset
---
charts/ingress-nginx/templates/controller-daemonset.yaml | 4 ++++
1 file changed, 4 insertions(+)
charts/ingress-nginx/templates/controller-daemonset.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/charts/ingress-nginx/templates/controller-daemonset.yaml b/charts/ingress-nginx/templates/controller-daemonset.yaml
index aa8693b47..6df0a9809 100644
index 365a3cea7..0fc84dbb2 100644
--- a/charts/ingress-nginx/templates/controller-daemonset.yaml
+++ b/charts/ingress-nginx/templates/controller-daemonset.yaml
@@ -61,6 +61,10 @@ spec:
@@ -68,6 +68,13 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
+ tolerations:
+ - key: "node-role.kubernetes.io/master"
+ operator: "Exists"
+ effect: "NoSchedule"
+ - key: "node-role.kubernetes.io/control-plane"
+ operator: "Exists"
+ effect: "NoSchedule"
containers:
- name: controller
- name: {{ .Values.controller.containerName }}
{{- with .Values.controller.image }}
--
2.17.1
--
2.25.1

View File

@ -1,14 +1,17 @@
From 0a23a0fc3a232ae4e50f89d8ddcce1007063c334 Fri Feb 18 23:06:07 2022
Author: Rei Oliveira <Reinildes.JoseMateusOliveira@windriver.com>
Date: Fri Feb 18 23:06:07 2022 -0300
From 93680e0483c66d50de2bd248f5f499e86ce0bbf9 Mon Sep 17 00:00:00 2001
From: Sachin Gopala Krishna <saching.krishna@windriver.com>
Date: Fri, 28 Oct 2022 06:32:04 -0400
Subject: [PATCH] Add toleration to daemonset
---
charts/ingress-nginx/values.yaml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml
index 93096dd..f79d4b3 100644
index 93096dda1..f13b4f534 100644
--- a/charts/ingress-nginx/values.yaml
+++ b/charts/ingress-nginx/values.yaml
@@ -207,12 +207,17 @@ controller:
@@ -207,12 +207,20 @@ controller:
# -- Node tolerations for server scheduling to nodes with taints
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
@ -18,15 +21,18 @@ index 93096dd..f79d4b3 100644
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
+ tolerations:
+ - key: "node-role.kubernetes.io/master"
+ operator: "Exists"
+ effect: "NoSchedule"
+ - key: "node-role.kubernetes.io/control-plane"
+ operator: "Exists"
+ effect: "NoSchedule"
+
# -- Affinity and anti-affinity rules for server scheduling to nodes
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
--
2.17.1
--
2.25.1

View File

@ -15,7 +15,7 @@ controller:
daemonset:
useHostPort: false
nodeSelector:
node-role.kubernetes.io/master: ""
node-role.kubernetes.io/control-plane: ""
config:
# https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/
nginx-status-ipv4-whitelist: 0.0.0.0/0
@ -46,6 +46,9 @@ controller:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
createSecretJob:
resources:
requests:
@ -66,7 +69,7 @@ defaultBackend:
repository: k8s.gcr.io/defaultbackend-amd64
tag: "1.5"
nodeSelector:
node-role.kubernetes.io/master: ""
node-role.kubernetes.io/control-plane: ""
service:
type: ""
resources: