From a6424094750364939e7587670f67f879c72424ca Mon Sep 17 00:00:00 2001 From: Marco Ebert Date: Tue, 14 Mar 2023 08:32:55 +0100 Subject: [PATCH] Deployment: Implement `controller.podAnnotations`. --- CHANGELOG.md | 1 + .../templates/controller-deployment.yaml | 15 ++++++++++----- .../values.schema.json | 3 +++ helm/nginx-ingress-controller-app/values.yaml | 4 ++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65ea4887b..2b0e7d315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s - Deployment: Implement `controller.labels`. - Deployment: Implement `controller.annotations`. - Deployment: Implement `revisionHistoryLimit`. + - Deployment: Implement `controller.podAnnotations`. ### Changed diff --git a/helm/nginx-ingress-controller-app/templates/controller-deployment.yaml b/helm/nginx-ingress-controller-app/templates/controller-deployment.yaml index 58b022724..1a5b78a05 100644 --- a/helm/nginx-ingress-controller-app/templates/controller-deployment.yaml +++ b/helm/nginx-ingress-controller-app/templates/controller-deployment.yaml @@ -37,14 +37,19 @@ spec: minReadySeconds: {{ .Values.controller.minReadySeconds }} template: metadata: - labels: - {{- include "ingress-nginx.labels" . | nindent 8 }} - app.kubernetes.io/component: controller annotations: cluster-autoscaler.kubernetes.io/safe-to-evict: 'true' - {{- range .Values.controller.extraAnnotations.pod }} + {{- range .Values.controller.extraAnnotations.pod }} {{ . }} - {{- end }} + {{- end }} + {{- if .Values.controller.podAnnotations }} + {{- range $key, $value := .Values.controller.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + labels: + {{- include "ingress-nginx.labels" . | nindent 8 }} + app.kubernetes.io/component: controller spec: affinity: {{- with .Values.controller.nodeAffinity }} diff --git a/helm/nginx-ingress-controller-app/values.schema.json b/helm/nginx-ingress-controller-app/values.schema.json index b99f5720a..8bc33fc3b 100644 --- a/helm/nginx-ingress-controller-app/values.schema.json +++ b/helm/nginx-ingress-controller-app/values.schema.json @@ -609,6 +609,9 @@ "nodeAffinity": { "type": ["object", "null"] }, + "podAnnotations": { + "type": "object" + }, "proxySetHeaders": { "type": "object" }, diff --git a/helm/nginx-ingress-controller-app/values.yaml b/helm/nginx-ingress-controller-app/values.yaml index 5b8baf144..469b8eb00 100644 --- a/helm/nginx-ingress-controller-app/values.yaml +++ b/helm/nginx-ingress-controller-app/values.yaml @@ -293,6 +293,10 @@ controller: # description: Too many 4XXs # summary: More than 5% of all requests returned 4XX, this requires your attention + # -- Annotations to be added to controller pods + ## + podAnnotations: {} + # controller.resources resources: