blob: 183cff4e3619c00c5182e90a40e8a98add4cdc2c [file] [log] [blame]
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +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 {{- if hasKey .Values.startupapicheck "automountServiceAccountToken" }}
38 automountServiceAccountToken: {{ .Values.startupapicheck.automountServiceAccountToken }}
39 {{- end }}
40 enableServiceLinks: {{ .Values.startupapicheck.enableServiceLinks }}
41 {{- with .Values.global.priorityClassName }}
42 priorityClassName: {{ . | quote }}
43 {{- end }}
44 {{- with .Values.startupapicheck.securityContext }}
45 securityContext:
46 {{- toYaml . | nindent 8 }}
47 {{- end }}
48 containers:
49 - name: {{ .Chart.Name }}-startupapicheck
50 image: "{{ template "image" (tuple .Values.startupapicheck.image $.Chart.AppVersion) }}"
51 imagePullPolicy: {{ .Values.startupapicheck.image.pullPolicy }}
52 args:
53 - check
54 - api
55 - --wait={{ .Values.startupapicheck.timeout }}
56 {{- with .Values.startupapicheck.extraArgs }}
57 {{- toYaml . | nindent 10 }}
58 {{- end }}
59 {{- with .Values.startupapicheck.containerSecurityContext }}
60 securityContext:
61 {{- toYaml . | nindent 12 }}
62 {{- end }}
63 env:
64 - name: POD_NAMESPACE
65 valueFrom:
66 fieldRef:
67 fieldPath: metadata.namespace
68 {{- with .Values.startupapicheck.extraEnv }}
69 {{- toYaml . | nindent 10 }}
70 {{- end }}
71 {{- with .Values.startupapicheck.resources }}
72 resources:
73 {{- toYaml . | nindent 12 }}
74 {{- end }}
75 {{- with .Values.startupapicheck.volumeMounts }}
76 volumeMounts:
77 {{- toYaml . | nindent 12 }}
78 {{- end }}
79 {{- with .Values.startupapicheck.nodeSelector }}
80 nodeSelector:
81 {{- toYaml . | nindent 8 }}
82 {{- end }}
83 {{- with .Values.startupapicheck.affinity }}
84 affinity:
85 {{- toYaml . | nindent 8 }}
86 {{- end }}
87 {{- with .Values.startupapicheck.tolerations }}
88 tolerations:
89 {{- toYaml . | nindent 8 }}
90 {{- end }}
91 {{- with .Values.startupapicheck.volumes }}
92 volumes:
93 {{- toYaml . | nindent 8 }}
94 {{- end }}
95{{- end }}