Files
wiki/dev/chart/templates/tests/test-connection.yaml
T
2026-09-27 11:52:35 -04:00

40 lines
1.2 KiB
YAML

apiVersion: v1
kind: Pod
metadata:
name: {{ include "wiki.fullname" . }}-test
labels:
{{- include "wiki.commonLabels" . | nindent 4 }}
app.kubernetes.io/component: test
annotations:
helm.sh/hook: test
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
spec:
restartPolicy: Never
automountServiceAccountToken: false
enableServiceLinks: false
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 4 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 4 }}
containers:
# Asked through the Service, so that it tests the selector as well as the wiki.
- name: ready
image: {{ include "wiki.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- node
- -e
- |
const url = 'http://{{ include "wiki.fullname" . }}:{{ .Values.service.port }}/_ready'
fetch(url).then((res) => {
console.info(`${url} → ${res.status}`)
process.exit(res.ok ? 0 : 1)
}, (err) => {
console.error(`${url} → ${err.cause?.code ?? err.message}`)
process.exit(1)
})
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}