diff --git a/chart/templates/pgbouncer/pgbouncer-deployment.yaml b/chart/templates/pgbouncer/pgbouncer-deployment.yaml index 1d2601a945f19..63c361dc828b5 100644 --- a/chart/templates/pgbouncer/pgbouncer-deployment.yaml +++ b/chart/templates/pgbouncer/pgbouncer-deployment.yaml @@ -66,6 +66,9 @@ spec: annotations: checksum/pgbouncer-config-secret: {{ include (print $.Template.BasePath "/secrets/pgbouncer-config-secret.yaml") . | sha256sum }} checksum/pgbouncer-certificates-secret: {{ include (print $.Template.BasePath "/secrets/pgbouncer-certificates-secret.yaml") . | sha256sum }} + {{- if .Values.pgbouncer.podAnnotations }} + {{- toYaml .Values.pgbouncer.podAnnotations | nindent 8 }} + {{- end }} spec: {{- if .Values.pgbouncer.priorityClassName }} priorityClassName: {{ .Values.pgbouncer.priorityClassName }} diff --git a/chart/values.schema.json b/chart/values.schema.json index e0d5b1cab8344..11a61d3e577e0 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -4385,6 +4385,14 @@ ], "default": null }, + "podAnnotations": { + "description": "Add annotations for the PgBouncer Pod.", + "type": "object", + "default": {}, + "additionalProperties": { + "type": "string" + } + }, "podDisruptionBudget": { "description": "PgBouncer PodDisruptionBudget.", "type": "object", diff --git a/chart/values.yaml b/chart/values.yaml index afad5f94b6f76..5477d2bcd817d 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1542,6 +1542,8 @@ pgbouncer: # annotations to be added to the PgBouncer deployment annotations: {} + podAnnotations: {} + # Create ServiceAccount serviceAccount: # Specifies whether a ServiceAccount should be created diff --git a/tests/charts/test_annotations.py b/tests/charts/test_annotations.py index 841dd5d3010ba..a4392c20f4d06 100644 --- a/tests/charts/test_annotations.py +++ b/tests/charts/test_annotations.py @@ -366,6 +366,20 @@ def test_annotations_are_added(self, values, show_only, expected_annotations): "example": "statsd", }, ), + ( + { + "pgbouncer": { + "enabled": True, + "podAnnotations": { + "example": "pgbouncer", + }, + }, + }, + "templates/pgbouncer/pgbouncer-deployment.yaml", + { + "example": "pgbouncer", + }, + ), ], ) class TestPerComponentPodAnnotations: