From 9629d8fffedbb5b28b046b68c1725bddfd5794f1 Mon Sep 17 00:00:00 2001 From: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com> Date: Tue, 1 Nov 2022 15:39:44 -0500 Subject: [PATCH] Merge pull request #1650 from hashicorp/consul-api-gateway-add-tolerations-support Consul API Gateway, Add Tolerations support --- CHANGELOG.md | 1 + .../api-gateway-controller-deployment.yaml | 4 ++++ .../templates/api-gateway-gatewayclassconfig.yaml | 6 +++++- charts/consul/values.yaml | 13 +++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c225748fbf..0e1fbf53b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ IMPROVEMENTS: * Helm: * 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: Allow controller to read MeshServices for use as a route backend. [[GH-1574](https://github.com/hashicorp/consul-k8s/pull/1574)] + * API Gateway: Add `tolerations` to `apiGateway.managedGatewayClass` and `apiGateway.controller` [[GH-1650](https://github.com/hashicorp/consul-k8s/pull/1650)] * API Gateway: Create PodSecurityPolicy for controller when `global.enablePodSecurityPolicies=true`. [[GH-1656](https://github.com/hashicorp/consul-k8s/pull/1656)] ## 0.49.0 (September 30, 2022) diff --git a/charts/consul/templates/api-gateway-controller-deployment.yaml b/charts/consul/templates/api-gateway-controller-deployment.yaml index 22d14c1e48..604a017ecf 100644 --- a/charts/consul/templates/api-gateway-controller-deployment.yaml +++ b/charts/consul/templates/api-gateway-controller-deployment.yaml @@ -235,4 +235,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..450357a773 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 1cbd709576..564de43780 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2956,6 +2956,13 @@ 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. + # + # @type: string + tolerations: null + # This value defines the type of service created for gateways (e.g. LoadBalancer, ClusterIP) serviceType: LoadBalancer @@ -3038,6 +3045,12 @@ 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. + # + # @type: string + tolerations: null + # Configuration for the Service created for the api-gateway-controller service: # Annotations to apply to the api-gateway-controller service.