Skip to content
Merged
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
2 changes: 1 addition & 1 deletion chart/templates/pgbouncer/pgbouncer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
replicas: 1
replicas: {{ .Values.pgbouncer.replicas | default "1" }}
{{- if $revisionHistoryLimit }}
revisionHistoryLimit: {{ $revisionHistoryLimit }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4161,6 +4161,11 @@
"x-docsSection": "Common",
"default": false
},
"replicas": {
"description": "Number of PgBouncer replicas to run in Deployment.",
"type": "integer",
"default": 1
},
"revisionHistoryLimit": {
"description": "Number of old replicasets to retain.",
"type": [
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,8 @@ statsd:
pgbouncer:
# Enable PgBouncer
enabled: false
# Number of PgBouncer replicas to run in Deployment
replicas: 1
# Max number of old replicasets to retain
revisionHistoryLimit: ~
# Command to use for PgBouncer(templated).
Expand Down
12 changes: 12 additions & 0 deletions tests/charts/test_pgbouncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,18 @@ def test_should_add_extra_volume_and_extra_volume_mount(self):
"spec.template.spec.containers[0].volumeMounts[*].name", docs[0]
)

def test_pgbouncer_replicas_are_configurable(self):
docs = render_chart(
values={
"pgbouncer": {
"enabled": True,
"replicas": 2,
},
},
show_only=["templates/pgbouncer/pgbouncer-deployment.yaml"],
)
assert 2 == jmespath.search("spec.replicas", docs[0])


class TestPgbouncerConfig:
def test_config_not_created_by_default(self):
Expand Down