| 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-conversion-webhook |
| 6 | name: longhorn-conversion-webhook |
| 7 | namespace: {{ include "release_namespace" . }} |
| 8 | spec: |
| 9 | replicas: {{ .Values.longhornConversionWebhook.replicas }} |
| 10 | selector: |
| 11 | matchLabels: |
| 12 | app: longhorn-conversion-webhook |
| 13 | template: |
| 14 | metadata: |
| 15 | labels: {{- include "longhorn.labels" . | nindent 8 }} |
| 16 | app: longhorn-conversion-webhook |
| 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-conversion-webhook |
| 29 | topologyKey: kubernetes.io/hostname |
| 30 | containers: |
| 31 | - name: longhorn-conversion-webhook |
| 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 | - conversion-webhook |
| 39 | - --service-account |
| 40 | - longhorn-service-account |
| 41 | ports: |
| 42 | - containerPort: 9443 |
| 43 | name: conversion-wh |
| 44 | readinessProbe: |
| 45 | tcpSocket: |
| 46 | port: 9443 |
| 47 | env: |
| 48 | - name: POD_NAMESPACE |
| 49 | valueFrom: |
| 50 | fieldRef: |
| 51 | fieldPath: metadata.namespace |
| 52 | {{- if .Values.privateRegistry.registrySecret }} |
| 53 | imagePullSecrets: |
| 54 | - name: {{ .Values.privateRegistry.registrySecret }} |
| 55 | {{- end }} |
| 56 | {{- if .Values.longhornConversionWebhook.priorityClass }} |
| 57 | priorityClassName: {{ .Values.longhornConversionWebhook.priorityClass | quote }} |
| 58 | {{- end }} |
| 59 | {{- if or .Values.longhornConversionWebhook.tolerations .Values.global.cattle.windowsCluster.enabled }} |
| 60 | tolerations: |
| 61 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }} |
| 62 | {{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }} |
| 63 | {{- end }} |
| 64 | {{- if .Values.longhornConversionWebhook.tolerations }} |
| 65 | {{ toYaml .Values.longhornConversionWebhook.tolerations | indent 6 }} |
| 66 | {{- end }} |
| 67 | {{- end }} |
| 68 | {{- if or .Values.longhornConversionWebhook.nodeSelector .Values.global.cattle.windowsCluster.enabled }} |
| 69 | nodeSelector: |
| 70 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }} |
| 71 | {{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }} |
| 72 | {{- end }} |
| 73 | {{- if .Values.longhornConversionWebhook.nodeSelector }} |
| 74 | {{ toYaml .Values.longhornConversionWebhook.nodeSelector | indent 8 }} |
| 75 | {{- end }} |
| 76 | {{- end }} |
| 77 | serviceAccountName: longhorn-service-account |
| 78 | --- |
| 79 | apiVersion: apps/v1 |
| 80 | kind: Deployment |
| 81 | metadata: |
| 82 | labels: {{- include "longhorn.labels" . | nindent 4 }} |
| 83 | app: longhorn-admission-webhook |
| 84 | name: longhorn-admission-webhook |
| 85 | namespace: {{ include "release_namespace" . }} |
| 86 | spec: |
| 87 | replicas: {{ .Values.longhornAdmissionWebhook.replicas }} |
| 88 | selector: |
| 89 | matchLabels: |
| 90 | app: longhorn-admission-webhook |
| 91 | template: |
| 92 | metadata: |
| 93 | labels: {{- include "longhorn.labels" . | nindent 8 }} |
| 94 | app: longhorn-admission-webhook |
| 95 | spec: |
| 96 | affinity: |
| 97 | podAntiAffinity: |
| 98 | preferredDuringSchedulingIgnoredDuringExecution: |
| 99 | - weight: 1 |
| 100 | podAffinityTerm: |
| 101 | labelSelector: |
| 102 | matchExpressions: |
| 103 | - key: app |
| 104 | operator: In |
| 105 | values: |
| 106 | - longhorn-admission-webhook |
| 107 | topologyKey: kubernetes.io/hostname |
| 108 | initContainers: |
| 109 | - name: wait-longhorn-conversion-webhook |
| 110 | image: {{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }} |
| 111 | command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" -k https://longhorn-conversion-webhook:9443/v1/healthz) != "200" ]; do echo waiting; sleep 2; done'] |
| 112 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 113 | securityContext: |
| 114 | runAsUser: 2000 |
| 115 | containers: |
| 116 | - name: longhorn-admission-webhook |
| 117 | image: {{ template "registry_url" . }}{{ .Values.image.longhorn.manager.repository }}:{{ .Values.image.longhorn.manager.tag }} |
| 118 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 119 | securityContext: |
| 120 | runAsUser: 2000 |
| 121 | command: |
| 122 | - longhorn-manager |
| 123 | - admission-webhook |
| 124 | - --service-account |
| 125 | - longhorn-service-account |
| 126 | ports: |
| 127 | - containerPort: 9443 |
| 128 | name: admission-wh |
| 129 | readinessProbe: |
| 130 | tcpSocket: |
| 131 | port: 9443 |
| 132 | env: |
| 133 | - name: POD_NAMESPACE |
| 134 | valueFrom: |
| 135 | fieldRef: |
| 136 | fieldPath: metadata.namespace |
| 137 | - name: NODE_NAME |
| 138 | valueFrom: |
| 139 | fieldRef: |
| 140 | fieldPath: spec.nodeName |
| 141 | {{- if .Values.privateRegistry.registrySecret }} |
| 142 | imagePullSecrets: |
| 143 | - name: {{ .Values.privateRegistry.registrySecret }} |
| 144 | {{- end }} |
| 145 | {{- if .Values.longhornAdmissionWebhook.priorityClass }} |
| 146 | priorityClassName: {{ .Values.longhornAdmissionWebhook.priorityClass | quote }} |
| 147 | {{- end }} |
| 148 | {{- if or .Values.longhornAdmissionWebhook.tolerations .Values.global.cattle.windowsCluster.enabled }} |
| 149 | tolerations: |
| 150 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.tolerations }} |
| 151 | {{ toYaml .Values.global.cattle.windowsCluster.tolerations | indent 6 }} |
| 152 | {{- end }} |
| 153 | {{- if .Values.longhornAdmissionWebhook.tolerations }} |
| 154 | {{ toYaml .Values.longhornAdmissionWebhook.tolerations | indent 6 }} |
| 155 | {{- end }} |
| 156 | {{- end }} |
| 157 | {{- if or .Values.longhornAdmissionWebhook.nodeSelector .Values.global.cattle.windowsCluster.enabled }} |
| 158 | nodeSelector: |
| 159 | {{- if and .Values.global.cattle.windowsCluster.enabled .Values.global.cattle.windowsCluster.nodeSelector }} |
| 160 | {{ toYaml .Values.global.cattle.windowsCluster.nodeSelector | indent 8 }} |
| 161 | {{- end }} |
| 162 | {{- if .Values.longhornAdmissionWebhook.nodeSelector }} |
| 163 | {{ toYaml .Values.longhornAdmissionWebhook.nodeSelector | indent 8 }} |
| 164 | {{- end }} |
| 165 | {{- end }} |
| 166 | serviceAccountName: longhorn-service-account |