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
19 changes: 16 additions & 3 deletions charts/cluster/templates/tests/ping.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.test.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -16,10 +17,15 @@ spec:
app.kubernetes.io/component: database-ping-test
spec:
restartPolicy: Never
{{- if .Values.test.securityContext }}
securityContext:
{{- .Values.test.securityContext | toYaml | nindent 8 }}
{{- end }}
containers:
- name: alpine
image: alpine:3.17
command: [ 'sh' ]
- name: ping
image: "{{ .Values.test.image.registry }}/{{ .Values.test.image.repository }}:{{ .Values.test.image.tag }}"
command:
- {{ .Values.test.shell }}
env:
- name: PGUSER
valueFrom:
Expand All @@ -42,3 +48,10 @@ spec:
- >-
apk add postgresql-client &&
psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ include "cluster.namespace" . }}.svc.cluster.local:5432/${PGDBNAME:-$PGUSER}" -c 'SELECT 1'
resources:
{{- .Values.test.resources | toYaml | nindent 12 }}
{{- if .Values.test.containerSecurityContext }}
securityContext:
{{- .Values.test.containerSecurityContext | toYaml | nindent 12 }}
{{- end }}
{{- end }}
22 changes: 22 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,25 @@ poolers: []
# # -- Custom PgBouncer deployment template.
# # Use to override image, specify resources, etc.
# template: {}

# -- Define values for chart tests
test:
enabled: true
# -- Container image for ping.yaml
image:
registry: docker.io
repository: alpine
tag: 3.17
shell: sh
# -- Resources request/limit for ping Pod
resources: {}
# limits:
# cpu: 50m
# memory: 32Mi
# requests:
# cpu: 25m
# memory: 16Mi
# -- Security context for ping Pod
securityContext: null
# -- Container security context for ping Pod
containerSecurityContext: null