mirror of
https://github.com/bitnami/charts.git
synced 2026-03-15 14:57:16 +08:00
[bitnami/postgresql-ha] Use different liveness/readiness probes (#26388)
* [bitnami/postgresql-ha] Use different liveness/readiness probes Signed-off-by: David Gomez <dgomezleon@vmware.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Signed-off-by: David Gomez <dgomezleon@vmware.com> --------- Signed-off-by: David Gomez <dgomezleon@vmware.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -40,4 +40,4 @@ maintainers:
|
||||
name: postgresql-ha
|
||||
sources:
|
||||
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql-ha
|
||||
version: 14.1.0
|
||||
version: 14.1.1
|
||||
|
||||
@@ -718,3 +718,19 @@ Return the path to the cert key file.
|
||||
{{- define "postgresql-ha.postgresql.tlsCertKey" -}}
|
||||
{{- required "Certificate Key filename is required when TLS in enabled" .Values.postgresql.tls.certKeyFilename | printf "/opt/bitnami/postgresql/certs/%s" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the readiness probe command
|
||||
*/}}
|
||||
{{- define "postgresql-ha.readinessProbeCommand" -}}
|
||||
{{- $block := index .context.Values .component }}
|
||||
{{- if eq .component "postgresql" -}}
|
||||
- |
|
||||
exec pg_isready -U "postgres" {{- if $block.tls.enabled }} -d "sslcert={{ include "postgresql-ha.postgresql.tlsCert" . }} sslkey={{ include "postgresql-ha.postgresql.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ $block.containerPorts.postgresql }}
|
||||
{{- if contains "bitnami/" $block.image.repository }}
|
||||
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
|
||||
{{- end }}
|
||||
{{- else -}}
|
||||
- exec pg_isready -U "postgres" -h 127.0.0.1 -p {{ $block.containerPorts.postgresql }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -418,7 +418,7 @@ spec:
|
||||
command:
|
||||
- bash
|
||||
- -ec
|
||||
- '{{ include "postgresql-ha.pgpassword" . }} psql -w -U {{ include "postgresql-ha.postgresqlUsername" . | quote }} -d {{ (include "postgresql-ha.postgresqlDatabase" .) | quote }} -h 127.0.0.1 -p {{ .Values.postgresql.containerPorts.postgresql }} -c "SELECT 1"'
|
||||
{{- include "postgresql-ha.readinessProbeCommand" (dict "component" "postgresql" "context" $) | nindent 16 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.postgresql.customStartupProbe }}
|
||||
@@ -536,8 +536,7 @@ spec:
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.metrics.livenessProbe.enabled }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
tpcSocket:
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.customReadinessProbe }}
|
||||
|
||||
@@ -381,7 +381,7 @@ spec:
|
||||
command:
|
||||
- bash
|
||||
- -ec
|
||||
- '{{ include "postgresql-ha.pgpassword" . }} psql -w -U {{ include "postgresql-ha.postgresqlUsername" . | quote }} -d {{ (include "postgresql-ha.postgresqlDatabase" .) | quote }} -h 127.0.0.1 -p {{ .Values.witness.containerPorts.postgresql }} -c "SELECT 1"'
|
||||
{{- include "postgresql-ha.readinessProbeCommand" (dict "component" "witness" "context" $) | nindent 16 }}
|
||||
{{- end }}
|
||||
{{- if .Values.witness.customStartupProbe }}
|
||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.witness.customStartupProbe "context" $) | nindent 12 }}
|
||||
@@ -495,8 +495,7 @@ spec:
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- else if .Values.metrics.livenessProbe.enabled }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||
httpGet:
|
||||
path: /
|
||||
tcpSocket:
|
||||
port: metrics
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.customReadinessProbe }}
|
||||
|
||||
Reference in New Issue
Block a user