Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ spec:
containerPort: {{ .Values.port }}
- name: metrics
containerPort: {{ .Values.openMetricsPort }}
{{- if .Values.healthcheckPort }}
- name: healthcheck
containerPort: {{ .Values.healthcheckPort }}
{{- end }}
{{- if .Values.lifecycle }}
{{- if .Values.preStopSleepSeconds }}
{{- fail "lifecycle replaces the preStop that preStopSleepSeconds renders; set one of them" }}
Expand All @@ -178,6 +182,14 @@ spec:
{{- if .Values.readinessProbe }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
{{- else if .Values.healthcheckPort }}
readinessProbe:
# Pools report healthy until their first connection attempt fails,
# which takes up to connect_timeout (5s by default).
initialDelaySeconds: 10
httpGet:
path: /
port: healthcheck
{{- end }}
{{- if .Values.startupProbe }}
startupProbe:
Expand Down
2 changes: 2 additions & 0 deletions test/values-healthcheck-port.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Test healthcheck port with its default HTTP readiness probe
healthcheckPort: 8080
7 changes: 5 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ port: 6432
# net.core.somaxconn, so raise both settings when increasing this value.
# Defaults to 1024. This setting cannot be changed at runtime.
# listenBacklog: 1024
# healthcheckPort on which PgDog will expose healthcheck endpoint
# healthcheckPort on which PgDog will expose its HTTP healthcheck endpoint.
# It returns 502 when every connection pool is down. Unless readinessProbe is
# set, the chart uses it as the readiness probe.
# (if not specified, no separate healthcheck port is configured)
# healthcheckPort: 8080
# Optional [general] setting; omitted unless explicitly set to true or false.
Expand Down Expand Up @@ -109,7 +111,8 @@ replicas: 2
# Optional: Deployment rollout strategy (Deployment only)
# strategy: {}

# Optional: container health probes (disabled by default)
# Optional: container health probes. When readinessProbe is not set and
# healthcheckPort is, the chart adds an HTTP readiness probe on healthcheckPort.
# livenessProbe: {}
# readinessProbe: {}
# startupProbe: {}
Expand Down