[bitnami/postgresql] moved liveness probe command to healthcheck.sh script

This commit is contained in:
Sameer Naik
2020-01-31 12:38:51 +05:30
parent 3cad5374d6
commit df9db779a8
3 changed files with 3 additions and 15 deletions

View File

@@ -125,19 +125,7 @@ spec:
livenessProbe:
exec:
command:
- bash
- -ec
- |
if PGPASSWORD=${PGPOOL_POSTGRES_PASSWORD} psql -U {{ (include "postgresql-ha.postgresqlUsername" .) | quote }} {{- if not (empty (include "postgresql-ha.postgresqlDatabase" .)) }} -d {{ (include "postgresql-ha.postgresqlDatabase" .) | quote }}{{- end }} -h 127.0.0.1 -tA -c "show pool_nodes;"; then
for node in $(PGPASSWORD=${PGPOOL_POSTGRES_PASSWORD} psql -U {{ (include "postgresql-ha.postgresqlUsername" .) | quote }} {{- if not (empty (include "postgresql-ha.postgresqlDatabase" .)) }} -d {{ (include "postgresql-ha.postgresqlDatabase" .) | quote }}{{- end }} -h 127.0.0.1 -tA -c "show pool_nodes;" | grep "down" | cut -d'|' -f2); do
if PGPASSWORD=${PGPOOL_POSTGRES_PASSWORD} psql -U {{ (include "postgresql-ha.postgresqlUsername" .) | quote }} {{- if not (empty (include "postgresql-ha.postgresqlDatabase" .)) }} -d {{ (include "postgresql-ha.postgresqlDatabase" .) | quote }}{{- end }} -h ${node} -tA -c "SELECT 1" >/dev/null; then
false
fi
done
else
false
fi
- /healthcheck.sh
initialDelaySeconds: {{ .Values.pgpool.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.pgpool.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.pgpool.livenessProbe.timeoutSeconds }}

View File

@@ -51,7 +51,7 @@ postgresqlImage:
pgpoolImage:
registry: docker.io
repository: bitnami/pgpool
tag: 4.1.0-debian-10-r2
tag: 4.1.0-debian-10-r7
## Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##

View File

@@ -51,7 +51,7 @@ postgresqlImage:
pgpoolImage:
registry: docker.io
repository: bitnami/pgpool
tag: 4.1.0-debian-10-r2
tag: 4.1.0-debian-10-r7
## Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##