Add keys, values and volumes for properties files 50/550/13
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 24 Jul 2019 13:46:03 +0000 (09:46 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Thu, 1 Aug 2019 19:35:18 +0000 (15:35 -0400)
New sets of properties to be mounted as files key.properties,
portal.properties for use on the application's classpath.
Added deployment values to the example recipe; should consider
use of secrets for credentials.
Added persistent volume, claim and storage class for user data.

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

RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE
ric-aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolume.yaml [new file with mode: 0644]
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolumeClaim.yaml [new file with mode: 0644]
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/storageClass.yaml [new file with mode: 0644]
ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml

index 73e27f0..ef5d1fc 100644 (file)
@@ -63,12 +63,21 @@ dashboard:
   # Override the name using the following option
   # nameOverride:
   image:
-    name: ric-dash-be
-    tag: 1.0.5
+    name: ric-dashboard
+    tag: 1.2.0
   properties:
-    e2mgr:
-      mock:
-        rannames: "ABCD123456, EFGH123456"
+    # application.properties
+    portalapi:
+      username: username
+      password: password
+    # key.properties
+    cipher.enc.key: AGLDdG4D04BKm2IxIWEr8o==
+    # portal.properties
+    # external URL for user browser
+    ecomp_redirect_url: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm
+    # internal URL for backend
+    ecomp_rest_url:     http://portal-app.onap:8989/ONAPPORTAL/auxapi
+    ueb_app_key: uebkey
 
 extsvcaux:
   ricip:
index 11d8096..002c313 100644 (file)
@@ -19,5 +19,5 @@ apiVersion: v1
 appVersion: "1.0"
 description: Helm Chart for RIC Dashboard
 name: dashboard
-version: 1.1.0
+version: 1.2.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
index 1aba1a6..992518b 100644 (file)
@@ -22,8 +22,8 @@ Generate the URLS of the endpoints.
 
 {{- define "dashboard.prefix.a1mediator" -}}
   {{- $ingress := ( include "common.ingressurl.ricplt" . ) -}}
-  {{- if .Values.dashboard.properties.a1med.url.prefix -}}
-    {{- printf "%s" .Values.dashboard.properties.a1med.url.prefix -}}
+  {{- if .Values.dashboard.a1med.url.prefix -}}
+    {{- printf "%s" .Values.dashboard.a1med.url.prefix -}}
   {{- else -}}
     {{- printf "http://%s/a1mediator" $ingress -}}
   {{- end -}}
@@ -31,8 +31,8 @@ Generate the URLS of the endpoints.
 
 {{- define "dashboard.prefix.anrxapp" -}}
   {{- $ingress := ( include "common.ingressurl.ricxapp" . ) -}}
-  {{- if .Values.dashboard.properties.anrxapp.url.prefix -}}
-    {{- printf "%s" .Values.dashboard.properties.anrxapp.url.prefix -}}
+  {{- if .Values.dashboard.anrxapp.url.prefix -}}
+    {{- printf "%s" .Values.dashboard.anrxapp.url.prefix -}}
   {{- else -}}
     {{- printf "http://%s/anr" $ingress -}}
   {{- end -}}
@@ -40,8 +40,8 @@ Generate the URLS of the endpoints.
 
 {{- define "dashboard.prefix.e2mgr" -}}
   {{- $ingress := ( include "common.ingressurl.ricplt" . ) -}}
-  {{- if .Values.dashboard.properties.e2mgr.url.prefix -}}
-    {{- printf "%s" .Values.dashboard.properties.e2mgr.url.prefix -}}
+  {{- if .Values.dashboard.e2mgr.url.prefix -}}
+    {{- printf "%s" .Values.dashboard.e2mgr.url.prefix -}}
   {{- else -}}
     {{- printf "http://%s/e2mgr" $ingress -}}
   {{- end -}}
@@ -49,8 +49,8 @@ Generate the URLS of the endpoints.
 
 {{- define "dashboard.prefix.appmgr" -}}
   {{- $ingress := ( include "common.ingressurl.ricplt" . ) -}}
-  {{- if .Values.dashboard.properties.appmgr.url.prefix -}}
-    {{- printf "%s" .Values.dashboard.properties.appmgr.url.prefix -}}
+  {{- if .Values.dashboard.appmgr.url.prefix -}}
+    {{- printf "%s" .Values.dashboard.appmgr.url.prefix -}}
   {{- else -}}
     {{- printf "http://%s/appmgr" $ingress -}}
   {{- end -}}
index b2ec787..68e1925 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
-# Defines a config map for mounting as file application.properties
+# Defines multiple config maps for mounting as files; e.g., application.properties
+# The keys listed below MUST be configured in each deployment;
+# this list does not include all keys recognized by the app.
+# The template directives in the URL prefix definitions use common
+# K8S ingress values, but use Dashboard values if present.
 
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: {{ include "common.configmapname.dashboard" . }}-appconfig
 data:
-  # this key becomes the filename when mounted
+  # one key per file
   application.properties: |
-    # appconfig.yaml
-    server.port = {{ include "common.serviceport.dashboard.container" . }}
-    a1med.url.prefix =   {{ include "dashboard.prefix.a1mediator" . }}
-    a1med.url.suffix =   {{ .Values.dashboard.properties.a1med.url.suffix   }}
+    server.port        = {{ include "common.serviceport.dashboard.container" . }}
+    userfile           = {{ .Values.dashboard.userfile }}
+    a1med.url.prefix   = {{ include "dashboard.prefix.a1mediator" . }}
+    a1med.url.suffix   = {{ .Values.dashboard.a1med.url.suffix   }}
     anrxapp.url.prefix = {{ include "dashboard.prefix.anrxapp" . }}
-    anrxapp.url.suffix = {{ .Values.dashboard.properties.anrxapp.url.suffix }}
-    appmgr.url.prefix =  {{ include "dashboard.prefix.appmgr" .  }}
-    appmgr.url.suffix =  {{ .Values.dashboard.properties.appmgr.url.suffix  }}
-    e2mgr.url.prefix =   {{ include "dashboard.prefix.e2mgr" .   }}
-    e2mgr.url.suffix =   {{ .Values.dashboard.properties.e2mgr.url.suffix   }}
+    anrxapp.url.suffix = {{ .Values.dashboard.anrxapp.url.suffix }}
+    appmgr.url.prefix  = {{ include "dashboard.prefix.appmgr" .  }}
+    appmgr.url.suffix  = {{ .Values.dashboard.appmgr.url.suffix  }}
+    e2mgr.url.prefix   = {{ include "dashboard.prefix.e2mgr" .   }}
+    e2mgr.url.suffix   = {{ .Values.dashboard.e2mgr.url.suffix   }}
+    portalapi.appname  = {{ .Values.dashboard.portalapi.appname  }}
+    portalapi.username = {{ .Values.dashboard.portalapi.username }}
+    portalapi.password = {{ .Values.dashboard.portalapi.password }}
+
+  key.properties: |
+    cipher.enc.key     = {{ .Values.dashboard.cipher.enc.key }}
+
+  portal.properties: |
+    # fixed values
+    portal.api.impl.class = org.oransc.ric.portal.dashboard.portalapi.PortalRestCentralServiceImpl
+    role_access_centralized = remote
+    # variable values
+    ecomp_redirect_url = {{ .Values.dashboard.portalapi.ecomp_redirect_url }}
+    ecomp_rest_url     = {{ .Values.dashboard.portalapi.ecomp_rest_url }}
+    ueb_app_key        = {{ .Values.dashboard.portalapi.ueb_app_key }}
index efe0106..f5561d7 100644 (file)
@@ -49,19 +49,32 @@ spec:
               containerPort: {{ include "common.serviceport.dashboard.container" . }}
               protocol: TCP
           volumeMounts:
-            - name: application-config
-              mountPath: /maven/application.properties
+            - 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
+            - name: dashboard-users
+              mountPath: /dashboard-data
           livenessProbe:
             httpGet:
-              path: /
+              path: /api/admin/version
               port: http
           readinessProbe:
             httpGet:
-              path: /
+              path: /api/admin/health
               port: http
       volumes:
-        - name: application-config
+        - name: appconfig
           configMap:
             name: {{ include "common.configmapname.dashboard" . }}-appconfig
+        - name: dashboard-users
+          persistentVolumeClaim:
+            claimName: pvc-{{ include "common.name.dashboard" . }}
diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolume.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolume.yaml
new file mode 100644 (file)
index 0000000..cb63ba9
--- /dev/null
@@ -0,0 +1,22 @@
+# Remove this persistent volume when cloud storage is available
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: pv-{{ include "common.name.dashboard" . }}
+spec:
+  capacity:
+    storage: {{ .Values.dashboard.storagesize }}
+  accessModes:
+  - ReadWriteOnce
+  persistentVolumeReclaimPolicy: Retain
+  storageClassName: storageclass-{{ include "common.name.dashboard" . }}
+  local:
+    path: {{ .Values.dashboard.datapath }}
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: dashboard-node
+          operator: In
+          values:
+          - enable
diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolumeClaim.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolumeClaim.yaml
new file mode 100644 (file)
index 0000000..a13dde1
--- /dev/null
@@ -0,0 +1,11 @@
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+  name:  pvc-{{ include "common.name.dashboard" . }}
+spec:
+  accessModes:
+  - ReadWriteOnce
+  storageClassName: storageclass-{{ include "common.name.dashboard" . }} 
+  resources:
+    requests:
+      storage: {{ .Values.dashboard.storagesize }}
diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/storageClass.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/storageClass.yaml
new file mode 100644 (file)
index 0000000..eb1fb94
--- /dev/null
@@ -0,0 +1,6 @@
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+  name: storageclass-{{ include "common.name.dashboard" . }}
+provisioner: kubernetes.io/no-provisioner
+volumeBindingMode: WaitForFirstConsumer
index 45dc0a1..d0a8817 100644 (file)
@@ -31,31 +31,48 @@ dashboard:
   # ric-common/Common-Template/helm/ric-common/templates/_ports.tpl file.
   # If need to change a service port, make the code change necessary, then
   # update the _ports.tpl file with the new port number.
+  # The keys listed below MUST be configured in each deployment;
+  # this list does not include all keys recognized by the app.
 
-  # config URLs must be specified at deployment
-  properties:
-    # The URL prefixes use K8S/Kong service names
-    a1med:
-      url:
-        # The default a1mediator endpoint is http://ricplt-entry/a1mediator
-        # You can override the a1mediator endpoint using the following option
-        # prefix:
-        suffix: ''
-    anrxapp:
-      url:
-        # The default anrxapp endpoint is http://ricxapp-entry/anr
-        # You can override the anrxapp endpoint using the following option
-        # prefix:
-        suffix: ''
-    appmgr:
-      url:
-        # The default appmgr endpoint is http://ricplt-entry/appmgr
-        # You can override the appmgr endpoint using the following option
-        # prefix:
-        suffix: /ric/v1
-    e2mgr:
-      url:
-        # The default e2mgr endpoint is http://ricplt-entry/e2mgr
-        # You can override the e2mgr endpoint using the following option
-        # prefix:
-        suffix: /v1
+  # persist user details as JSON to a persistent volume
+  storagesize: 1Mi
+  # in the container
+  userfile: /dashboard-data/users.json
+  # on the server
+  datapath: /tmp/dashboard-data
+
+  # The URL prefixes use K8S/Kong service names
+  a1med:
+    url:
+      # The default a1mediator prefix is http://ricplt-entry/a1mediator
+      # You can override the value using the following option
+      # prefix:
+      suffix: ''
+  anrxapp:
+    url:
+      # The default anrxapp prefix is http://ricxapp-entry/anr
+      # You can override the value using the following option
+      # prefix:
+      suffix: ''
+  appmgr:
+    url:
+      # The default appmgr prefix is http://ricplt-entry/appmgr
+      # You can override the value using the following option
+      # prefix:
+      suffix: /ric/v1
+  e2mgr:
+    url:
+      # The default e2mgr prefix is http://ricplt-entry/e2mgr
+      # You can override the value using the following option
+      # prefix:
+      suffix: /v1
+  cipher:
+    enc:
+      key:
+  portalapi:
+    appname: RIC-Dashboard
+    username:
+    password:
+    ecomp_redirect_url: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm
+    ecomp_rest_url: http://portal-app.onap:8989/ONAPPORTAL/auxapi
+    ueb_app_key: uebkey