openstack-helm-infra/postgresql
Phil Sphicas c43331d67a postgresql: Optimize restart behavior
* add preStop hook to trigger Fast Shutdown
* disable readiness probe by default

When Kubernetes terminates a pod, the container runtime typically sends
a SIGTERM signal to pid 1 in each container [0]. PostgreSQL interprets
SIGTERM as a request to do a "Smart Shutdown" [1]. This can take minutes
(often exhausting the termination grace period), and during this time,
new connections are not being serviced.

Now that postgresql has a single replica, this behavior is undesirable.
If we kill the pod (e.g. in an upgrade), we probably want it to come
back as soon as possible.

This change adds a preStop hook that sends a SIGINT to postgresql in
order to trigger a "Fast Shutdown". In addition, the readiness probe is
disabled by default, since it adds no value in a single-replica
scenario.

0: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination
1: https://www.postgresql.org/docs/9.6/server-shutdown.html

Change-Id: Ib5f3d2a49e55332604c91f9a011e87d78947dbef
2020-10-23 07:41:57 +00:00
..
templates postgresql: Optimize restart behavior 2020-10-23 07:41:57 +00:00
values_overrides Add Application armor to Postgresql-backup pods 2020-08-14 18:23:02 +00:00
.helmignore Postgresql: Move chart to openstack-helm-infra 2018-09-09 10:20:08 -06:00
Chart.yaml postgresql: Optimize restart behavior 2020-10-23 07:41:57 +00:00
requirements.yaml Change helm-toolkit dependency version to ">= 0.1.0" 2020-09-24 12:19:28 -05:00
values.yaml postgresql: Optimize restart behavior 2020-10-23 07:41:57 +00:00