| gio | c895c1d | 2026-07-23 17:18:25 +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 }} |
| 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 | {{- with .Values.global.imagePullSecrets }} |
| 52 | imagePullSecrets: |
| 53 | {{- toYaml . | nindent 8 }} |
| 54 | {{- end }} |
| 55 | containers: |
| 56 | - name: {{ .Chart.Name }}-startupapicheck |
| 57 | image: "{{ template "image" (tuple .Values.startupapicheck.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }}" |
| 58 | 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 }} |
| 70 | env: |
| 71 | - name: POD_NAMESPACE |
| 72 | valueFrom: |
| 73 | fieldRef: |
| 74 | fieldPath: metadata.namespace |
| 75 | {{- with .Values.startupapicheck.extraEnv }} |
| 76 | {{- toYaml . | nindent 10 }} |
| 77 | {{- end }} |
| 78 | {{- with .Values.startupapicheck.resources }} |
| 79 | resources: |
| 80 | {{- toYaml . | nindent 12 }} |
| 81 | {{- end }} |
| 82 | {{- with .Values.startupapicheck.volumeMounts }} |
| 83 | volumeMounts: |
| 84 | {{- toYaml . | nindent 12 }} |
| 85 | {{- end }} |
| 86 | {{- $nodeSelector := .Values.global.nodeSelector | default dict }} |
| 87 | {{- $nodeSelector = merge $nodeSelector (.Values.startupapicheck.nodeSelector | default dict) }} |
| 88 | {{- with $nodeSelector }} |
| 89 | nodeSelector: |
| 90 | {{- range $key, $value := . }} |
| 91 | {{ $key }}: {{ $value | quote }} |
| 92 | {{- end }} |
| 93 | {{- 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 }} |
| 102 | {{- with .Values.startupapicheck.volumes }} |
| 103 | volumes: |
| 104 | {{- toYaml . | nindent 8 }} |
| 105 | {{- end }} |
| 106 | {{- end }} |