blob: 7f1b0ff8d4a65ea324e67e0832793501cebc4567 [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 }}
gio33d62932026-07-23 16:39:35 +040040 enableServiceLinks: {{ .Values.startupapicheck.enableServiceLinks }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040041 {{- with .Values.global.priorityClassName }}
42 priorityClassName: {{ . | quote }}
43 {{- end }}
giod55d03a2026-07-23 16:57:48 +040044 {{- if (hasKey .Values.global "hostUsers") }}
45 hostUsers: {{ .Values.global.hostUsers }}
46 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040047 {{- with .Values.startupapicheck.securityContext }}
48 securityContext:
49 {{- toYaml . | nindent 8 }}
50 {{- end }}
gio15aa6632026-07-23 17:14:23 +040051 {{- with .Values.global.imagePullSecrets }}
52 imagePullSecrets:
53 {{- toYaml . | nindent 8 }}
54 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040055 containers:
56 - name: {{ .Chart.Name }}-startupapicheck
gio15aa6632026-07-23 17:14:23 +040057 image: "{{ template "image" (tuple .Values.startupapicheck.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }}"
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040058 imagePullPolicy: {{ .Values.startupapicheck.image.pullPolicy }}
59 args:
60 - check
61 - api
62 - --wait={{ .Values.startupapicheck.timeout }}
63 {{- with .Values.startupapicheck.extraArgs }}
64 {{- toYaml . | nindent 10 }}
65 {{- end }}
66 {{- with .Values.startupapicheck.containerSecurityContext }}
67 securityContext:
68 {{- toYaml . | nindent 12 }}
69 {{- end }}
gio33d62932026-07-23 16:39:35 +040070 env:
71 - name: POD_NAMESPACE
72 valueFrom:
73 fieldRef:
74 fieldPath: metadata.namespace
75 {{- with .Values.startupapicheck.extraEnv }}
76 {{- toYaml . | nindent 10 }}
77 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040078 {{- with .Values.startupapicheck.resources }}
79 resources:
80 {{- toYaml . | nindent 12 }}
81 {{- end }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +040082 {{- with .Values.startupapicheck.volumeMounts }}
83 volumeMounts:
84 {{- toYaml . | nindent 12 }}
85 {{- end }}
giod55d03a2026-07-23 16:57:48 +040086 {{- $nodeSelector := .Values.global.nodeSelector | default dict }}
87 {{- $nodeSelector = merge $nodeSelector (.Values.startupapicheck.nodeSelector | default dict) }}
88 {{- with $nodeSelector }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040089 nodeSelector:
giob6e9f2f2026-07-23 16:53:10 +040090 {{- range $key, $value := . }}
91 {{ $key }}: {{ $value | quote }}
92 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040093 {{- end }}
94 {{- with .Values.startupapicheck.affinity }}
95 affinity:
96 {{- toYaml . | nindent 8 }}
97 {{- end }}
98 {{- with .Values.startupapicheck.tolerations }}
99 tolerations:
100 {{- toYaml . | nindent 8 }}
101 {{- end }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +0400102 {{- with .Values.startupapicheck.volumes }}
103 volumes:
104 {{- toYaml . | nindent 8 }}
105 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400106{{- end }}