diff --git a/charts/postgres/Chart.yaml b/charts/postgres/Chart.yaml index 35a7ecaf944df205311aeb45e1937306bd931945..93f3ba44e8e0f5c5e8e863852528252531233f32 100644 --- a/charts/postgres/Chart.yaml +++ b/charts/postgres/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.3.1 +version: 0.3.2 appVersion: "14.1" diff --git a/charts/postgres/README.md b/charts/postgres/README.md index ce6fbdceb6f8f4eea24023b50d55d1b3c6aaf619..76bf508333b82a2dacf51c93318d2deace63dfd1 100644 --- a/charts/postgres/README.md +++ b/charts/postgres/README.md @@ -1,6 +1,6 @@ # PostgreSQL -   +   A Helm chart for PostgreSQL on Kubernetes @@ -59,8 +59,10 @@ $ helm uninstall my-release | image.repository | string | `"postgres"` | Image name | | image.tag | string | `""` | Image tag | | imagePullSecrets | list | `[]` | Image pull secrets | +| startupProbe | object | `see values.yaml` | Startup probe configuration | | livenessProbe | object | `see values.yaml` | Liveness probe configuration | | readinessProbe | object | `see values.yaml` | Readiness probe configuration | +| customStartupProbe | object | `{}` | Custom startup probe (overwrites default startup probe configuration) | | customLivenessProbe | object | `{}` | Custom liveness probe (overwrites default liveness probe configuration) | | customReadinessProbe | object | `{}` | Custom readiness probe (overwrites default readiness probe configuration) | | resources | object | `{}` | Resource limits and requests | diff --git a/charts/postgres/templates/statefulset.yaml b/charts/postgres/templates/statefulset.yaml index 0a862bcf68023d0ca35d34f1809a18f8fcc71475..1a7ad7c588789ecc3b4d5ab94448d59bca2837e5 100644 --- a/charts/postgres/templates/statefulset.yaml +++ b/charts/postgres/templates/statefulset.yaml @@ -64,6 +64,26 @@ spec: envFrom: - secretRef: name: {{ include "postgres.fullname" . }} + {{- if .Values.customStartupProbe }} + startupProbe: + {{- toYaml .Values.customStartupProbe | nindent 12 }} + {{- else }} + {{- if .Values.startupProbe.enabled }} + startupProbe: + exec: + command: + - sh + - -c + - pg_isready -h localhost + {{- with .Values.startupProbe }} + initialDelaySeconds: {{ .initialDelaySeconds }} + timeoutSeconds: {{ .timeoutSeconds }} + failureThreshold: {{ .failureThreshold }} + successThreshold: {{ .successThreshold }} + periodSeconds: {{ .periodSeconds }} + {{- end }} + {{- end }} + {{- end }} {{- if .Values.customLivenessProbe }} livenessProbe: {{- toYaml .Values.customLivenessProbe | nindent 12 }} diff --git a/charts/postgres/values.yaml b/charts/postgres/values.yaml index 66f8abd7fa9289424a186b9cbde1ee22d5b5a97a..87f367f3346d060abccb29d4326c0b7e2a3632e7 100644 --- a/charts/postgres/values.yaml +++ b/charts/postgres/values.yaml @@ -73,6 +73,18 @@ affinity: {} ## Maximum number of revisions maintained in revision history revisionHistoryLimit: +## Custom startup probe (overwrites default startup probe) +customStartupProbe: {} + +## Default startup check +startupProbe: + enabled: true + initialDelaySeconds: 10 + timeoutSeconds: 5 + failureThreshold: 30 + successThreshold: 1 + periodSeconds: 10 + ## Custom liveness probe (overwrites default liveness probe) customLivenessProbe: {}