1e82e942fd3992d6164067af50bdf70fa0b506c1
[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       containers:
30         - name: {{ .Chart.Name }}
31           image: "{{ .Values.global.repository }}/{{ .Values.ricapp.image.name }}:{{ .Values.ricapp.image.tag }}"
32           imagePullPolicy: {{ .Values.global.image.pullPolicy }}
33           ports:
34             - name: http
35               containerPort: {{ .Values.ricapp.service.port }}
36               protocol: TCP
37             - name: rmr
38               containerPort: {{ .Values.ricapp.service.rmrPort }}
39               protocol: TCP
40           volumeMounts:
41             - name: config-volume
42               mountPath: {{ .Values.ricapp.appconfig.path }}
43             - name: cert-volume
44               mountPath: {{ .Values.ricapp.cert.path }}
45           livenessProbe:
46             httpGet:
47               path: {{ .Values.ricapp.probes.healthAliveCheckEndpoint }}
48               port: 8080
49             initialDelaySeconds: 5
50             periodSeconds: 15
51           readinessProbe:
52             httpGet:
53               path: {{ .Values.ricapp.probes.healthReadyCheckEndpoint }}
54               port: 8080
55             initialDelaySeconds: 5
56             periodSeconds: 15
57           restartPolicy: Always
58           resources:
59             {{- toYaml .Values.ricapp.resources | nindent 12 }}
60           securityContext:
61             # ubuntu
62             #runAsUser: 1000
63             #allowPrivilegeEscalation: false
64       {{- with .Values.ricapp.nodeSelector }}
65       nodeSelector:
66         {{- toYaml . | nindent 8 }}
67       {{- end }}
68     {{- with .Values.ricapp.affinity }}
69       affinity:
70         {{- toYaml . | nindent 8 }}
71     {{- end }}
72     {{- with .Values.ricapp.tolerations }}
73       tolerations:
74         {{- toYaml . | nindent 8 }}
75     {{- end }}
76
77       volumes:
78         - name: config-volume
79           configMap:
80             name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }}
81         - name: cert-volume
82           emptyDir: {}