@@ -138,3 +138,122 @@ spec:
138
138
failureThreshold : 2
139
139
periodSeconds : 30
140
140
timeoutSeconds : 5
141
+
142
+ {{- if $.Values.ui.enabled }}
143
+ ---
144
+ apiVersion : apps/v1
145
+ kind : Deployment
146
+ metadata :
147
+ name : {{ $.Values.appName }}-ui
148
+ namespace : {{ .Release.Namespace }}
149
+ labels :
150
+ chart : " {{ $.Chart.Name }}-{{ $.Chart.Version }}"
151
+ release : {{ .Release.Name }}
152
+ heritage : {{ .Release.Service }}
153
+ revision : " {{ .Release.Revision }}"
154
+ app.kubernetes.io/name : " {{ $.Values.appName }}-ui"
155
+ clabernetes/app : {{ $.Values.appName }}
156
+ clabernetes/name : " {{ $.Values.appName }}-ui"
157
+ clabernetes/component : ui
158
+ {{- $labels := merge $.Values.globalLabels $.Values.ui.deploymentLabels }}
159
+ {{- if $labels }}
160
+ {{ toYaml $labels | indent 4 }}
161
+ {{- end }}
162
+ {{- $annotations := merge $.Values.globalAnnotations $.Values.ui.deploymentAnnotations }}
163
+ {{- if $annotations }}
164
+ annotations :
165
+ {{ toYaml $annotations | indent 4 }}
166
+ {{- end }}
167
+ spec :
168
+ selector :
169
+ matchLabels :
170
+ clabernetes/app : {{ $.Values.appName }}
171
+ release : {{ .Release.Name }}
172
+ replicas : {{ $.Values.ui.replicaCount }}
173
+ strategy :
174
+ rollingUpdate :
175
+ maxSurge : 1
176
+ {{- if (eq (int $.Values.ui.replicaCount) 1) }}
177
+ maxUnavailable : 0
178
+ {{- else }}
179
+ maxUnavailable : 1
180
+ {{- end }}
181
+ type : RollingUpdate
182
+ template :
183
+ metadata :
184
+ labels :
185
+ chart : " {{ $.Chart.Name }}-{{ $.Chart.Version }}"
186
+ release : {{ .Release.Name }}
187
+ heritage : {{ .Release.Service }}
188
+ revision : " {{ .Release.Revision }}"
189
+ app.kubernetes.io/name : " {{ $.Values.appName }}-ui"
190
+ clabernetes/app : {{ $.Values.appName }}
191
+ clabernetes/name : " {{ $.Values.appName }}-ui"
192
+ clabernetes/component : ui
193
+ {{- $podLabels := merge $.Values.globalLabels $.Values.ui.podLabels }}
194
+ {{- if $podLabels }}
195
+ {{ toYaml $podLabels | indent 8 }}
196
+ {{- end }}
197
+ {{- $podAnnotations := merge $.Values.globalAnnotations $.Values.ui.podAnnotations }}
198
+ {{- if $podAnnotations }}
199
+ annotations :
200
+ {{ toYaml $podAnnotations | indent 8 }}
201
+ {{- end }}
202
+ spec :
203
+ {{- if $.Values.ui.affinity }}
204
+ affinity :
205
+ {{ toYaml $.Values.ui.affinity | indent 8 }}
206
+ {{- else if (ge (int $.Values.ui.replicaCount) 2) }}
207
+ affinity :
208
+ podAntiAffinity :
209
+ preferredDuringSchedulingIgnoredDuringExecution :
210
+ - weight : 100
211
+ podAffinityTerm :
212
+ labelSelector :
213
+ matchLabels :
214
+ clabernetes/app : {{ $.Values.appName }}
215
+ clabernetes/name : " {{ $.Values.appName }}-ui"
216
+ clabernetes/component : ui
217
+ topologyKey : kubernetes.io/hostname
218
+ - weight : 50
219
+ podAffinityTerm :
220
+ labelSelector :
221
+ matchLabels :
222
+ clabernetes/app : {{ $.Values.appName }}
223
+ clabernetes/name : " {{ $.Values.appName }}-ui"
224
+ clabernetes/component : ui
225
+ topologyKey : topology.kubernetes.io/zone
226
+ {{- end }}
227
+ terminationGracePeriodSeconds : 10
228
+ serviceAccountName : " {{ $.Values.appName }}-service-account"
229
+ containers :
230
+ - name : ui
231
+ {{- if .Values.ui.image }}
232
+ image : {{ .Values.ui.image }}
233
+ {{- else if eq .Chart.Version "0.0.0" }}
234
+ image : " ghcr.io/srl-labs/clabernetes/clabernetes-ui:dev-latest"
235
+ {{- else }}
236
+ image : " ghcr.io/srl-labs/clabernetes/clabernetes-ui:{{ .Chart.Version }}"
237
+ {{- end }}
238
+ imagePullPolicy : {{ $.Values.ui.imagePullPolicy }}
239
+ resources :
240
+ requests :
241
+ memory : {{ $.Values.ui.resources.requests.memory }}
242
+ cpu : {{ $.Values.ui.resources.requests.cpu }}
243
+ {{- if $.Values.ui.resources.limits }}
244
+ limits :
245
+ {{ toYaml $.Values.ui.resources.limits | indent 14 }}
246
+ {{- end }}
247
+ ports :
248
+ - name : http
249
+ containerPort : 3000
250
+ livenessProbe :
251
+ httpGet :
252
+ path : /alive
253
+ port : http
254
+ scheme : HTTP
255
+ successThreshold : 1
256
+ failureThreshold : 2
257
+ periodSeconds : 30
258
+ timeoutSeconds : 5
259
+ {{- end }}
0 commit comments