Use application.properties from YAML in values 39/339/10
authorLott, Christopher (cl778h) <cl778h@att.com>
Thu, 13 Jun 2019 17:57:25 +0000 (13:57 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Fri, 14 Jun 2019 18:44:23 +0000 (14:44 -0400)
Mount a config map as file /maven/application.properties
instead of environment variable SPRING_APPLICATION_JSON.

Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Change-Id: Ia8364355f9f6f04573640179ece67505cb586e3f

ric-aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml [moved from ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/configmap.yaml with 71% similarity]
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml

index f142b0a..11d8096 100644 (file)
@@ -17,6 +17,7 @@
 
 apiVersion: v1
 appVersion: "1.0"
-description: Helm chart for the RIC Dashboard web app
+description: Helm Chart for RIC Dashboard
 name: dashboard
 version: 1.1.0
+icon: https://gerrit.o-ran-sc.org/r/gitweb?p=portal/ric-dashboard.git;a=blob;f=webapp-frontend/src/assets/at_t.png;h=3cced1d5ce4668fbf3b33064aaaa6920bc8130b6;hb=HEAD
 #   limitations under the License.                                             #
 ################################################################################
 
-# Provides configuration parameters which spring expects as a JSON string
+# Defines a config map for mounting as file application.properties
 
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: dashboard-configmap
+  name: {{ include "dashboard.fullname" . }}-appconfig
 data:
-  springApplication.json: |
-    {
-      "a1med": {
-        "basepath": "http://0.1.2.3:45"
-      },
-      "e2mgr": {
-        "basepath": "http://1.2.3.4:56"
-      },
-      "xappmgr": {
-        "basepath": "http://2.3.4.5:67"
-      }
-    }
+  # this key becomes the filename when mounted
+  application.properties: |
+    # appconfig.yaml
+    server.port = {{ .Values.dashboard.server.port }}
+    a1med.url =   {{ .Values.dashboard.properties.a1med.url   }}
+    anrxapp.url = {{ .Values.dashboard.properties.anrxapp.url }}
+    e2mgr.url =   {{ .Values.dashboard.properties.e2mgr.url   }}
+    xappmgr.url = {{ .Values.dashboard.properties.xappmgr.url }}
index f02ddec..a4b311d 100644 (file)
@@ -46,14 +46,13 @@ spec:
           imagePullPolicy: {{ include "common.pullPolicy" . }}
           ports:
             - name: http
-              containerPort: 8080
+              containerPort: {{ .Values.dashboard.server.port }}
               protocol: TCP
-          env:
-            - name: SPRING_APPLICATION_JSON
-              valueFrom:
-                configMapKeyRef:
-                  name: dashboard-configmap
-                  key: springApplication.json
+          volumeMounts:
+            - name: application-config
+              mountPath: /maven/application.properties
+              subPath: application.properties
+              readOnly: true
           livenessProbe:
             httpGet:
               path: /
@@ -62,3 +61,7 @@ spec:
             httpGet:
               path: /
               port: http
+      volumes:
+        - name: application-config
+          configMap:
+            name: {{ include "dashboard.fullname" . }}-appconfig
index 5a1b93c..08a4887 100644 (file)
@@ -28,7 +28,8 @@ metadata:
 spec:
   type: {{ .Values.dashboard.service.type }}
   ports:
-    - port: {{ .Values.dashboard.service.port }}
+    - port: {{ .Values.dashboard.server.port }}
+      nodePort: {{ .Values.dashboard.service.port }}
       targetPort: http
       protocol: TCP
   selector:
index 48da930..eb94646 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
-# Default values for dashboard.
-# This is a YAML-formatted file.
-# Declare variables to be passed into your templates.
+# Deployment values for dashboard.
 
-replicaCount: 1
 repository: "nexus3.o-ran-sc.org:10004"
 imagePullPolicy: IfNotPresent
 repositoryCred: docker-reg-cred
@@ -27,10 +24,22 @@ repositoryCred: docker-reg-cred
 dashboard:
   image:
     name: ric-dash-be
-    tag: 1.0.0-SNAPSHOT
-  
-  
+    tag: 1.0.4
+  replicaCount: 1
+  server:
+    # Tomcat listens here
+    port: 8080
   service:
     type: NodePort
-    port: 80
-  
+    port: 30080
+    name: dashboard-service
+  # config URLs must be specified at deployment
+  properties:
+    a1med:
+      url:  http://values-yaml-default-A1-URL
+    anrxapp:
+      url:  http://values-yaml-default-ANR-URL
+    e2mgr:
+      url:  http://values-yaml-default-E2-URL
+    xappmgr:
+      url:  http://values-yaml-default-MGR-URL