b539b9b4216035aee74dbcab91eaea8329848503
[it/dep.git] / ric-xapps / 90-xApps / helm / xapp-std / templates / deployment.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
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 implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################'
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata:
20   name: {{ include "ricxapp.fullname" . }}
21   labels:
22     app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ .Release.Name }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: {{ .Values.ricxapp.replicaCount }}
28   selector:
29     matchLabels:
30       app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
31       release: {{ .Release.Name }}
32   template:
33     metadata:
34       labels:
35         app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
36         release: {{ .Release.Name }}
37     spec:
38       hostname: {{ include "ricxapp.name" . }}
39       imagePullSecrets:
40         - name: {{ include "ricxapp.imagepullsecret" . }}
41       containers:
42         - name: {{ include "ricxapp.containername" . }}
43           image: "{{ .Values.ricxapp.image.repository }}/{{ .Values.ricxapp.image.name }}:{{ .Values.ricxapp.image.tag }}"
44           imagePullPolicy: {{ .Values.ricxapp.image.pullPolicy }}
45           ports:
46             - name: http
47               containerPort: {{ .Values.ricxapp.service.http.containerPort }}
48               protocol: TCP
49             - name: rmrroute
50               containerPort: {{ .Values.ricxapp.service.rmr.route.port }}
51               protocol: TCP
52             - name: rmrdata
53               containerPort: {{ .Values.ricxapp.service.rmr.data.port }}
54               protocol: TCP
55           volumeMounts:
56             - name: config-volume
57               mountPath: {{ .Values.ricxapp.appconfig.path }}
58           envFrom:
59             - configMapRef:
60                 name: {{ include "ricxapp.configmapname" . }}-appenv
61           {{- if .Values.ricxapp.livenessProbe }}
62           livenessProbe:
63             {{- .Values.ricxapp.livenessProbe | nindent 12 -}}
64           {{ end }}
65           {{- if .Values.ricxapp.readinessProbe }}
66           readinessProbe:
67             {{- .Values.ricxapp.readinessProbe | nindent 12 -}}
68           {{ end }}
69           restartPolicy: Always
70       volumes:
71         - name: config-volume
72           configMap:
73             name: {{ include "ricxapp.configmapname" . }}-appconfig