New version of the common template. It unifies the naming convention between platform...
[it/dep.git] / ric-xapps / 90-xApps / helm / xapp-std / templates / deployment.yaml
1 #
2 # ==================================================================================
3 #   Copyright (c) 2019 Nokia
4 # ==================================================================================
5 #
6
7 apiVersion: apps/v1
8 kind: Deployment
9 metadata:
10   name: {{ include "ricapp.fullname" . }}
11   labels:
12     app.kubernetes.io/name: {{ include "ricapp.name" . }}
13     helm.sh/chart: {{ include "ricapp.chart" . }}
14     app.kubernetes.io/instance: {{ .Release.Name }}
15     app.kubernetes.io/managed-by: {{ .Release.Service }}
16 spec:
17   replicas: {{ .Values.ricapp.replicaCount }}
18   selector:
19     matchLabels:
20       app.kubernetes.io/name: {{ include "ricapp.name" . }}
21       app.kubernetes.io/instance: {{ .Release.Name }}
22   template:
23     metadata:
24       labels:
25         app.kubernetes.io/name: {{ include "ricapp.name" . }}
26         app.kubernetes.io/instance: {{ .Release.Name }}
27     spec:
28       hostname: {{ .Values.ricapp.hostname }}
29       imagePullSecrets:
30         - name: {{ include "ricxapp.imagepullsecret" . }}
31       containers:
32         - name: {{ .Chart.Name }}
33           image: "{{ .Values.global.repository }}/{{ .Values.ricapp.image.name }}:{{ .Values.ricapp.image.tag }}"
34           imagePullPolicy: {{ .Values.global.image.pullPolicy }}
35           ports:
36             - name: http
37               containerPort: {{ .Values.ricapp.service.http.containerPort }}
38               protocol: TCP
39             - name: rmr
40               containerPort: {{ .Values.ricapp.service.rmr.containerPort }}
41               protocol: TCP
42           volumeMounts:
43             - name: config-volume
44               mountPath: {{ .Values.ricapp.appconfig.path }}
45             - name: cert-volume
46               mountPath: {{ .Values.ricapp.cert.path }}
47           livenessProbe:
48             httpGet:
49               path: {{ .Values.ricapp.probes.healthAliveCheckEndpoint }}
50               port: 8080
51             initialDelaySeconds: 5
52             periodSeconds: 15
53           readinessProbe:
54             httpGet:
55               path: {{ .Values.ricapp.probes.healthReadyCheckEndpoint }}
56               port: 8080
57             initialDelaySeconds: 5
58             periodSeconds: 15
59           restartPolicy: Always
60           resources:
61             {{- toYaml .Values.ricapp.resources | nindent 12 }}
62           securityContext:
63             # ubuntu
64             #runAsUser: 1000
65             #allowPrivilegeEscalation: false
66       {{- with .Values.ricapp.nodeSelector }}
67       nodeSelector:
68         {{- toYaml . | nindent 8 }}
69       {{- end }}
70     {{- with .Values.ricapp.affinity }}
71       affinity:
72         {{- toYaml . | nindent 8 }}
73     {{- end }}
74     {{- with .Values.ricapp.tolerations }}
75       tolerations:
76         {{- toYaml . | nindent 8 }}
77     {{- end }}
78
79       volumes:
80         - name: config-volume
81           configMap:
82             name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }}
83         - name: cert-volume
84           emptyDir: {}