| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 1 | apiVersion: apps/v1 |
| 2 | kind: DaemonSet |
| 3 | metadata: |
| 4 | labels: {{- include "longhorn.labels" . | nindent 4 }} |
| 5 | app: longhorn-manager |
| 6 | name: longhorn-manager |
| 7 | namespace: {{ include "release_namespace" . }} |
| 8 | spec: |
| 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: |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 21 | containers: |
| 22 | - name: longhorn-manager |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 23 | 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 Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 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 |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 35 | - "{{ with (coalesce .Values.global.imageRegistry (include "registry_url" .) .Values.image.longhorn.engine.registry) }}{{ . }}/{{ end }}{{ .Values.image.longhorn.engine.repository }}:{{ .Values.image.longhorn.engine.tag }}" |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 36 | - --instance-manager-image |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 37 | - "{{ with (coalesce .Values.global.imageRegistry (include "registry_url" .) .Values.image.longhorn.instanceManager.registry) }}{{ . }}/{{ end }}{{ .Values.image.longhorn.instanceManager.repository }}:{{ .Values.image.longhorn.instanceManager.tag }}" |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 38 | - --share-manager-image |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 39 | - "{{ with (coalesce .Values.global.imageRegistry (include "registry_url" .) .Values.image.longhorn.shareManager.registry) }}{{ . }}/{{ end }}{{ .Values.image.longhorn.shareManager.repository }}:{{ .Values.image.longhorn.shareManager.tag }}" |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 40 | - --backing-image-manager-image |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 41 | - "{{ with (coalesce .Values.global.imageRegistry (include "registry_url" .) .Values.image.longhorn.backingImageManager.registry) }}{{ . }}/{{ end }}{{ .Values.image.longhorn.backingImageManager.repository }}:{{ .Values.image.longhorn.backingImageManager.tag }}" |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 42 | - --support-bundle-manager-image |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 43 | - "{{ with (coalesce .Values.global.imageRegistry (include "registry_url" .) .Values.image.longhorn.supportBundleKit.registry) }}{{ . }}/{{ end }}{{ .Values.image.longhorn.supportBundleKit.repository }}:{{ .Values.image.longhorn.supportBundleKit.tag }}" |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 44 | - --manager-image |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 45 | - "{{ 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 Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 46 | - --service-account |
| 47 | - longhorn-service-account |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 48 | {{- if .Values.preUpgradeChecker.upgradeVersionCheck}} |
| 49 | - --upgrade-version-check |
| 50 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 51 | ports: |
| 52 | - containerPort: 9500 |
| 53 | name: manager |
| Giorgi Lekveishvili | 285ab62 | 2023-11-22 13:50:45 +0400 | [diff] [blame] | 54 | - containerPort: 9502 |
| 55 | name: admission-wh |
| 56 | - containerPort: 9503 |
| 57 | name: recov-backend |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 58 | readinessProbe: |
| Giorgi Lekveishvili | 285ab62 | 2023-11-22 13:50:45 +0400 | [diff] [blame] | 59 | httpGet: |
| 60 | path: /v1/healthz |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 61 | port: 9502 |
| Giorgi Lekveishvili | 285ab62 | 2023-11-22 13:50:45 +0400 | [diff] [blame] | 62 | scheme: HTTPS |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 63 | volumeMounts: |
| gio | c9b92b1 | 2025-05-22 08:57:18 +0400 | [diff] [blame] | 64 | - name: boot |
| 65 | mountPath: /host/boot/ |
| 66 | readOnly: true |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 67 | - name: dev |
| 68 | mountPath: /host/dev/ |
| 69 | - name: proc |
| 70 | mountPath: /host/proc/ |
| gio | c9b92b1 | 2025-05-22 08:57:18 +0400 | [diff] [blame] | 71 | readOnly: true |
| 72 | - name: etc |
| 73 | mountPath: /host/etc/ |
| 74 | readOnly: true |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 75 | - name: longhorn |
| 76 | mountPath: /var/lib/longhorn/ |
| 77 | mountPropagation: Bidirectional |
| 78 | - name: longhorn-grpc-tls |
| 79 | mountPath: /tls-files/ |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 80 | {{- if .Values.enableGoCoverDir }} |
| 81 | - name: go-cover-dir |
| 82 | mountPath: /go-cover-dir/ |
| 83 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 84 | env: |
| gio | c9b92b1 | 2025-05-22 08:57:18 +0400 | [diff] [blame] | 85 | - name: POD_NAME |
| 86 | valueFrom: |
| 87 | fieldRef: |
| 88 | fieldPath: metadata.name |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 89 | - name: POD_NAMESPACE |
| 90 | valueFrom: |
| 91 | fieldRef: |
| 92 | fieldPath: metadata.namespace |
| 93 | - name: POD_IP |
| 94 | valueFrom: |
| 95 | fieldRef: |
| 96 | fieldPath: status.podIP |
| 97 | - name: NODE_NAME |
| 98 | valueFrom: |
| 99 | fieldRef: |
| 100 | fieldPath: spec.nodeName |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 101 | {{- if .Values.longhornManager.distro }} |
| 102 | - name: LONGHORN_DISTRO |
| 103 | value: {{ .Values.longhornManager.distro | quote }} |
| 104 | {{- end }} |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 105 | {{- if .Values.enableGoCoverDir }} |
| 106 | - name: GOCOVERDIR |
| 107 | value: /go-cover-dir/ |
| 108 | {{- end }} |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 109 | {{- include "longhorn.timezoneEnv" . | nindent 8 }} |
| 110 | {{- with .Values.longhornManager.resources }} |
| 111 | resources: |
| 112 | {{- toYaml . | nindent 10 }} |
| 113 | {{- end }} |
| gio | c9b92b1 | 2025-05-22 08:57:18 +0400 | [diff] [blame] | 114 | - name: pre-pull-share-manager-image |
| 115 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 116 | image: {{ with (coalesce .Values.global.imageRegistry (include "registry_url" .) .Values.image.longhorn.shareManager.registry) }}{{ . }}/{{ end }}{{ .Values.image.longhorn.shareManager.repository }}:{{ .Values.image.longhorn.shareManager.tag }} |
| gio | c9b92b1 | 2025-05-22 08:57:18 +0400 | [diff] [blame] | 117 | command: ["sh", "-c", "echo share-manager image pulled && sleep infinity"] |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 118 | volumes: |
| gio | c9b92b1 | 2025-05-22 08:57:18 +0400 | [diff] [blame] | 119 | - name: boot |
| 120 | hostPath: |
| 121 | path: /boot/ |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 122 | - name: dev |
| 123 | hostPath: |
| 124 | path: /dev/ |
| 125 | - name: proc |
| 126 | hostPath: |
| 127 | path: /proc/ |
| gio | c9b92b1 | 2025-05-22 08:57:18 +0400 | [diff] [blame] | 128 | - name: etc |
| 129 | hostPath: |
| 130 | path: /etc/ |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 131 | - name: longhorn |
| 132 | hostPath: |
| 133 | path: /var/lib/longhorn/ |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 134 | {{- if .Values.enableGoCoverDir }} |
| 135 | - name: go-cover-dir |
| 136 | hostPath: |
| 137 | path: /go-cover-dir/ |
| 138 | type: DirectoryOrCreate |
| 139 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 140 | - name: longhorn-grpc-tls |
| 141 | secret: |
| 142 | secretName: longhorn-grpc-tls |
| 143 | optional: true |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 144 | {{- with (coalesce .Values.global.imagePullSecrets .Values.privateRegistry.registrySecret) }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 145 | imagePullSecrets: |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 146 | {{- $imagePullSecrets := list }} |
| 147 | {{- if kindIs "string" . }} |
| 148 | {{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) }} |
| 149 | {{- else }} |
| 150 | {{- range . }} |
| 151 | {{- if kindIs "string" . }} |
| 152 | {{- $imagePullSecrets = append $imagePullSecrets (dict "name" .) }} |
| 153 | {{- else }} |
| 154 | {{- $imagePullSecrets = append $imagePullSecrets . }} |
| 155 | {{- end }} |
| 156 | {{- end }} |
| 157 | {{- end }} |
| 158 | {{- toYaml $imagePullSecrets | nindent 8 }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 159 | {{- end }} |
| 160 | {{- if .Values.longhornManager.priorityClass }} |
| 161 | priorityClassName: {{ .Values.longhornManager.priorityClass | quote }} |
| 162 | {{- end }} |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 163 | {{- if or .Values.global.tolerations .Values.longhornManager.tolerations .Values.global.cattle.windowsCluster.enabled }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 164 | tolerations: |
| 165 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }} |
| 166 | {{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }} |
| 167 | {{- end }} |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 168 | {{- if or .Values.global.tolerations .Values.longhornManager.tolerations }} |
| 169 | {{ default .Values.global.tolerations .Values.longhornManager.tolerations | toYaml | indent 6 }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 170 | {{- end }} |
| 171 | {{- end }} |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 172 | {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector .Values.global.cattle.windowsCluster.enabled }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 173 | nodeSelector: |
| 174 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }} |
| 175 | {{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }} |
| 176 | {{- end }} |
| gio | 16bb638 | 2025-05-21 18:42:40 +0400 | [diff] [blame] | 177 | {{- if or .Values.global.nodeSelector .Values.longhornManager.nodeSelector }} |
| 178 | {{ default .Values.global.nodeSelector .Values.longhornManager.nodeSelector | toYaml | indent 8 }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 179 | {{- end }} |
| 180 | {{- end }} |
| 181 | serviceAccountName: longhorn-service-account |
| 182 | updateStrategy: |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 183 | {{ toYaml .Values.longhornManager.updateStrategy | indent 4 }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 184 | --- |
| 185 | apiVersion: v1 |
| 186 | kind: Service |
| 187 | metadata: |
| 188 | labels: {{- include "longhorn.labels" . | nindent 4 }} |
| 189 | app: longhorn-manager |
| gio | 3e1b96b | 2026-07-21 18:52:35 +0400 | [diff] [blame^] | 190 | {{- with .Values.longhornManager.serviceLabels }} |
| 191 | {{- toYaml . | nindent 4 }} |
| 192 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 193 | name: longhorn-backend |
| 194 | namespace: {{ include "release_namespace" . }} |
| 195 | {{- if .Values.longhornManager.serviceAnnotations }} |
| 196 | annotations: |
| 197 | {{ toYaml .Values.longhornManager.serviceAnnotations | indent 4 }} |
| 198 | {{- end }} |
| 199 | spec: |
| 200 | type: {{ .Values.service.manager.type }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 201 | selector: |
| 202 | app: longhorn-manager |
| 203 | ports: |
| 204 | - name: manager |
| 205 | port: 9500 |
| 206 | targetPort: manager |
| 207 | {{- if .Values.service.manager.nodePort }} |
| 208 | nodePort: {{ .Values.service.manager.nodePort }} |
| 209 | {{- end }} |