c7d13909ddc2759e6db763665d4128379a0818d6
[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       imagePullSecrets:
45         {{- $newctx := dict "ctx" $ "defaultregistry" .Values.xapponboarder.image.xapponboarder.registry }}
46         - name: {{ include "common.dockerregistry.credential" $newctx }}
47       containers:
48         - name: {{ include "common.containername.xapp-onboarder.chartmuseum" . }}
49           {{- $newctx := dict "ctx" $ "defaultregistry" .Values.xapponboarder.image.chartmuseum.registry }}
50           image: {{ include "common.dockerregistry.url" $newctx }}/{{ .Values.xapponboarder.image.chartmuseum.name }}:{{ .Values.xapponboarder.image.chartmuseum.tag }}
51           {{- $newctx := dict "ctx" $ "defaultpullpolicy" .Values.xapponboarder.imagePullPolicy }}
52           imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $newctx }}
53           securityContext:
54             fsGroup: 0
55             runAsUser: 0
56           envFrom:
57             - configMapRef:
58                 name: {{ include "common.configmapname.xapp-onboarder" . }}-chartmuseum-env
59           ports:
60             - name: chartmuseum
61               containerPort: {{ include "common.serviceport.xapp-onboarder.chartmuseum" . }}
62               protocol: TCP
63         - name: {{ include "common.containername.xapp-onboarder" . }}
64           {{- $newctx := dict "ctx" $ "defaultregistry" .Values.xapponboarder.image.xapponboarder.registry }}
65           image: {{ include "common.dockerregistry.url" $newctx }}/{{ .Values.xapponboarder.image.xapponboarder.name }}:{{ .Values.xapponboarder.image.xapponboarder.tag }}
66           {{- $newctx := dict "ctx" $ "defaultpullpolicy" .Values.xapponboarder.imagePullPolicy }}
67           imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $newctx }}
68           ports:
69             - name: server
70               containerPort: {{ include "common.serviceport.xapp-onboarder.server" . }}
71               protocol: TCP
72           envFrom:
73             - configMapRef:
74                 name: {{ include "common.configmapname.xapp-onboarder" . }}-env
75           livenessProbe:
76             #exec:
77             #  command:
78             #    - /bin/bash
79             #    - -c
80             #    - ps -ef | grep {{ .Values.livenessprocessname }}| grep -v "grep"
81             #initialDelaySeconds: 120
82             #periodSeconds: 30
83           readinessProbe:
84           #  httpGet:
85           #    path: /
86           #    port: http
87           restartPolicy: Always