From ed5a90e41e12dc047f857da07b4cf86873ad3d6f Mon Sep 17 00:00:00 2001 From: Sarah Alsmiller Date: Tue, 25 Oct 2022 16:23:51 -0500 Subject: [PATCH 01/11] add tolerations support --- .../templates/api-gateway-controller-deployment.yaml | 4 ++++ .../consul/templates/api-gateway-gatewayclassconfig.yaml | 6 +++++- charts/consul/values.yaml | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/charts/consul/templates/api-gateway-controller-deployment.yaml b/charts/consul/templates/api-gateway-controller-deployment.yaml index a611fdd2d3..eb06ce64e0 100644 --- a/charts/consul/templates/api-gateway-controller-deployment.yaml +++ b/charts/consul/templates/api-gateway-controller-deployment.yaml @@ -237,4 +237,8 @@ spec: nodeSelector: {{ tpl .Values.apiGateway.controller.nodeSelector . | indent 8 | trim }} {{- end }} + { { - if .Values.apiGateway.controller.tolerations } } + tolerations: + { { tpl .Values.apiGateway.controller.tolerations . | indent 8 | trim } } + { { - end } } {{- end }} diff --git a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml index 6394671528..a288ab8e10 100644 --- a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml +++ b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml @@ -35,10 +35,14 @@ spec: image: consulAPIGateway: {{ .Values.apiGateway.image }} envoy: {{ .Values.global.imageEnvoy }} - {{- if .Values.apiGateway.nodeSelector }} + {{- if .Values.apiGateway.managedGatewayClass.nodeSelector }} nodeSelector: {{ tpl .Values.apiGateway.managedGatewayClass.nodeSelector . | indent 4 | trim }} {{- end }} + { { - if .Values.apiGateway.managedGatewayClass.tolerations } } + tolerations: + { { tpl .Values.apiGateway.managedGatewayClass.tolerations . | indent 4 | trim } } + { { - end } } {{- if .Values.apiGateway.managedGatewayClass.copyAnnotations.service }} copyAnnotations: service: diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index fa2006adf8..1818d70a42 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2925,6 +2925,11 @@ apiGateway: # @type: string nodeSelector: null + # This value defines the tolerations that will be assigned to a gateway pod + # This should be a multi-line string matching the + # Tolerations (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec. + tolerations: null + # This value defines the type of service created for gateways (e.g. LoadBalancer, ClusterIP) serviceType: LoadBalancer @@ -3007,6 +3012,10 @@ apiGateway: # @type: string nodeSelector: null + # This value defines the tolerations for api-gateway-controller pod, this should be a multi-line string matching the + # Tolerations (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec. + tolerations: null + # Configuration for the Service created for the api-gateway-controller service: # Annotations to apply to the api-gateway-controller service. From ae7c41bef2b1e6fda455333af9c9ce46d85c86cd Mon Sep 17 00:00:00 2001 From: Sarah Alsmiller Date: Tue, 25 Oct 2022 16:35:25 -0500 Subject: [PATCH 02/11] include type in values.yaml --- charts/consul/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index 1818d70a42..b99afbad50 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2928,6 +2928,8 @@ apiGateway: # This value defines the tolerations that will be assigned to a gateway pod # This should be a multi-line string matching the # Tolerations (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec. + # + # @type: string tolerations: null # This value defines the type of service created for gateways (e.g. LoadBalancer, ClusterIP) @@ -3014,6 +3016,8 @@ apiGateway: # This value defines the tolerations for api-gateway-controller pod, this should be a multi-line string matching the # Tolerations (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec. + # + # @type: string tolerations: null # Configuration for the Service created for the api-gateway-controller From c00f778bdb663c5db8696219b6f0b1cad144cefc Mon Sep 17 00:00:00 2001 From: Sarah Alsmiller Date: Tue, 25 Oct 2022 16:39:33 -0500 Subject: [PATCH 03/11] update change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbbc2bf5b2..d8b4d83e0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ IMPROVEMENTS: * Remove deprecated annotation `service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"` in the `server-service` template. [[GH-1619](https://github.com/hashicorp/consul-k8s/pull/1619)] * Support `minAvailable` on connect injector `PodDisruptionBudget`. [[GH-1557](https://github.com/hashicorp/consul-k8s/pull/1557)] * Add `tolerations` and `nodeSelector` to Server ACL init jobs and `nodeSelector` to Webhook cert manager. [[GH-1581](https://github.com/hashicorp/consul-k8s/pull/1581)] + * API Gateway: Add `tolerations` to `apiGateway.managedGatewayClass` and `apiGateway.controller` [[GH-1650](https://github.com/hashicorp/consul-k8s/pull/1650)] * Control plane * Support merged metrics with consul-dataplane. [[GH-1635](https://github.com/hashicorp/consul-k8s/pull/1635)] From 0768b3f8f60d6da9a8502ab5e02f7aef96712c56 Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:29:53 -0500 Subject: [PATCH 04/11] Update charts/consul/templates/api-gateway-gatewayclassconfig.yaml --- charts/consul/templates/api-gateway-gatewayclassconfig.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml index a288ab8e10..8a2add8684 100644 --- a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml +++ b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml @@ -39,7 +39,7 @@ spec: nodeSelector: {{ tpl .Values.apiGateway.managedGatewayClass.nodeSelector . | indent 4 | trim }} {{- end }} - { { - if .Values.apiGateway.managedGatewayClass.tolerations } } + {{ - if .Values.apiGateway.managedGatewayClass.tolerations }} tolerations: { { tpl .Values.apiGateway.managedGatewayClass.tolerations . | indent 4 | trim } } { { - end } } From 1d7de5de0e77425181ab68a337fbca7cb9c8b220 Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:30:44 -0500 Subject: [PATCH 05/11] Update charts/consul/templates/api-gateway-controller-deployment.yaml --- charts/consul/templates/api-gateway-controller-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/templates/api-gateway-controller-deployment.yaml b/charts/consul/templates/api-gateway-controller-deployment.yaml index eb06ce64e0..151739e5ee 100644 --- a/charts/consul/templates/api-gateway-controller-deployment.yaml +++ b/charts/consul/templates/api-gateway-controller-deployment.yaml @@ -237,7 +237,7 @@ spec: nodeSelector: {{ tpl .Values.apiGateway.controller.nodeSelector . | indent 8 | trim }} {{- end }} - { { - if .Values.apiGateway.controller.tolerations } } + {{ - if .Values.apiGateway.controller.tolerations }} tolerations: { { tpl .Values.apiGateway.controller.tolerations . | indent 8 | trim } } { { - end } } From 4abbebdf4c4eb5f4d2497f6d5498f7aea166d4cb Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:31:16 -0500 Subject: [PATCH 06/11] Update api-gateway-controller-deployment.yaml --- .../consul/templates/api-gateway-controller-deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/consul/templates/api-gateway-controller-deployment.yaml b/charts/consul/templates/api-gateway-controller-deployment.yaml index 151739e5ee..e10dee34bc 100644 --- a/charts/consul/templates/api-gateway-controller-deployment.yaml +++ b/charts/consul/templates/api-gateway-controller-deployment.yaml @@ -239,6 +239,6 @@ spec: {{- end }} {{ - if .Values.apiGateway.controller.tolerations }} tolerations: - { { tpl .Values.apiGateway.controller.tolerations . | indent 8 | trim } } - { { - end } } + {{ tpl .Values.apiGateway.controller.tolerations . | indent 8 | trim }} + {{ - end }} {{- end }} From 71f56d8e618908ec22c72eb6a6ca8a3b802075cb Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:31:45 -0500 Subject: [PATCH 07/11] Update api-gateway-gatewayclassconfig.yaml --- charts/consul/templates/api-gateway-gatewayclassconfig.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml index 8a2add8684..886514c922 100644 --- a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml +++ b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml @@ -41,8 +41,8 @@ spec: {{- end }} {{ - if .Values.apiGateway.managedGatewayClass.tolerations }} tolerations: - { { tpl .Values.apiGateway.managedGatewayClass.tolerations . | indent 4 | trim } } - { { - end } } + {{ tpl .Values.apiGateway.managedGatewayClass.tolerations . | indent 4 | trim }} + {{ - end }} {{- if .Values.apiGateway.managedGatewayClass.copyAnnotations.service }} copyAnnotations: service: From 11f36d94be935f3ad007c4edaeb36bdedad5a7f6 Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:33:59 -0500 Subject: [PATCH 08/11] Update charts/consul/templates/api-gateway-controller-deployment.yaml Co-authored-by: Ashwin Venkatesh --- .../consul/templates/api-gateway-controller-deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/consul/templates/api-gateway-controller-deployment.yaml b/charts/consul/templates/api-gateway-controller-deployment.yaml index e10dee34bc..0a41101e7d 100644 --- a/charts/consul/templates/api-gateway-controller-deployment.yaml +++ b/charts/consul/templates/api-gateway-controller-deployment.yaml @@ -237,8 +237,8 @@ spec: nodeSelector: {{ tpl .Values.apiGateway.controller.nodeSelector . | indent 8 | trim }} {{- end }} - {{ - if .Values.apiGateway.controller.tolerations }} + {{- if .Values.apiGateway.controller.tolerations }} tolerations: {{ tpl .Values.apiGateway.controller.tolerations . | indent 8 | trim }} - {{ - end }} + {{- end }} {{- end }} From a784247b81e349291c12ee732f7a5c6906a514f5 Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:45:09 -0500 Subject: [PATCH 09/11] Update api-gateway-gatewayclassconfig.yaml --- charts/consul/templates/api-gateway-gatewayclassconfig.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml index 886514c922..e80474a34c 100644 --- a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml +++ b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml @@ -39,7 +39,7 @@ spec: nodeSelector: {{ tpl .Values.apiGateway.managedGatewayClass.nodeSelector . | indent 4 | trim }} {{- end }} - {{ - if .Values.apiGateway.managedGatewayClass.tolerations }} + {{- if .Values.apiGateway.managedGatewayClass.tolerations }} tolerations: {{ tpl .Values.apiGateway.managedGatewayClass.tolerations . | indent 4 | trim }} {{ - end }} From 5215c5c57f739cba9559e0972593d69f564d6e70 Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:46:41 -0500 Subject: [PATCH 10/11] Update api-gateway-gatewayclassconfig.yaml --- charts/consul/templates/api-gateway-gatewayclassconfig.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml index e80474a34c..450357a773 100644 --- a/charts/consul/templates/api-gateway-gatewayclassconfig.yaml +++ b/charts/consul/templates/api-gateway-gatewayclassconfig.yaml @@ -42,7 +42,7 @@ spec: {{- if .Values.apiGateway.managedGatewayClass.tolerations }} tolerations: {{ tpl .Values.apiGateway.managedGatewayClass.tolerations . | indent 4 | trim }} - {{ - end }} + {{- end }} {{- if .Values.apiGateway.managedGatewayClass.copyAnnotations.service }} copyAnnotations: service: From cba28d5dd1d89ca7ad77db3775c645ede8e3c710 Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Tue, 1 Nov 2022 14:34:42 -0500 Subject: [PATCH 11/11] Update charts/consul/values.yaml Co-authored-by: John Murret --- charts/consul/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index d5741712f1..28c8fc5990 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2897,7 +2897,7 @@ apiGateway: # @type: string nodeSelector: null - # This value defines the tolerations that will be assigned to a gateway pod + # This value defines the tolerations that will be assigned to a gateway pod. # This should be a multi-line string matching the # Tolerations (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec. #