Initial commit of code
[it/dev.git] / ric-xapps / helm / xapp-std / templates / deployment.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
10 #   Unless required by applicable law or agreed to in writing, software        #
11 #   distributed under the License is distributed on an "AS IS" BASIS,          #
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13 #   See the License for the specific language governing permissions and        #
14 #   limitations under the License.                                             #
15 ################################################################################'
16 apiVersion: apps/v1
17 kind: Deployment
18 metadata:
19   name: {{ include "ricxapp.fullname" . }}
20   labels:
21     app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ .Release.Name }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.ricxapp.replicaCount }}
27   selector:
28     matchLabels:
29       app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
30       release: {{ .Release.Name }}
31   template:
32     metadata:
33       labels:
34         app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
35         release: {{ .Release.Name }}
36     spec:
37       hostname: {{ include "ricxapp.name" . }}
38       imagePullSecrets:
39         - name: {{ include "ricxapp.imagepullsecret" . }}
40       containers:
41         - name: {{ include "ricxapp.containername" . }}
42           image: "{{ .Values.ricxapp.image.repository }}/{{ .Values.ricxapp.image.name }}:{{ .Values.ricxapp.image.tag }}"
43           imagePullPolicy: {{ .Values.ricxapp.image.pullPolicy }}
44           ports:
45             - name: http
46               containerPort: {{ .Values.ricxapp.service.http.containerPort }}
47               protocol: TCP
48             - name: rmrroute
49               containerPort: {{ .Values.ricxapp.service.rmr.route.port }}
50               protocol: TCP
51             - name: rmrdata
52               containerPort: {{ .Values.ricxapp.service.rmr.data.port }}
53               protocol: TCP
54           volumeMounts:
55             - name: config-volume
56               mountPath: {{ .Values.ricxapp.appconfig.path }}
57           envFrom:
58             - configMapRef:
59                 name: {{ include "ricxapp.configmapname" . }}-appenv
60           {{- if .Values.ricxapp.livenessProbe }}
61           livenessProbe:
62             {{- .Values.ricxapp.livenessProbe | nindent 12 -}}
63           {{ end }}
64           {{- if .Values.ricxapp.readinessProbe }}
65           readinessProbe:
66             {{- .Values.ricxapp.readinessProbe | nindent 12 -}}
67           {{ end }}
68           restartPolicy: Always
69       volumes:
70         - name: config-volume
71           configMap:
72             name: {{ include "ricxapp.configmapname" . }}-appconfig