| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 1 | {{- if .Values.startupapicheck.enabled }} |
| 2 | apiVersion: batch/v1 |
| 3 | kind: Job |
| 4 | metadata: |
| 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 }} |
| 17 | spec: |
| 18 | backoffLimit: {{ .Values.startupapicheck.backoffLimit }} |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 19 | {{- if hasKey .Values.startupapicheck "ttlSecondsAfterFinished" }} |
| 20 | ttlSecondsAfterFinished: {{ .Values.startupapicheck.ttlSecondsAfterFinished }} |
| 21 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 22 | 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" . }} |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 40 | {{- if hasKey .Values.startupapicheck "automountServiceAccountToken" }} |
| 41 | automountServiceAccountToken: {{ .Values.startupapicheck.automountServiceAccountToken }} |
| 42 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 43 | enableServiceLinks: {{ .Values.startupapicheck.enableServiceLinks }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 44 | {{- with .Values.global.priorityClassName }} |
| 45 | priorityClassName: {{ . | quote }} |
| 46 | {{- end }} |
| gio | d55d03a | 2026-07-23 16:57:48 +0400 | [diff] [blame] | 47 | {{- if (hasKey .Values.global "hostUsers") }} |
| 48 | hostUsers: {{ .Values.global.hostUsers }} |
| 49 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 50 | {{- with .Values.startupapicheck.securityContext }} |
| 51 | securityContext: |
| 52 | {{- toYaml . | nindent 8 }} |
| 53 | {{- end }} |
| gio | 15aa663 | 2026-07-23 17:14:23 +0400 | [diff] [blame] | 54 | {{- with .Values.global.imagePullSecrets }} |
| 55 | imagePullSecrets: |
| 56 | {{- toYaml . | nindent 8 }} |
| 57 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 58 | containers: |
| 59 | - name: {{ .Chart.Name }}-startupapicheck |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 60 | image: "{{ template "cert-manager.image" (tuple .Values.startupapicheck.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }}" |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 61 | 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 }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 73 | 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 Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 81 | {{- with .Values.startupapicheck.resources }} |
| 82 | resources: |
| 83 | {{- toYaml . | nindent 12 }} |
| 84 | {{- end }} |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 85 | {{- with .Values.startupapicheck.volumeMounts }} |
| 86 | volumeMounts: |
| 87 | {{- toYaml . | nindent 12 }} |
| 88 | {{- end }} |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 89 | {{- if .Values.startupapicheck.runtimeClassName }} |
| 90 | runtimeClassName: {{ .Values.startupapicheck.runtimeClassName | quote }} |
| 91 | {{- else if .Values.global.runtimeClassName }} |
| 92 | runtimeClassName: {{ .Values.global.runtimeClassName | quote }} |
| 93 | {{- end }} |
| gio | d55d03a | 2026-07-23 16:57:48 +0400 | [diff] [blame] | 94 | {{- $nodeSelector := .Values.global.nodeSelector | default dict }} |
| 95 | {{- $nodeSelector = merge $nodeSelector (.Values.startupapicheck.nodeSelector | default dict) }} |
| 96 | {{- with $nodeSelector }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 97 | nodeSelector: |
| gio | b6e9f2f | 2026-07-23 16:53:10 +0400 | [diff] [blame] | 98 | {{- range $key, $value := . }} |
| 99 | {{ $key }}: {{ $value | quote }} |
| 100 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 101 | {{- 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 }} |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 110 | {{- with .Values.startupapicheck.volumes }} |
| 111 | volumes: |
| 112 | {{- toYaml . | nindent 8 }} |
| 113 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 114 | {{- end }} |