openstack-helm-infra/postgresql/templates
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
..
bin Patroni exclusion for Postgres 2020-08-31 18:02:37 +00:00
monitoring/prometheus [PostgreSQL] Use explicit entrypoint for prometheus exporter 2020-10-11 13:53:34 +00:00
secrets Remove OSH Authors copyright 2020-05-07 02:11:15 +00:00
configmap-bin.yaml Patroni exclusion for Postgres 2020-08-31 18:02:37 +00:00
configmap-etc.yaml Patroni exclusion for Postgres 2020-08-31 18:02:37 +00:00
cron-job-backup-postgres.yaml Fix postgresql backup cronjob deployment issues 2020-07-29 22:39:59 +00:00
job-image-repo-sync.yaml Remove OSH Authors copyright 2020-05-07 02:11:15 +00:00
job-ks-user.yaml Postgresql backup/restore enhancements 2020-04-22 22:31:48 +00:00
network_policy.yaml Remove OSH Authors copyright 2020-05-07 02:11:15 +00:00
pod-test.yaml Undo octal-values restriction together with corresponding code 2020-07-07 15:42:53 +00:00
postgresql-backup-pvc.yaml Remove OSH Authors copyright 2020-05-07 02:11:15 +00:00
secret-admin.yaml Remove OSH Authors copyright 2020-05-07 02:11:15 +00:00
secret-audit.yaml Remove OSH Authors copyright 2020-05-07 02:11:15 +00:00
secret-backup-restore.yaml Fix problems with DB utilities in HTK and Postgresql 2020-06-24 19:16:04 +00:00
secret-rgw.yaml Backup/restore enhancements 2020-05-13 16:34:21 +00:00
secrets-etc.yaml Enable yamllint rules for templates 2020-06-17 13:13:53 -05:00
service-postgres.yaml Patroni exclusion for Postgres 2020-08-31 18:02:37 +00:00
service-restapi.yaml Enable yamllint rules for templates 2020-06-17 13:13:53 -05:00
statefulset.yaml postgresql: Optimize restart behavior 2020-10-23 07:41:57 +00:00