blob: f55b5fe15f77b736df5a8c40a12beb269c19476b [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" . }}
37 {{- with .Values.global.priorityClassName }}
38 priorityClassName: {{ . | quote }}
39 {{- end }}
40 {{- with .Values.startupapicheck.securityContext }}
41 securityContext:
42 {{- toYaml . | nindent 8 }}
43 {{- end }}
44 containers:
45 - name: {{ .Chart.Name }}-startupapicheck
46 {{- with .Values.startupapicheck.image }}
47 image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
48 {{- end }}
49 imagePullPolicy: {{ .Values.startupapicheck.image.pullPolicy }}
50 args:
51 - check
52 - api
53 - --wait={{ .Values.startupapicheck.timeout }}
54 {{- with .Values.startupapicheck.extraArgs }}
55 {{- toYaml . | nindent 10 }}
56 {{- end }}
57 {{- with .Values.startupapicheck.containerSecurityContext }}
58 securityContext:
59 {{- toYaml . | nindent 12 }}
60 {{- end }}
61 {{- with .Values.startupapicheck.resources }}
62 resources:
63 {{- toYaml . | nindent 12 }}
64 {{- end }}
65 {{- with .Values.startupapicheck.nodeSelector }}
66 nodeSelector:
67 {{- toYaml . | nindent 8 }}
68 {{- end }}
69 {{- with .Values.startupapicheck.affinity }}
70 affinity:
71 {{- toYaml . | nindent 8 }}
72 {{- end }}
73 {{- with .Values.startupapicheck.tolerations }}
74 tolerations:
75 {{- toYaml . | nindent 8 }}
76 {{- end }}
77{{- end }}