Skip to content

Commit

Permalink
Add podAnnotations to PgBouncer (#30168)
Browse files Browse the repository at this point in the history
  • Loading branch information
dim-ops authored Apr 10, 2023
1 parent e8da514 commit 78ab400
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chart/templates/pgbouncer/pgbouncer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
8 changes: 8 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions tests/charts/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 78ab400

Please sign in to comment.