blob: 0093472efd55e028d34dd6e6a5367c2e94bfd869 [file] [log] [blame]
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +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 }}
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040019 {{- if hasKey .Values.startupapicheck "ttlSecondsAfterFinished" }}
20 ttlSecondsAfterFinished: {{ .Values.startupapicheck.ttlSecondsAfterFinished }}
21 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040022 template:
23 metadata:
24 labels:
25 app: {{ include "startupapicheck.name" . }}
26 app.kubernetes.io/name: {{ include "startupapicheck.name" . }}
27 app.kubernetes.io/instance: {{ .Release.Name }}
28 app.kubernetes.io/component: "startupapicheck"
29 {{- include "labels" . | nindent 8 }}
30 {{- with .Values.startupapicheck.podLabels }}
31 {{- toYaml . | nindent 8 }}
32 {{- end }}
33 {{- with .Values.startupapicheck.podAnnotations }}
34 annotations:
35 {{- toYaml . | nindent 8 }}
36 {{- end }}
37 spec:
38 restartPolicy: OnFailure
39 serviceAccountName: {{ template "startupapicheck.serviceAccountName" . }}
40 {{- if hasKey .Values.startupapicheck "automountServiceAccountToken" }}
41 automountServiceAccountToken: {{ .Values.startupapicheck.automountServiceAccountToken }}
42 {{- end }}
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040043 enableServiceLinks: {{ .Values.startupapicheck.enableServiceLinks }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040044 {{- with .Values.global.priorityClassName }}
45 priorityClassName: {{ . | quote }}
46 {{- end }}
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040047 {{- if (hasKey .Values.global "hostUsers") }}
48 hostUsers: {{ .Values.global.hostUsers }}
49 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040050 {{- with .Values.startupapicheck.securityContext }}
51 securityContext:
52 {{- toYaml . | nindent 8 }}
53 {{- end }}
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040054 {{- with .Values.global.imagePullSecrets }}
55 imagePullSecrets:
56 {{- toYaml . | nindent 8 }}
57 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040058 containers:
59 - name: {{ .Chart.Name }}-startupapicheck
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040060 image: "{{ template "cert-manager.image" (tuple .Values.startupapicheck.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }}"
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040061 imagePullPolicy: {{ .Values.startupapicheck.image.pullPolicy }}
62 args:
63 - check
64 - api
65 - --wait={{ .Values.startupapicheck.timeout }}
66 {{- with .Values.startupapicheck.extraArgs }}
67 {{- toYaml . | nindent 10 }}
68 {{- end }}
69 {{- with .Values.startupapicheck.containerSecurityContext }}
70 securityContext:
71 {{- toYaml . | nindent 12 }}
72 {{- end }}
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040073 env:
74 - name: POD_NAMESPACE
75 valueFrom:
76 fieldRef:
77 fieldPath: metadata.namespace
78 {{- with .Values.startupapicheck.extraEnv }}
79 {{- toYaml . | nindent 10 }}
80 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040081 {{- with .Values.startupapicheck.resources }}
82 resources:
83 {{- toYaml . | nindent 12 }}
84 {{- end }}
85 {{- with .Values.startupapicheck.volumeMounts }}
86 volumeMounts:
87 {{- toYaml . | nindent 12 }}
88 {{- end }}
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040089 {{- if .Values.startupapicheck.runtimeClassName }}
90 runtimeClassName: {{ .Values.startupapicheck.runtimeClassName | quote }}
91 {{- else if .Values.global.runtimeClassName }}
92 runtimeClassName: {{ .Values.global.runtimeClassName | quote }}
93 {{- end }}
94 {{- $nodeSelector := .Values.global.nodeSelector | default dict }}
95 {{- $nodeSelector = merge $nodeSelector (.Values.startupapicheck.nodeSelector | default dict) }}
96 {{- with $nodeSelector }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040097 nodeSelector:
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040098 {{- range $key, $value := . }}
99 {{ $key }}: {{ $value | quote }}
100 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400101 {{- end }}
102 {{- with .Values.startupapicheck.affinity }}
103 affinity:
104 {{- toYaml . | nindent 8 }}
105 {{- end }}
106 {{- with .Values.startupapicheck.tolerations }}
107 tolerations:
108 {{- toYaml . | nindent 8 }}
109 {{- end }}
110 {{- with .Values.startupapicheck.volumes }}
111 volumes:
112 {{- toYaml . | nindent 8 }}
113 {{- end }}
114{{- end }}