Extend K8S and RIC installation instructions
[it/dep.git] / ric-aux / 80-Auxiliary-Functions / helm / dashboard / 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
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: {{ include "common.deploymentname.dashboard" . }}
22   namespace: {{ include "common.namespace.aux" . }}
23   labels:
24     app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }}
25     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26     release: {{ .Release.Name }}
27     heritage: {{ .Release.Service }}
28 spec:
29   replicas: {{ .Values.dashboard.replicaCount }}
30   selector:
31     matchLabels:
32       app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }}
33       release: {{ .Release.Name }}
34   template:
35     metadata:
36       labels:
37         app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }}
38         release: {{ .Release.Name }}
39     spec:
40       hostname: {{ include "common.name.dashboard" . }}
41       imagePullSecrets:
42         - name: {{ include "common.repositoryCred" . }}
43       {{- with .Values.dashboard.nodeselector }}
44       nodeSelector: {{ toYaml . | trim | nindent 8 -}}
45       {{- end }}
46       containers:
47         - name: {{ include "common.containername.dashboard" . }}
48           image: {{ include "common.repository" . }}/{{ .Values.dashboard.image.name }}:{{ .Values.dashboard.image.tag }}
49           imagePullPolicy: {{ include "common.pullPolicy" . }}
50           ports:
51             - name: http
52               containerPort: {{ include "common.serviceport.dashboard.container" . }}
53               protocol: TCP
54           volumeMounts:
55             - name: appconfig
56               mountPath: /config/application.properties
57               subPath: application.properties
58               readOnly: true
59             - name: appconfig
60               mountPath: /maven/key.properties
61               subPath: key.properties
62               readOnly: true
63             - name: appconfig
64               mountPath: /maven/portal.properties
65               subPath: portal.properties
66               readOnly: true
67 # Temp solution until portal 2.6
68             - name: appconfig
69               mountPath: /dashboard-data/users.json
70               subPath: users.json
71 #            - name: dashboard-users
72 #              mountPath: /dashboard-data
73           livenessProbe:
74             httpGet:
75               path: /api/admin/health
76               port: http
77             initialDelaySeconds: 15
78           readinessProbe:
79             httpGet:
80               path: /api/admin/version
81               port: http
82             initialDelaySeconds: 15
83       volumes:
84         - name: appconfig
85           configMap:
86             name: {{ include "common.configmapname.dashboard" . }}-appconfig
87         - name: dashboard-users
88           persistentVolumeClaim:
89             claimName: pvc-{{ include "common.name.dashboard" . }}