Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Attempting to use sidecar with Patroni polling
Browse files Browse the repository at this point in the history
  • Loading branch information
thedodd committed Dec 7, 2023
1 parent 680d017 commit ed251df
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions charts/timescaledb-single/templates/statefulset-timescaledb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,25 @@ spec:
# we can still serve clients.
terminationGracePeriodSeconds: 600
containers:
{{- if .Values.linkerd.adminShutdownOnExit }}
- name: linkerd-shutdown
securityContext:
allowPrivilegeEscalation: false
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /bin/bash
- "-c"
- |
while true; do
ret=`curl -s -m -X GET http://localhost:8008/liveness`
if [ $ret != 0 ]; break; fi
sleep 10
done
# Once Patroni exits, when running with a linkerd-proxy sidecar, we call linkerd-proxy shutdown.
curl -s -m 5 -X POST http://localhost:4191/shutdown
{{- end }}
- name: timescaledb
securityContext:
allowPrivilegeEscalation: false
Expand Down Expand Up @@ -167,16 +186,7 @@ spec:
export PATRONI_POSTGRESQL_PGPASS="${HOME}/.pgpass.patroni"
patroni /etc/timescaledb/patroni.yaml
rcode=$?
{{- if .Values.linkerd.adminShutdownOnExit }}
# Once Patroni exits, when running with a linkerd-proxy sidecar, we call linkerd-proxy shutdown.
curl -s -m 5 -X POST http://localhost:4191/shutdown
{{- end }}
# Ensure we exit with the code which was returned by Patroni.
exit $rcode
exec patroni /etc/timescaledb/patroni.yaml
env:
# We use mixed case environment variables for Patroni User management,
# as the variable themselves are documented to be PATRONI_<username>_OPTIONS.
Expand Down

0 comments on commit ed251df

Please sign in to comment.