0ef46d2cbc82b1bbbe069021cc7440afbf53234d
[ric-plt/appmgr.git] / helm_chart / appmgr / templates / deployment.yaml
1 #   Copyright (c) 2019 AT&T Intellectual Property.
2 #   Copyright (c) 2019 Nokia.
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 "appmgr.fullname" . }}
20   labels:
21     app.kubernetes.io/name: {{ include "appmgr.name" . }}
22     helm.sh/chart: {{ include "appmgr.chart" . }}
23     app.kubernetes.io/instance: {{ .Release.Name }}
24     app.kubernetes.io/managed-by: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   selector:
28     matchLabels:
29       app.kubernetes.io/name: {{ include "appmgr.name" . }}
30       app.kubernetes.io/instance: {{ .Release.Name }}
31   template:
32     metadata:
33       labels:
34         app.kubernetes.io/name: {{ include "appmgr.name" . }}
35         app.kubernetes.io/instance: {{ .Release.Name }}
36     spec:
37       containers:
38         - name: {{ .Chart.Name }}
39           image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}"
40           imagePullPolicy: {{ .Values.image.pullPolicy }}
41           ports:
42             - name: http
43               containerPort: {{ .Values.image.containerPort }}
44               protocol: TCP
45           volumeMounts:
46             - name: config-volume
47               mountPath: {{ .Values.appconfigpath }}
48             - name: secret-volume
49               mountPath: {{ .Values.appsecretpath }}
50             - name: cert-volume
51               mountPath: {{ .Values.appcertpath }}
52           envFrom:
53             - configMapRef:
54                 name: {{ .Release.Name }}-appenv
55           livenessProbe:
56             httpGet:
57               path: {{ .Values.service.health_check_endpoint }}
58               port: 8080
59             initialDelaySeconds: 5
60             periodSeconds: 15
61           readinessProbe:
62             httpGet:
63               path: {{ .Values.service.health_check_endpoint }}
64               port: 8080
65             initialDelaySeconds: 5
66             periodSeconds: 15
67           restartPolicy: Always
68           resources:
69             {{- toYaml .Values.resources | nindent 12 }}
70           securityContext:
71             # ubuntu
72             #runAsUser: 1000
73             #allowPrivilegeEscalation: false
74       {{- with .Values.nodeSelector }}
75       nodeSelector:
76         {{- toYaml . | nindent 8 }}
77       {{- end }}
78     {{- with .Values.affinity }}
79       affinity:
80         {{- toYaml . | nindent 8 }}
81     {{- end }}
82     {{- with .Values.tolerations }}
83       tolerations:
84         {{- toYaml . | nindent 8 }}
85     {{- end }}
86
87       volumes:
88         - name: config-volume
89           configMap:
90             name: {{ .Release.Name }}-appconfig
91         - name: secret-volume
92           secret:
93             secretName: {{ .Values.appsecretobject }}
94         - name: cert-volume
95           configMap:
96             name: {{ .Values.appcertobject }}