blob: a9b965e180b5ed1b0cfce9d7b2548f7d97b7cab2 [file] [log] [blame]
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +04001{{- if .Values.startupapicheck.enabled }}
2apiVersion: batch/v1
3kind: Job
4metadata:
5 name: {{ include "startupapicheck.fullname" . }}
6 namespace: {{ include "cert-manager.namespace" . }}
7 labels:
8 app: {{ include "startupapicheck.name" . }}
9 app.kubernetes.io/name: {{ include "startupapicheck.name" . }}
10 app.kubernetes.io/instance: {{ .Release.Name }}
11 app.kubernetes.io/component: "startupapicheck"
12 {{- include "labels" . | nindent 4 }}
13 {{- with .Values.startupapicheck.jobAnnotations }}
14 annotations:
15 {{- toYaml . | nindent 4 }}
16 {{- end }}
17spec:
18 backoffLimit: {{ .Values.startupapicheck.backoffLimit }}
19 template:
20 metadata:
21 labels:
22 app: {{ include "startupapicheck.name" . }}
23 app.kubernetes.io/name: {{ include "startupapicheck.name" . }}
24 app.kubernetes.io/instance: {{ .Release.Name }}
25 app.kubernetes.io/component: "startupapicheck"
26 {{- include "labels" . | nindent 8 }}
27 {{- with .Values.startupapicheck.podLabels }}
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
30 {{- with .Values.startupapicheck.podAnnotations }}
31 annotations:
32 {{- toYaml . | nindent 8 }}
33 {{- end }}
34 spec:
35 restartPolicy: OnFailure
36 serviceAccountName: {{ template "startupapicheck.serviceAccountName" . }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +040037 {{- if hasKey .Values.startupapicheck "automountServiceAccountToken" }}
38 automountServiceAccountToken: {{ .Values.startupapicheck.automountServiceAccountToken }}
39 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040040 {{- with .Values.global.priorityClassName }}
41 priorityClassName: {{ . | quote }}
42 {{- end }}
43 {{- with .Values.startupapicheck.securityContext }}
44 securityContext:
45 {{- toYaml . | nindent 8 }}
46 {{- end }}
47 containers:
48 - name: {{ .Chart.Name }}-startupapicheck
49 {{- with .Values.startupapicheck.image }}
50 image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
51 {{- end }}
52 imagePullPolicy: {{ .Values.startupapicheck.image.pullPolicy }}
53 args:
54 - check
55 - api
56 - --wait={{ .Values.startupapicheck.timeout }}
57 {{- with .Values.startupapicheck.extraArgs }}
58 {{- toYaml . | nindent 10 }}
59 {{- end }}
60 {{- with .Values.startupapicheck.containerSecurityContext }}
61 securityContext:
62 {{- toYaml . | nindent 12 }}
63 {{- end }}
64 {{- with .Values.startupapicheck.resources }}
65 resources:
66 {{- toYaml . | nindent 12 }}
67 {{- end }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +040068 {{- with .Values.startupapicheck.volumeMounts }}
69 volumeMounts:
70 {{- toYaml . | nindent 12 }}
71 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040072 {{- with .Values.startupapicheck.nodeSelector }}
73 nodeSelector:
74 {{- toYaml . | nindent 8 }}
75 {{- end }}
76 {{- with .Values.startupapicheck.affinity }}
77 affinity:
78 {{- toYaml . | nindent 8 }}
79 {{- end }}
80 {{- with .Values.startupapicheck.tolerations }}
81 tolerations:
82 {{- toYaml . | nindent 8 }}
83 {{- end }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +040084 {{- with .Values.startupapicheck.volumes }}
85 volumes:
86 {{- toYaml . | nindent 8 }}
87 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040088{{- end }}