postgresql: Allow probe tweaking

Uses the standard helm-toolkit macros for liveness and readiness probes,
allowing them to be enabled or disabled, and params to be overridden.

The existing hard-coded settings are preserved as the chart defaults.

Change-Id: Idd063e6b8721126c88fa22c459f93812151d7b64
This commit is contained in:
Phil Sphicas 2020-10-23 06:52:45 +00:00
parent b4d0793b98
commit a10699c4e0
3 changed files with 30 additions and 15 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v9.6
description: OpenStack-Helm PostgreSQL
name: postgresql
version: 0.1.3
version: 0.1.4
home: https://www.postgresql.org
sources:
- https://github.com/postgres/postgres

View File

@ -12,6 +12,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "livenessProbeTemplate" -}}
exec:
command:
- /tmp/readiness.sh
{{- end -}}
{{- define "readinessProbeTemplate" -}}
exec:
command:
- /tmp/readiness.sh
{{- end -}}
{{- if .Values.manifests.statefulset }}
{{- $envAll := . }}
@ -177,20 +189,8 @@ spec:
key: 'POSTGRES_USER'
command:
- /tmp/start.sh
livenessProbe:
exec:
command:
- /tmp/readiness.sh
initialDelaySeconds: 30
timeoutSeconds: 5
failureThreshold: 10
readinessProbe:
exec:
command:
- /tmp/readiness.sh
initialDelaySeconds: 30
timeoutSeconds: 5
failureThreshold: 10
{{ dict "envAll" . "component" "server" "container" "postgresql" "type" "liveness" "probeTemplate" (include "livenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
{{ dict "envAll" . "component" "server" "container" "postgresql" "type" "readiness" "probeTemplate" (include "readinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
volumeMounts:
- name: pod-tmp
mountPath: /tmp

View File

@ -88,6 +88,21 @@ pod:
timeout: 30
server:
timeout: 180
probes:
server:
postgresql:
liveness:
enabled: true
params:
initialDelaySeconds: 30
timeoutSeconds: 5
failureThreshold: 10
readiness:
enabled: true
params:
initialDelaySeconds: 30
timeoutSeconds: 5
failureThreshold: 10
resources:
enabled: false
server: