Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_check_default_setting(self):
assert jmespath.search("spec.template.spec.containers[0].lifecycle", doc) is None

pgbouncer_default_value = {
"exec": {"command": ["/bin/sh", "-c", "killall -INT pgbouncer && sleep 120"]}
"exec": {"command": ["/bin/sh", "-c", "sleep 10 && killall -INT pgbouncer && sleep 20"]}
}
assert pgbouncer_default_value == jmespath.search(
"spec.template.spec.containers[0].lifecycle.preStop", docs[-1]
Expand Down
2 changes: 1 addition & 1 deletion chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7827,7 +7827,7 @@
"command": [
"/bin/sh",
"-c",
"killall -INT pgbouncer && sleep 120"
"sleep 10 && killall -INT pgbouncer && sleep 20"
]
}
}
Expand Down
6 changes: 4 additions & 2 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2859,8 +2859,10 @@ pgbouncer:
containerLifecycleHooks:
preStop:
exec:
# Allow existing queries clients to complete within 120 seconds
command: ["/bin/sh", "-c", "killall -INT pgbouncer && sleep 120"]
# Sleep first so the pod is marked Terminating and removed from
# Service endpoints before pgbouncer stops accepting connections,
# then gracefully drain existing queries.
command: ["/bin/sh", "-c", "sleep 10 && killall -INT pgbouncer && sleep 20"]

metricsExporterSidecar:
resources: {}
Expand Down