Feature 8170: deploy OSM services with a helm chart
[osm/devops.git] / installers / helm / osm / templates / ng_ui / ngui-deployment.yaml
1 {{- if .Values.ngui.enabled -}}
2 #######################################################################################
3 # Copyright ETSI Contributors and Others.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #    http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #######################################################################################
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: ngui
22   labels:
23     {{- include "osm.labels" . | nindent 4 }}
24 spec:
25   replicas: {{ .Values.ngui.replicaCount | default .Values.global.replicaCount }}
26   selector:
27     matchLabels:
28       app.kubernetes.io/component: ngui
29       {{- include "osm.selectorLabels" . | nindent 6 }}
30   template:
31     metadata:
32       {{- with .Values.global.podAnnotations }}
33       annotations:
34         {{- toYaml . | nindent 8 }}
35       {{- end }}
36       labels:
37         app.kubernetes.io/component: ngui
38         {{- include "osm.selectorLabels" . | nindent 8 }}
39     spec:
40       {{- with .Values.global.imagePullSecrets }}
41       imagePullSecrets:
42         {{- toYaml . | nindent 8 }}
43       {{- end }}
44       serviceAccountName: {{ include "osm.serviceAccountName" . }}
45       containers:
46         - name: ngui
47           securityContext:
48             # readOnlyRootFilesystem: true
49             allowPrivilegeEscalation: false
50             # runAsNonRoot: true
51           image: {{ include "osm.ngui.image" . }}
52           imagePullPolicy: {{ .Values.global.image.pullPolicy }}
53           ports:
54             - containerPort: 80
55               protocol: TCP
56           resources:
57             limits:
58               memory: 1024Mi
59             requests:
60               memory: 128Mi
61       {{- with .Values.global.nodeSelector }}
62       nodeSelector:
63         {{- toYaml . | nindent 8 }}
64       {{- end }}
65       {{- with .Values.global.affinity }}
66       affinity:
67         {{- toYaml . | nindent 8 }}
68       {{- end }}
69       {{- with .Values.global.tolerations }}
70       tolerations:
71         {{- toYaml . | nindent 8 }}
72       {{- end }}
73 {{- end }}