helm3 and K8 1.18 support added
[ric-plt/ric-dep.git] / helm / xapp-onboarder / 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 apiVersion: apps/v1
18 kind: Deployment
19 metadata:
20   name: {{ include "common.deploymentname.xapp-onboarder" . }}
21   namespace: {{ include "common.namespace.platform" . }}
22   labels:
23     app: {{ include "common.namespace.platform" . }}-{{ include "common.name.xapp-onboarder" . }}
24     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25     release: {{ .Release.Name }}
26     heritage: {{ .Release.Service }}
27 spec:
28   replicas: {{ .Values.xapponboarder.replicaCount }}
29   selector:
30     matchLabels:
31       app: {{ include "common.namespace.platform" . }}-{{ include "common.name.xapp-onboarder" . }}
32       release: {{ .Release.Name }}
33   template:
34     metadata:
35       {{- if .Values.xapponboarder.annotations }}
36       annotations:
37         {{- .Values.xapponboarder.annotations | nindent 8 -}}
38       {{ end }}
39       labels:
40         app: {{ include "common.namespace.platform" . }}-{{ include "common.name.xapp-onboarder" . }}
41         release: {{ .Release.Name }}
42     spec:
43       hostname: {{ include "common.name.xapp-onboarder" . }}
44       securityContext:
45         fsGroup: 0
46         runAsUser: 0
47       restartPolicy: Always
48       imagePullSecrets:
49         {{- $newctx := dict "ctx" $ "defaultregistry" .Values.xapponboarder.image.xapponboarder.registry }}
50         - name: {{ include "common.dockerregistry.credential" $newctx }}
51       containers:
52         - name: {{ include "common.containername.xapp-onboarder.chartmuseum" . }}
53           {{- $newctx := dict "ctx" $ "defaultregistry" .Values.xapponboarder.image.chartmuseum.registry }}
54           image: {{ include "common.dockerregistry.url" $newctx }}/{{ .Values.xapponboarder.image.chartmuseum.name }}:{{ .Values.xapponboarder.image.chartmuseum.tag }}
55           {{- $newctx := dict "ctx" $ "defaultpullpolicy" .Values.xapponboarder.imagePullPolicy }}
56           imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $newctx }}
57           envFrom:
58             - configMapRef:
59                 name: {{ include "common.configmapname.xapp-onboarder" . }}-chartmuseum-env
60           ports:
61             - name: chartmuseum
62               containerPort: {{ include "common.serviceport.xapp-onboarder.chartmuseum" . }}
63               protocol: TCP
64         - name: {{ include "common.containername.xapp-onboarder" . }}
65           {{- $newctx := dict "ctx" $ "defaultregistry" .Values.xapponboarder.image.xapponboarder.registry }}
66           image: {{ include "common.dockerregistry.url" $newctx }}/{{ .Values.xapponboarder.image.xapponboarder.name }}:{{ .Values.xapponboarder.image.xapponboarder.tag }}
67           {{- $newctx := dict "ctx" $ "defaultpullpolicy" .Values.xapponboarder.imagePullPolicy }}
68           imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $newctx }}
69           ports:
70             - name: server
71               containerPort: {{ include "common.serviceport.xapp-onboarder.server" . }}
72               protocol: TCP
73           envFrom:
74             - configMapRef:
75                 name: {{ include "common.configmapname.xapp-onboarder" . }}-env
76             - configMapRef:
77                 name: {{ include "common.configmapname.dbaas" . }}-appconfig
78           livenessProbe:
79             #exec:
80             #  command:
81             #    - /bin/bash
82             #    - -c
83             #    - ps -ef | grep {{ .Values.livenessprocessname }}| grep -v "grep"
84             #initialDelaySeconds: 120
85             #periodSeconds: 30
86           readinessProbe:
87           #  httpGet:
88           #    path: /
89           #    port: http