diff --git a/postgresql/Chart.yaml b/postgresql/Chart.yaml index 7ecc9135..27802703 100644 --- a/postgresql/Chart.yaml +++ b/postgresql/Chart.yaml @@ -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 diff --git a/postgresql/templates/statefulset.yaml b/postgresql/templates/statefulset.yaml index 17f75d98..4a297cd8 100644 --- a/postgresql/templates/statefulset.yaml +++ b/postgresql/templates/statefulset.yaml @@ -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 diff --git a/postgresql/values.yaml b/postgresql/values.yaml index adce9557..12c11359 100644 --- a/postgresql/values.yaml +++ b/postgresql/values.yaml @@ -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: