blob: 0bba12034abd1e8733123b518111eec28021dae0 [file] [log] [blame]
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +04001apiVersion: apps/v1
2kind: DaemonSet
3metadata:
4 labels: {{- include "longhorn.labels" . | nindent 4 }}
5 app: longhorn-manager
6 name: longhorn-manager
7 namespace: {{ include "release_namespace" . }}
8spec:
9 selector:
10 matchLabels:
11 app: longhorn-manager
12 template:
13 metadata:
14 labels: {{- include "longhorn.labels" . | nindent 8 }}
15 app: longhorn-manager
16 {{- with .Values.annotations }}
17 annotations:
18 {{- toYaml . | nindent 8 }}
19 {{- end }}
20 spec:
21 containers:
22 - name: longhorn-manager
23 image: {{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }}
24 imagePullPolicy: {{ .Values.image.pullPolicy }}
25 securityContext:
26 privileged: true
27 command:
28 - longhorn-manager
29 - -d
30 {{- if eq .Values.longhornManager.log.format "json" }}
31 - -j
32 {{- end }}
33 - daemon
34 - --engine-image
35 - "{{ template "registry_url" . }}{{ .Values.image.longhorn.engine.repository }}:{{ .Values.image.longhorn.engine.tag }}"
36 - --instance-manager-image
37 - "{{ template "registry_url" . }}{{ .Values.image.longhorn.instanceManager.repository }}:{{ .Values.image.longhorn.instanceManager.tag }}"
38 - --share-manager-image
39 - "{{ template "registry_url" . }}{{ .Values.image.longhorn.shareManager.repository }}:{{ .Values.image.longhorn.shareManager.tag }}"
40 - --backing-image-manager-image
41 - "{{ template "registry_url" . }}{{ .Values.image.longhorn.backingImageManager.repository }}:{{ .Values.image.longhorn.backingImageManager.tag }}"
42 - --support-bundle-manager-image
43 - "{{ template "registry_url" . }}{{ .Values.image.longhorn.supportBundleKit.repository }}:{{ .Values.image.longhorn.supportBundleKit.tag }}"
44 - --manager-image
45 - "{{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }}"
46 - --service-account
47 - longhorn-service-account
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040048 {{- if .Values.preUpgradeChecker.upgradeVersionCheck}}
49 - --upgrade-version-check
50 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040051 ports:
52 - containerPort: 9500
53 name: manager
54 - containerPort: 9501
55 name: conversion-wh
56 - containerPort: 9502
57 name: admission-wh
58 - containerPort: 9503
59 name: recov-backend
60 readinessProbe:
61 httpGet:
62 path: /v1/healthz
63 port: 9501
64 scheme: HTTPS
65 volumeMounts:
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040066 - name: boot
67 mountPath: /host/boot/
68 readOnly: true
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040069 - name: dev
70 mountPath: /host/dev/
71 - name: proc
72 mountPath: /host/proc/
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040073 readOnly: true
74 - name: etc
75 mountPath: /host/etc/
76 readOnly: true
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040077 - name: longhorn
78 mountPath: /var/lib/longhorn/
79 mountPropagation: Bidirectional
80 - name: longhorn-grpc-tls
81 mountPath: /tls-files/
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040082 {{- if .Values.enableGoCoverDir }}
83 - name: go-cover-dir
84 mountPath: /go-cover-dir/
85 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040086 env:
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +040087 - name: POD_NAME
88 valueFrom:
89 fieldRef:
90 fieldPath: metadata.name
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040091 - name: POD_NAMESPACE
92 valueFrom:
93 fieldRef:
94 fieldPath: metadata.namespace
95 - name: POD_IP
96 valueFrom:
97 fieldRef:
98 fieldPath: status.podIP
99 - name: NODE_NAME
100 valueFrom:
101 fieldRef:
102 fieldPath: spec.nodeName
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400103 {{- if .Values.enableGoCoverDir }}
104 - name: GOCOVERDIR
105 value: /go-cover-dir/
106 {{- end }}
107 - name: pre-pull-share-manager-image
108 imagePullPolicy: {{ .Values.image.pullPolicy }}
109 image: {{ template "registry_url" . }}{{ .Values.image.longhorn.shareManager.repository }}:{{ .Values.image.longhorn.shareManager.tag }}
110 command: ["sh", "-c", "echo share-manager image pulled && sleep infinity"]
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400111 volumes:
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400112 - name: boot
113 hostPath:
114 path: /boot/
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400115 - name: dev
116 hostPath:
117 path: /dev/
118 - name: proc
119 hostPath:
120 path: /proc/
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400121 - name: etc
122 hostPath:
123 path: /etc/
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400124 - name: longhorn
125 hostPath:
126 path: /var/lib/longhorn/
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400127 {{- if .Values.enableGoCoverDir }}
128 - name: go-cover-dir
129 hostPath:
130 path: /go-cover-dir/
131 type: DirectoryOrCreate
132 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400133 - name: longhorn-grpc-tls
134 secret:
135 secretName: longhorn-grpc-tls
136 optional: true
137 {{- if .Values.privateRegistry.registrySecret }}
138 imagePullSecrets:
139 - name: {{ .Values.privateRegistry.registrySecret }}
140 {{- end }}
141 {{- if .Values.longhornManager.priorityClass }}
142 priorityClassName: {{ .Values.longhornManager.priorityClass | quote }}
143 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400144 {{- if or .Values.global.tolerations .Values.longhornManager.tolerations .Values.global.cattle.windowsCluster.enabled }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400145 tolerations:
146 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }}
147{{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }}
148 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400149 {{- if or .Values.global.tolerations .Values.longhornManager.tolerations }}
150{{ default .Values.global.tolerations .Values.longhornManager.tolerations | toYaml | indent 6 }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400151 {{- end }}
152 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400153 {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector .Values.global.cattle.windowsCluster.enabled }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400154 nodeSelector:
155 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }}
156{{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }}
157 {{- end }}
Giorgi Lekveishvili193b7c02025-05-22 16:21:37 +0400158 {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector }}
159{{ default .Values.global.nodeSelector .Values.longhornManager.nodeSelector | toYaml | indent 8 }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400160 {{- end }}
161 {{- end }}
162 serviceAccountName: longhorn-service-account
163 updateStrategy:
164 rollingUpdate:
165 maxUnavailable: "100%"
166---
167apiVersion: v1
168kind: Service
169metadata:
170 labels: {{- include "longhorn.labels" . | nindent 4 }}
171 app: longhorn-manager
172 name: longhorn-backend
173 namespace: {{ include "release_namespace" . }}
174 {{- if .Values.longhornManager.serviceAnnotations }}
175 annotations:
176{{ toYaml .Values.longhornManager.serviceAnnotations | indent 4 }}
177 {{- end }}
178spec:
179 type: {{ .Values.service.manager.type }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400180 selector:
181 app: longhorn-manager
182 ports:
183 - name: manager
184 port: 9500
185 targetPort: manager
186 {{- if .Values.service.manager.nodePort }}
187 nodePort: {{ .Values.service.manager.nodePort }}
188 {{- end }}