blob: f361d27340503e1560ab747ed362ab61401fd431 [file] [log] [blame]
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +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:
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040021 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
48 ports:
49 - containerPort: 9500
50 name: manager
Giorgi Lekveishvili285ab622023-11-22 13:50:45 +040051 - containerPort: 9501
52 name: conversion-wh
53 - containerPort: 9502
54 name: admission-wh
55 - containerPort: 9503
56 name: recov-backend
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040057 readinessProbe:
Giorgi Lekveishvili285ab622023-11-22 13:50:45 +040058 httpGet:
59 path: /v1/healthz
60 port: 9501
61 scheme: HTTPS
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040062 volumeMounts:
63 - name: dev
64 mountPath: /host/dev/
65 - name: proc
66 mountPath: /host/proc/
67 - name: longhorn
68 mountPath: /var/lib/longhorn/
69 mountPropagation: Bidirectional
70 - name: longhorn-grpc-tls
71 mountPath: /tls-files/
72 env:
73 - name: POD_NAMESPACE
74 valueFrom:
75 fieldRef:
76 fieldPath: metadata.namespace
77 - name: POD_IP
78 valueFrom:
79 fieldRef:
80 fieldPath: status.podIP
81 - name: NODE_NAME
82 valueFrom:
83 fieldRef:
84 fieldPath: spec.nodeName
85 volumes:
86 - name: dev
87 hostPath:
88 path: /dev/
89 - name: proc
90 hostPath:
91 path: /proc/
92 - name: longhorn
93 hostPath:
94 path: /var/lib/longhorn/
95 - name: longhorn-grpc-tls
96 secret:
97 secretName: longhorn-grpc-tls
98 optional: true
99 {{- if .Values.privateRegistry.registrySecret }}
100 imagePullSecrets:
101 - name: {{ .Values.privateRegistry.registrySecret }}
102 {{- end }}
103 {{- if .Values.longhornManager.priorityClass }}
104 priorityClassName: {{ .Values.longhornManager.priorityClass | quote }}
105 {{- end }}
106 {{- if or .Values.longhornManager.tolerations .Values.global.cattle.windowsCluster.enabled }}
107 tolerations:
108 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }}
109{{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }}
110 {{- end }}
111 {{- if .Values.longhornManager.tolerations }}
112{{ toYaml .Values.longhornManager.tolerations | indent 6 }}
113 {{- end }}
114 {{- end }}
115 {{- if or .Values.longhornManager.nodeSelector .Values.global.cattle.windowsCluster.enabled }}
116 nodeSelector:
117 {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }}
118{{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }}
119 {{- end }}
120 {{- if .Values.longhornManager.nodeSelector }}
121{{ toYaml .Values.longhornManager.nodeSelector | indent 8 }}
122 {{- end }}
123 {{- end }}
124 serviceAccountName: longhorn-service-account
125 updateStrategy:
126 rollingUpdate:
127 maxUnavailable: "100%"
128---
129apiVersion: v1
130kind: Service
131metadata:
132 labels: {{- include "longhorn.labels" . | nindent 4 }}
133 app: longhorn-manager
134 name: longhorn-backend
135 namespace: {{ include "release_namespace" . }}
136 {{- if .Values.longhornManager.serviceAnnotations }}
137 annotations:
138{{ toYaml .Values.longhornManager.serviceAnnotations | indent 4 }}
139 {{- end }}
140spec:
141 type: {{ .Values.service.manager.type }}
142 sessionAffinity: ClientIP
143 selector:
144 app: longhorn-manager
145 ports:
146 - name: manager
147 port: 9500
148 targetPort: manager
149 {{- if .Values.service.manager.nodePort }}
150 nodePort: {{ .Values.service.manager.nodePort }}
151 {{- end }}