| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 1 | apiVersion: apps/v1 |
| 2 | kind: Deployment |
| 3 | metadata: |
| 4 | labels: {{- include "longhorn.labels" . | nindent 4 }} |
| 5 | app: longhorn-recovery-backend |
| 6 | name: longhorn-recovery-backend |
| 7 | namespace: {{ include "release_namespace" . }} |
| 8 | spec: |
| 9 | replicas: {{ .Values.longhornRecoveryBackend.replicas }} |
| 10 | selector: |
| 11 | matchLabels: |
| 12 | app: longhorn-recovery-backend |
| 13 | template: |
| 14 | metadata: |
| 15 | labels: {{- include "longhorn.labels" . | nindent 8 }} |
| 16 | app: longhorn-recovery-backend |
| 17 | spec: |
| 18 | affinity: |
| 19 | podAntiAffinity: |
| 20 | preferredDuringSchedulingIgnoredDuringExecution: |
| 21 | - weight: 1 |
| 22 | podAffinityTerm: |
| 23 | labelSelector: |
| 24 | matchExpressions: |
| 25 | - key: app |
| 26 | operator: In |
| 27 | values: |
| 28 | - longhorn-recovery-backend |
| 29 | topologyKey: kubernetes.io/hostname |
| 30 | containers: |
| 31 | - name: longhorn-recovery-backend |
| 32 | image: {{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }} |
| 33 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 34 | securityContext: |
| 35 | runAsUser: 2000 |
| 36 | command: |
| 37 | - longhorn-manager |
| 38 | - recovery-backend |
| 39 | - --service-account |
| 40 | - longhorn-service-account |
| 41 | ports: |
| 42 | - containerPort: 9600 |
| 43 | name: recov-backend |
| 44 | readinessProbe: |
| 45 | tcpSocket: |
| 46 | port: 9600 |
| 47 | initialDelaySeconds: 3 |
| 48 | periodSeconds: 5 |
| 49 | env: |
| 50 | - name: POD_NAMESPACE |
| 51 | valueFrom: |
| 52 | fieldRef: |
| 53 | fieldPath: metadata.namespace |
| 54 | - name: NODE_NAME |
| 55 | valueFrom: |
| 56 | fieldRef: |
| 57 | fieldPath: spec.nodeName |
| 58 | {{- if .Values.privateRegistry.registrySecret }} |
| 59 | imagePullSecrets: |
| 60 | - name: {{ .Values.privateRegistry.registrySecret }} |
| 61 | {{- end }} |
| 62 | {{- if .Values.longhornRecoveryBackend.priorityClass }} |
| 63 | priorityClassName: {{ .Values.longhornRecoveryBackend.priorityClass | quote }} |
| 64 | {{- end }} |
| 65 | {{- if or .Values.longhornRecoveryBackend.tolerations .Values.global.cattle.windowsCluster.enabled }} |
| 66 | tolerations: |
| 67 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }} |
| 68 | {{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }} |
| 69 | {{- end }} |
| 70 | {{- if .Values.longhornRecoveryBackend.tolerations }} |
| 71 | {{ toYaml .Values.longhornRecoveryBackend.tolerations | indent 6 }} |
| 72 | {{- end }} |
| 73 | {{- end }} |
| 74 | {{- if or .Values.longhornRecoveryBackend.nodeSelector .Values.global.cattle.windowsCluster.enabled }} |
| 75 | nodeSelector: |
| 76 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }} |
| 77 | {{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }} |
| 78 | {{- end }} |
| 79 | {{- if .Values.longhornRecoveryBackend.nodeSelector }} |
| 80 | {{ toYaml .Values.longhornRecoveryBackend.nodeSelector | indent 8 }} |
| 81 | {{- end }} |
| 82 | {{- end }} |
| 83 | serviceAccountName: longhorn-service-account |