1ea190b880fa6a8effd61b77be60b2bf68952870
[it/dep.git] / ric-platform / 50-RIC-Platform / helm / appmgr / 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
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: {{ include "common.deploymentname.appmgr" . }}
22   namespace: {{ include "common.namespace.platform" . }}
23   labels:
24     app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }}
25     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26     release: {{ .Release.Name }}
27     heritage: {{ .Release.Service }}
28 spec:
29   replicas: {{ .Values.appmgr.replicaCount }}
30   selector:
31     matchLabels:
32       app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }}
33       release: {{ .Release.Name }}
34   template:
35     metadata:
36       labels:
37         app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }}
38         release: {{ .Release.Name }}
39     spec:
40       hostname: {{ include "common.name.appmgr" . }}
41       serviceAccountName: {{ include "common.serviceaccountname.appmgr" . }}
42       imagePullSecrets:
43         - name: {{ include "common.repositoryCred" . }}
44       containers:
45         - name: {{ include "common.containername.appmgr" . }}
46           image: {{ include "common.repository" . }}/{{ .Values.appmgr.image.name }}:{{ .Values.appmgr.image.tag }}
47           imagePullPolicy: {{ include "common.pullPolicy" . }}
48           ports:
49             - name: http
50               containerPort: {{ .Values.appmgr.service.http.containerPort }}
51               protocol: TCP
52             - name: rmrroute
53               containerPort: {{ .Values.appmgr.service.rmr.route.port }}
54               protocol: TCP
55             - name: rmrdata
56               containerPort: {{ .Values.appmgr.service.rmr.data.port }}
57               protocol: TCP
58           volumeMounts:
59             - name: config-volume
60               mountPath: {{ .Values.appmgr.appconfigpath }}/appmgr.yaml
61               subPath: appmgr.yaml
62             - name: secret-volume
63               mountPath: {{ .Values.appmgr.appsecretpath }}
64             - name: cert-volume
65               mountPath: {{ .Values.appmgr.appcertpath }}
66           envFrom:
67             - configMapRef:
68                 name: {{ include "common.configmapname.appmgr" . }}-env
69           livenessProbe:
70             #exec:
71             #  command:
72             #    - /bin/bash
73             #    - -c
74             #    - ps -ef | grep {{ .Values.livenessprocessname }}| grep -v "grep"
75             #initialDelaySeconds: 120
76             #periodSeconds: 30
77           readinessProbe:
78           #  httpGet:
79           #    path: /
80           #    port: http
81           restartPolicy: Always
82           securityContext:
83             # ubuntu
84             #runAsUser: 1000
85             #allowPrivilegeEscalation: false
86       volumes:
87         - name: config-volume
88           configMap:
89             name: {{ include "common.configmapname.appmgr" . }}-appconfig
90         - name: secret-volume
91           secret:
92             secretName: {{ include "common.helmrepositorycred" . }}
93         - name: cert-volume
94           configMap:
95             name: {{ include "common.helmrepositorycert" . }}