| Giorgi Lekveishvili | 193b7c0 | 2025-05-22 16:21:37 +0400 | [diff] [blame^] | 1 | apiVersion: apps/v1 |
| 2 | kind: Deployment |
| 3 | metadata: |
| 4 | name: longhorn-driver-deployer |
| 5 | namespace: {{ include "release_namespace" . }} |
| 6 | labels: {{- include "longhorn.labels" . | nindent 4 }} |
| 7 | spec: |
| 8 | replicas: 1 |
| 9 | selector: |
| 10 | matchLabels: |
| 11 | app: longhorn-driver-deployer |
| 12 | template: |
| 13 | metadata: |
| 14 | labels: {{- include "longhorn.labels" . | nindent 8 }} |
| 15 | app: longhorn-driver-deployer |
| 16 | spec: |
| 17 | initContainers: |
| 18 | - name: wait-longhorn-manager |
| 19 | image: {{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }} |
| 20 | command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done'] |
| 21 | containers: |
| 22 | - name: longhorn-driver-deployer |
| 23 | image: {{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }} |
| 24 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 25 | command: |
| 26 | - longhorn-manager |
| 27 | - -d |
| 28 | - deploy-driver |
| 29 | - --manager-image |
| 30 | - "{{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }}" |
| 31 | - --manager-url |
| 32 | - http://longhorn-backend:9500/v1 |
| 33 | env: |
| 34 | - name: POD_NAMESPACE |
| 35 | valueFrom: |
| 36 | fieldRef: |
| 37 | fieldPath: metadata.namespace |
| 38 | - name: NODE_NAME |
| 39 | valueFrom: |
| 40 | fieldRef: |
| 41 | fieldPath: spec.nodeName |
| 42 | - name: SERVICE_ACCOUNT |
| 43 | valueFrom: |
| 44 | fieldRef: |
| 45 | fieldPath: spec.serviceAccountName |
| 46 | {{- if .Values.csi.kubeletRootDir }} |
| 47 | - name: KUBELET_ROOT_DIR |
| 48 | value: {{ .Values.csi.kubeletRootDir }} |
| 49 | {{- end }} |
| 50 | {{- if and .Values.image.csi.attacher.repository .Values.image.csi.attacher.tag }} |
| 51 | - name: CSI_ATTACHER_IMAGE |
| 52 | value: "{{ template "registry_url" . }}{{ .Values.image.csi.attacher.repository }}:{{ .Values.image.csi.attacher.tag }}" |
| 53 | {{- end }} |
| 54 | {{- if and .Values.image.csi.provisioner.repository .Values.image.csi.provisioner.tag }} |
| 55 | - name: CSI_PROVISIONER_IMAGE |
| 56 | value: "{{ template "registry_url" . }}{{ .Values.image.csi.provisioner.repository }}:{{ .Values.image.csi.provisioner.tag }}" |
| 57 | {{- end }} |
| 58 | {{- if and .Values.image.csi.nodeDriverRegistrar.repository .Values.image.csi.nodeDriverRegistrar.tag }} |
| 59 | - name: CSI_NODE_DRIVER_REGISTRAR_IMAGE |
| 60 | value: "{{ template "registry_url" . }}{{ .Values.image.csi.nodeDriverRegistrar.repository }}:{{ .Values.image.csi.nodeDriverRegistrar.tag }}" |
| 61 | {{- end }} |
| 62 | {{- if and .Values.image.csi.resizer.repository .Values.image.csi.resizer.tag }} |
| 63 | - name: CSI_RESIZER_IMAGE |
| 64 | value: "{{ template "registry_url" . }}{{ .Values.image.csi.resizer.repository }}:{{ .Values.image.csi.resizer.tag }}" |
| 65 | {{- end }} |
| 66 | {{- if and .Values.image.csi.snapshotter.repository .Values.image.csi.snapshotter.tag }} |
| 67 | - name: CSI_SNAPSHOTTER_IMAGE |
| 68 | value: "{{ template "registry_url" . }}{{ .Values.image.csi.snapshotter.repository }}:{{ .Values.image.csi.snapshotter.tag }}" |
| 69 | {{- end }} |
| 70 | {{- if and .Values.image.csi.livenessProbe.repository .Values.image.csi.livenessProbe.tag }} |
| 71 | - name: CSI_LIVENESS_PROBE_IMAGE |
| 72 | value: "{{ template "registry_url" . }}{{ .Values.image.csi.livenessProbe.repository }}:{{ .Values.image.csi.livenessProbe.tag }}" |
| 73 | {{- end }} |
| 74 | {{- if .Values.csi.attacherReplicaCount }} |
| 75 | - name: CSI_ATTACHER_REPLICA_COUNT |
| 76 | value: {{ .Values.csi.attacherReplicaCount | quote }} |
| 77 | {{- end }} |
| 78 | {{- if .Values.csi.provisionerReplicaCount }} |
| 79 | - name: CSI_PROVISIONER_REPLICA_COUNT |
| 80 | value: {{ .Values.csi.provisionerReplicaCount | quote }} |
| 81 | {{- end }} |
| 82 | {{- if .Values.csi.resizerReplicaCount }} |
| 83 | - name: CSI_RESIZER_REPLICA_COUNT |
| 84 | value: {{ .Values.csi.resizerReplicaCount | quote }} |
| 85 | {{- end }} |
| 86 | {{- if .Values.csi.snapshotterReplicaCount }} |
| 87 | - name: CSI_SNAPSHOTTER_REPLICA_COUNT |
| 88 | value: {{ .Values.csi.snapshotterReplicaCount | quote }} |
| 89 | {{- end }} |
| 90 | |
| 91 | {{- if .Values.privateRegistry.registrySecret }} |
| 92 | imagePullSecrets: |
| 93 | - name: {{ .Values.privateRegistry.registrySecret }} |
| 94 | {{- end }} |
| 95 | {{- if .Values.longhornDriver.priorityClass }} |
| 96 | priorityClassName: {{ .Values.longhornDriver.priorityClass | quote }} |
| 97 | {{- end }} |
| 98 | {{- if or .Values.longhornDriver.tolerations .Values.global.cattle.windowsCluster.enabled }} |
| 99 | tolerations: |
| 100 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }} |
| 101 | {{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }} |
| 102 | {{- end }} |
| 103 | {{- if .Values.longhornDriver.tolerations }} |
| 104 | {{ toYaml .Values.longhornDriver.tolerations | indent 6 }} |
| 105 | {{- end }} |
| 106 | {{- end }} |
| 107 | {{- if or .Values.longhornDriver.nodeSelector .Values.global.cattle.windowsCluster.enabled }} |
| 108 | nodeSelector: |
| 109 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }} |
| 110 | {{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }} |
| 111 | {{- end }} |
| 112 | {{- if .Values.longhornDriver.nodeSelector }} |
| 113 | {{ toYaml .Values.longhornDriver.nodeSelector | indent 8 }} |
| 114 | {{- end }} |
| 115 | {{- end }} |
| 116 | serviceAccountName: longhorn-service-account |
| 117 | securityContext: |
| 118 | runAsUser: 0 |