Moving dev back to LF Gerrit
[it/dep.git] / ric-aux / 80-Auxiliary-Functions / helm / dashboard / templates / deployment.yaml
index f02ddec..3ba4644 100644 (file)
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "dashboard.fullname" . }}
-  namespace: {{ include "common.namespace" . }}
+  name: {{ include "common.deploymentname.dashboard" . }}
+  namespace: {{ include "common.namespace.aux" . }}
   labels:
-    app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+    app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
@@ -29,36 +29,61 @@ spec:
   replicas: {{ .Values.dashboard.replicaCount }}
   selector:
     matchLabels:
-      app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+      app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }}
       release: {{ .Release.Name }}
   template:
     metadata:
       labels:
-        app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+        app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }}
         release: {{ .Release.Name }}
     spec:
-      hostname: {{ .Chart.Name }}
+      hostname: {{ include "common.name.dashboard" . }}
       imagePullSecrets:
         - name: {{ include "common.repositoryCred" . }}
+      {{- with .Values.dashboard.nodeselector }}
+      nodeSelector: {{ toYaml . | trim | nindent 8 -}}
+      {{- end }}
       containers:
-        - name: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+        - name: {{ include "common.containername.dashboard" . }}
           image: {{ include "common.repository" . }}/{{ .Values.dashboard.image.name }}:{{ .Values.dashboard.image.tag }}
           imagePullPolicy: {{ include "common.pullPolicy" . }}
           ports:
             - name: http
-              containerPort: 8080
+              containerPort: {{ include "common.serviceport.dashboard.container" . }}
               protocol: TCP
-          env:
-            - name: SPRING_APPLICATION_JSON
-              valueFrom:
-                configMapKeyRef:
-                  name: dashboard-configmap
-                  key: springApplication.json
+          volumeMounts:
+            - name: appconfig
+              mountPath: /config/application.properties
+              subPath: application.properties
+              readOnly: true
+            - name: appconfig
+              mountPath: /maven/key.properties
+              subPath: key.properties
+              readOnly: true
+            - name: appconfig
+              mountPath: /maven/portal.properties
+              subPath: portal.properties
+              readOnly: true
+# Temp solution until portal 2.6
+            - name: appconfig
+              mountPath: /dashboard-data/users.json
+              subPath: users.json
+#            - name: dashboard-users
+#              mountPath: /dashboard-data
           livenessProbe:
             httpGet:
-              path: /
+              path: /api/admin/health
               port: http
+            initialDelaySeconds: 15
           readinessProbe:
             httpGet:
-              path: /
+              path: /api/admin/version
               port: http
+            initialDelaySeconds: 15
+      volumes:
+        - name: appconfig
+          configMap:
+            name: {{ include "common.configmapname.dashboard" . }}-appconfig
+        - name: dashboard-users
+          persistentVolumeClaim:
+            claimName: pvc-{{ include "common.name.dashboard" . }}