charts/koment/templates/tests/service.yaml
1
apiVersion: v1
2
kind: Pod
3
metadata:
4
name: {{ include "koment.fullname" . }}-test
5
labels: {{- include "koment.labels" . | nindent 4 }}
6
annotations:
7
helm.sh/hook: test
8
helm.sh/hook-delete-policy: before-hook-creation
9
spec:
10
automountServiceAccountToken: false
11
restartPolicy: Never
12
securityContext:
13
runAsNonRoot: true
14
runAsUser: {{ .Values.tests.image.runAsUser }}
15
runAsGroup: {{ .Values.tests.image.runAsGroup }}
16
seccompProfile:
17
type: RuntimeDefault
18
containers:
19
- name: service
20
image: {{ include "koment.testImage" . | quote }}
21
imagePullPolicy: {{ .Values.tests.image.pullPolicy }}
22
command: ["sh", "-ec"]
23
args:
24
- |
25
base="http://{{ include "koment.fullname" . }}:{{ .Values.service.port }}"
26
curl --fail --silent --show-error "$base/livez"
27
curl --fail --silent --show-error "$base/readyz"
28
status=$(curl --silent --output /dev/null --write-out '%{http_code}' "$base/r/{{ (index .Values.repositories 0).id }}/")
29
test "$status" = "401"
30
securityContext:
31
allowPrivilegeEscalation: false
32
capabilities:
33
drop: ["ALL"]
34
readOnlyRootFilesystem: true