Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pod annotation on PgBouncer #30172

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -4288,6 +4288,14 @@
"type": "string"
}
},
"podAnnotations": {
"description": "Annotations to add to the PgBounder pods.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"replicas": {
"description": "Number of PgBouncer replicas to run in Deployment.",
"type": "integer",
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