mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/postgresql] Make readiness probe compatible for most postgresql images (#14516)
* Make readiness probe compatible for most postgresql images Signed-off-by: tompizmor <tompizmor@gmail.com> * Simplify logic for generating readiness probe command Signed-off-by: tompizmor <tompizmor@gmail.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
e05f71b98f
commit
60d89aa165
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: postgresql
|
||||
version: 5.3.1
|
||||
version: 5.3.2
|
||||
appVersion: 11.3.0
|
||||
description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
|
||||
keywords:
|
||||
|
||||
@@ -295,3 +295,18 @@ imagePullSecrets:
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the readiness probe command
|
||||
*/}}
|
||||
{{- define "postgresql.readinessProbeCommand" -}}
|
||||
- |
|
||||
{{- if (include "postgresql.database" .) }}
|
||||
pg_isready -U {{ include "postgresql.username" . | quote }} -d {{ (include "postgresql.database" .) | quote }} -h 127.0.0.1 -p {{ template "postgresql.port" . }}
|
||||
{{- else }}
|
||||
pg_isready -U {{ include "postgresql.username" . | quote }} -h 127.0.0.1 -p {{ template "postgresql.port" . }}
|
||||
{{- end }}
|
||||
{{- if contains "bitnami/" .Values.image.repository }}
|
||||
[ -f /opt/bitnami/postgresql/tmp/.initialized ]
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -155,11 +155,7 @@ spec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
{{- if (include "postgresql.database" .) }}
|
||||
- pg_isready -U {{ include "postgresql.username" . | quote }} -d {{ (include "postgresql.database" .) | quote }} -h 127.0.0.1 -p {{ template "postgresql.port" . }} && [ -f /opt/bitnami/postgresql/tmp/.initialized ]
|
||||
{{- else }}
|
||||
- pg_isready -U {{ include "postgresql.username" . | quote }} -h 127.0.0.1 -p {{ template "postgresql.port" . }} && [ -f /opt/bitnami/postgresql/tmp/.initialized ]
|
||||
{{- end }}
|
||||
{{- include "postgresql.readinessProbeCommand" . | nindent 12 }}
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
|
||||
@@ -180,11 +180,7 @@ spec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
{{- if (include "postgresql.database" .) }}
|
||||
- pg_isready -U {{ include "postgresql.username" . | quote }} -d {{ (include "postgresql.database" .) | quote }} -h 127.0.0.1 -p {{ template "postgresql.port" . }} && [ -f /opt/bitnami/postgresql/tmp/.initialized ]
|
||||
{{- else }}
|
||||
- pg_isready -U {{ include "postgresql.username" . | quote }} -h 127.0.0.1 -p {{ template "postgresql.port" . }} && [ -f /opt/bitnami/postgresql/tmp/.initialized ]
|
||||
{{- end }}
|
||||
{{- include "postgresql.readinessProbeCommand" . | nindent 12 }}
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
|
||||
Reference in New Issue
Block a user