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
14 changes: 8 additions & 6 deletions charts/cluster/templates/tests/ping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ spec:
restartPolicy: Never
containers:
- name: alpine
image: alpine:3.17
command: [ 'sh' ]
image: {{ required "Missing .Values.tests.ping.image" .Values.tests.ping.image }}
{{- with .Values.tests.ping.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: PGUSER
valueFrom:
Expand All @@ -37,8 +40,7 @@ spec:
name: {{ include "cluster.fullname" . }}-app
key: dbname
optional: true
{{- with .Values.tests.ping.args }}
args:
- "-c"
- >-
apk add postgresql-client &&
psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ include "cluster.namespace" . }}.svc.cluster.local:5432/${PGDBNAME:-$PGUSER}" -c 'SELECT 1'
{{- tpl (toYamlPretty .) $ | nindent 12 }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -502,3 +502,15 @@ poolers: []
# # -- Custom PgBouncer deployment template.
# # Use to override image, specify resources, etc.
# template: {}

# -- Configure Helm tests
tests:
ping:
image: alpine:3.17
command:
- sh
args:
- -c
- >-
apk add postgresql-client &&
psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ include "cluster.namespace" . }}.svc.cluster.local:5432/${PGDBNAME:-$PGUSER}" -c 'SELECT 1'