| 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-ui |
| 6 | name: longhorn-ui |
| 7 | namespace: {{ include "release_namespace" . }} |
| 8 | spec: |
| 9 | replicas: {{ .Values.longhornUI.replicas }} |
| 10 | selector: |
| 11 | matchLabels: |
| 12 | app: longhorn-ui |
| 13 | template: |
| 14 | metadata: |
| 15 | labels: {{- include "longhorn.labels" . | nindent 8 }} |
| 16 | app: longhorn-ui |
| 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-ui |
| 29 | topologyKey: kubernetes.io/hostname |
| 30 | containers: |
| 31 | - name: longhorn-ui |
| 32 | image: {{ template "registry_url" . }}{{ .Values.image.longhorn.ui.repository }}:{{ .Values.image.longhorn.ui.tag }} |
| 33 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 34 | volumeMounts: |
| 35 | - name : nginx-cache |
| 36 | mountPath: /var/cache/nginx/ |
| 37 | - name : nginx-config |
| 38 | mountPath: /var/config/nginx/ |
| 39 | - name: var-run |
| 40 | mountPath: /var/run/ |
| 41 | ports: |
| 42 | - containerPort: 8000 |
| 43 | name: http |
| 44 | env: |
| 45 | - name: LONGHORN_MANAGER_IP |
| 46 | value: "http://longhorn-backend:9500" |
| 47 | - name: LONGHORN_UI_PORT |
| 48 | value: "8000" |
| 49 | volumes: |
| 50 | - emptyDir: {} |
| 51 | name: nginx-cache |
| 52 | - emptyDir: {} |
| 53 | name: nginx-config |
| 54 | - emptyDir: {} |
| 55 | name: var-run |
| 56 | {{- if .Values.privateRegistry.registrySecret }} |
| 57 | imagePullSecrets: |
| 58 | - name: {{ .Values.privateRegistry.registrySecret }} |
| 59 | {{- end }} |
| 60 | {{- if .Values.longhornUI.priorityClass }} |
| 61 | priorityClassName: {{ .Values.longhornUI.priorityClass | quote }} |
| 62 | {{- end }} |
| 63 | {{- if or .Values.longhornUI.tolerations .Values.global.cattle.windowsCluster.enabled }} |
| 64 | tolerations: |
| 65 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }} |
| 66 | {{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }} |
| 67 | {{- end }} |
| 68 | {{- if .Values.longhornUI.tolerations }} |
| 69 | {{ toYaml .Values.longhornUI.tolerations | indent 6 }} |
| 70 | {{- end }} |
| 71 | {{- end }} |
| 72 | {{- if or .Values.longhornUI.nodeSelector .Values.global.cattle.windowsCluster.enabled }} |
| 73 | nodeSelector: |
| 74 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }} |
| 75 | {{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }} |
| 76 | {{- end }} |
| 77 | {{- if .Values.longhornUI.nodeSelector }} |
| 78 | {{ toYaml .Values.longhornUI.nodeSelector | indent 8 }} |
| 79 | {{- end }} |
| 80 | {{- end }} |
| 81 | --- |
| 82 | kind: Service |
| 83 | apiVersion: v1 |
| 84 | metadata: |
| 85 | labels: {{- include "longhorn.labels" . | nindent 4 }} |
| 86 | app: longhorn-ui |
| 87 | {{- if eq .Values.service.ui.type "Rancher-Proxy" }} |
| 88 | kubernetes.io/cluster-service: "true" |
| 89 | {{- end }} |
| 90 | name: longhorn-frontend |
| 91 | namespace: {{ include "release_namespace" . }} |
| 92 | spec: |
| 93 | {{- if eq .Values.service.ui.type "Rancher-Proxy" }} |
| 94 | type: ClusterIP |
| 95 | {{- else }} |
| 96 | type: {{ .Values.service.ui.type }} |
| 97 | {{- end }} |
| 98 | {{- if and .Values.service.ui.loadBalancerIP (eq .Values.service.ui.type "LoadBalancer") }} |
| 99 | loadBalancerIP: {{ .Values.service.ui.loadBalancerIP }} |
| 100 | {{- end }} |
| 101 | {{- if and (eq .Values.service.ui.type "LoadBalancer") .Values.service.ui.loadBalancerSourceRanges }} |
| 102 | loadBalancerSourceRanges: {{- toYaml .Values.service.ui.loadBalancerSourceRanges | nindent 4 }} |
| 103 | {{- end }} |
| 104 | selector: |
| 105 | app: longhorn-ui |
| 106 | ports: |
| 107 | - name: http |
| 108 | port: 80 |
| 109 | targetPort: http |
| 110 | {{- if .Values.service.ui.nodePort }} |
| 111 | nodePort: {{ .Values.service.ui.nodePort }} |
| 112 | {{- else }} |
| 113 | nodePort: null |
| 114 | {{- end }} |