blob: f68d54092bbd3967dd5fd69be989080e1a9e86c9 [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 {{- if (hasKey .Values.global "hostUsers") }}
45 hostUsers: {{ .Values.global.hostUsers }}
46 {{- end }}
47 {{- with .Values.startupapicheck.securityContext }}
48 securityContext:
49 {{- toYaml . | nindent 8 }}
50 {{- end }}
51 containers:
52 - name: {{ .Chart.Name }}-startupapicheck
53 image: "{{ template "image" (tuple .Values.startupapicheck.image $.Chart.AppVersion) }}"
54 imagePullPolicy: {{ .Values.startupapicheck.image.pullPolicy }}
55 args:
56 - check
57 - api
58 - --wait={{ .Values.startupapicheck.timeout }}
59 {{- with .Values.startupapicheck.extraArgs }}
60 {{- toYaml . | nindent 10 }}
61 {{- end }}
62 {{- with .Values.startupapicheck.containerSecurityContext }}
63 securityContext:
64 {{- toYaml . | nindent 12 }}
65 {{- end }}
66 env:
67 - name: POD_NAMESPACE
68 valueFrom:
69 fieldRef:
70 fieldPath: metadata.namespace
71 {{- with .Values.startupapicheck.extraEnv }}
72 {{- toYaml . | nindent 10 }}
73 {{- end }}
74 {{- with .Values.startupapicheck.resources }}
75 resources:
76 {{- toYaml . | nindent 12 }}
77 {{- end }}
78 {{- with .Values.startupapicheck.volumeMounts }}
79 volumeMounts:
80 {{- toYaml . | nindent 12 }}
81 {{- end }}
82 {{- $nodeSelector := .Values.global.nodeSelector | default dict }}
83 {{- $nodeSelector = merge $nodeSelector (.Values.startupapicheck.nodeSelector | default dict) }}
84 {{- with $nodeSelector }}
85 nodeSelector:
86 {{- range $key, $value := . }}
87 {{ $key }}: {{ $value | quote }}
88 {{- end }}
89 {{- end }}
90 {{- with .Values.startupapicheck.affinity }}
91 affinity:
92 {{- toYaml . | nindent 8 }}
93 {{- end }}
94 {{- with .Values.startupapicheck.tolerations }}
95 tolerations:
96 {{- toYaml . | nindent 8 }}
97 {{- end }}
98 {{- with .Values.startupapicheck.volumes }}
99 volumes:
100 {{- toYaml . | nindent 8 }}
101 {{- end }}
102{{- end }}