blob: 9f7a8a6aa63e621aceeaeff819587e82c2a733ae [file] [log] [blame]
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +04001{{- if and .Values.preUpgradeChecker.jobEnabled .Values.preUpgradeChecker.upgradeVersionCheck}}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +04002apiVersion: batch/v1
3kind: Job
4metadata:
5 annotations:
6 "helm.sh/hook": pre-upgrade
7 "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation,hook-failed
8 name: longhorn-pre-upgrade
9 namespace: {{ include "release_namespace" . }}
10 labels: {{- include "longhorn.labels" . | nindent 4 }}
11spec:
12 activeDeadlineSeconds: 900
13 backoffLimit: 1
14 template:
15 metadata:
16 name: longhorn-pre-upgrade
17 labels: {{- include "longhorn.labels" . | nindent 8 }}
18 spec:
19 containers:
20 - name: longhorn-pre-upgrade
21 image: {{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }}
22 imagePullPolicy: {{ .Values.image.pullPolicy }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040023 securityContext:
24 privileged: true
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040025 command:
26 - longhorn-manager
27 - pre-upgrade
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040028 volumeMounts:
29 - name: proc
30 mountPath: /host/proc/
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040031 env:
32 - name: POD_NAMESPACE
33 valueFrom:
34 fieldRef:
35 fieldPath: metadata.namespace
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040036 volumes:
37 - name: proc
38 hostPath:
39 path: /proc/
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040040 restartPolicy: OnFailure
41 {{- if .Values.privateRegistry.registrySecret }}
42 imagePullSecrets:
43 - name: {{ .Values.privateRegistry.registrySecret }}
44 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040045 serviceAccountName: longhorn-service-account
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040046 {{- if or .Values.global.tolerations .Values.longhornManager.tolerations .Values.global.cattle.windowsCluster.enabled }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040047 tolerations:
48 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }}
49{{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }}
50 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040051 {{- if or .Values.global.tolerations .Values.longhornManager.tolerations }}
52{{ default .Values.global.tolerations .Values.longhornManager.tolerations | toYaml | indent 6 }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040053 {{- end }}
54 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040055 {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector .Values.global.cattle.windowsCluster.enabled }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040056 nodeSelector:
57 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }}
58{{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }}
59 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040060 {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector }}
61{{ default .Values.global.nodeSelector .Values.longhornManager.nodeSelector | toYaml | indent 8 }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040062 {{- end }}
63 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040064{{- end }}