blob: d504dbdd89ded53f2f7dcd3df49253f4770c6a1e [file] [log] [blame]
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +04001apiVersion: batch/v1
2kind: Job
3metadata:
4 annotations:
5 "helm.sh/hook": post-upgrade
6 "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
7 name: longhorn-post-upgrade
8 namespace: {{ include "release_namespace" . }}
9 labels: {{- include "longhorn.labels" . | nindent 4 }}
10spec:
11 activeDeadlineSeconds: 900
12 backoffLimit: 1
13 template:
14 metadata:
15 name: longhorn-post-upgrade
16 labels: {{- include "longhorn.labels" . | nindent 8 }}
17 spec:
18 containers:
19 - name: longhorn-post-upgrade
gio3e1b96b2026-07-21 18:52:35 +040020 image: {{ with (coalesce .Values.global.imageRegistry (include "registry_url" .) .Values.image.longhorn.manager.registry) }}{{ . }}/{{ end }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040021 imagePullPolicy: {{ .Values.image.pullPolicy }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040022 command:
23 - longhorn-manager
24 - post-upgrade
25 env:
26 - name: POD_NAMESPACE
27 valueFrom:
28 fieldRef:
29 fieldPath: metadata.namespace
gio3e1b96b2026-07-21 18:52:35 +040030 {{- include "longhorn.timezoneEnv" . | nindent 8 }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040031 restartPolicy: OnFailure
gio3e1b96b2026-07-21 18:52:35 +040032 {{- with (coalesce .Values.global.imagePullSecrets .Values.privateRegistry.registrySecret) }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040033 imagePullSecrets:
gio3e1b96b2026-07-21 18:52:35 +040034 {{- $imagePullSecrets := list }}
35 {{- if kindIs "string" . }}
36 {{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) }}
37 {{- else }}
38 {{- range . }}
39 {{- if kindIs "string" . }}
40 {{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) }}
41 {{- else }}
42 {{- $imagePullSecrets = append $imagePullSecrets . }}
43 {{- end }}
44 {{- end }}
45 {{- end }}
46 {{- toYaml $imagePullSecrets | nindent 8 }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040047 {{- end }}
48 {{- if .Values.longhornManager.priorityClass }}
49 priorityClassName: {{ .Values.longhornManager.priorityClass | quote }}
50 {{- end }}
51 serviceAccountName: longhorn-service-account
gio16bb6382025-05-21 18:42:40 +040052 {{- if or .Values.global.tolerations .Values.longhornManager.tolerations .Values.global.cattle.windowsCluster.enabled }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040053 tolerations:
54 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }}
55{{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }}
56 {{- end }}
gio16bb6382025-05-21 18:42:40 +040057 {{- if or .Values.global.tolerations .Values.longhornManager.tolerations }}
58{{ default .Values.global.tolerations .Values.longhornManager.tolerations | toYaml | indent 6 }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040059 {{- end }}
60 {{- end }}
gio16bb6382025-05-21 18:42:40 +040061 {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector .Values.global.cattle.windowsCluster.enabled }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040062 nodeSelector:
63 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }}
64{{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }}
65 {{- end }}
gio16bb6382025-05-21 18:42:40 +040066 {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector }}
67{{ default .Values.global.nodeSelector .Values.longhornManager.nodeSelector | toYaml | indent 8 }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040068 {{- end }}
69 {{- end }}