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
4 changes: 2 additions & 2 deletions chart/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ If release name contains chart name it will be used as a full name.
pool_mode = transaction
listen_port = {{ .Values.ports.pgbouncer }}
listen_addr = *
auth_type = md5
auth_file = /etc/pgbouncer/users.txt
auth_type = {{ .Values.pgbouncer.auth_type }}
auth_file = {{ .Values.pgbouncer.auth_file }}
stats_users = {{ .Values.data.metadataConnection.user }}
ignore_startup_parameters = extra_float_digits
max_client_conn = {{ .Values.pgbouncer.maxClientConn }}
Expand Down
10 changes: 10 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3386,6 +3386,16 @@
"type": "integer",
"default": 0
},
"auth_type": {
"description": "Method of authenticating users",
"type": "string",
"default": "md5"
},
"auth_file": {
"description": "The name of the file to load user names and passwords from",
"type": "string",
"default": "/etc/pgbouncer/users.txt"
},
"logDisconnections": {
"description": "Log disconnections with reasons.",
"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 @@ -1158,6 +1158,8 @@ pgbouncer:
command: ["pgbouncer", "-u", "nobody", "/etc/pgbouncer/pgbouncer.ini"]
# Args to use for PgBouncer(templated).
args: ~
auth_type: md5
auth_file: /etc/pgbouncer/users.txt

# Create ServiceAccount
serviceAccount:
Expand Down
22 changes: 22 additions & 0 deletions tests/charts/test_pgbouncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,28 @@ def test_config_overrides(self):
assert "server_tls_sslmode = verify-full" in ini
assert "server_tls_ciphers = secure" in ini

def test_auth_type_file_defaults(self):
values = {
"pgbouncer": {"enabled": True},
"ports": {"pgbouncer": 7777},
"data": {"metadataConnection": {"user": "someuser"}},
}
ini = self._get_pgbouncer_ini(values)

assert "auth_type = md5" in ini
assert "auth_file = /etc/pgbouncer/users.txt" in ini

def test_auth_type_file_overrides(self):
values = {
"pgbouncer": {"enabled": True, "auth_type": "any", "auth_file": "/home/auth.txt"},
"ports": {"pgbouncer": 7777},
"data": {"metadataConnection": {"user": "someuser"}},
}
ini = self._get_pgbouncer_ini(values)

assert "auth_type = any" in ini
assert "auth_file = /home/auth.txt" in ini

def test_ssl_defaults_dont_create_cert_secret(self):
docs = render_chart(
values={"pgbouncer": {"enabled": True}},
Expand Down