36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: "{{ include "pgadmin.fullname" . }}-test-connection"
|
|
namespace: {{ include "pgadmin.namespaceName" . }}
|
|
labels:
|
|
{{ include "pgadmin.labels" . | indent 4 }}
|
|
annotations:
|
|
"helm.sh/hook": test
|
|
"helm.sh/hook-delete-policy": hook-succeeded
|
|
spec:
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
{{- if .Values.test.securityContext }}
|
|
{{- .Values.test.securityContext | toYaml | nindent 4 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: wget
|
|
image: "{{ .Values.test.image.registry }}/{{ .Values.test.image.repository }}:{{ .Values.test.image.tag }}"
|
|
env:
|
|
- name: PGADMIN_HOST
|
|
value: {{ include "pgadmin.fullname" . }}
|
|
- name: PGADMIN_PORT
|
|
value: "{{ .Values.service.port }}"
|
|
command:
|
|
- /bin/sh
|
|
- -ec
|
|
- |
|
|
response=$(wget -qSO - http://${PGADMIN_HOST}:${PGADMIN_PORT} 2>&1)
|
|
check=$(echo $response | grep -c '200 OK'); echo $check; if [[ $check -gt 0 ]]; then echo "Response OK"; else exit 1; fi
|
|
resources:
|
|
{{- .Values.test.resources | toYaml | nindent 8 }}
|
|
securityContext:
|
|
readOnlyRootFilesystem: true
|
|
restartPolicy: Never
|