From: Lusheng Ji Date: Fri, 2 Aug 2019 14:50:14 +0000 (+0000) Subject: Merge "Add keys, values and volumes for properties files" X-Git-Tag: 0.0.2~41 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=196ad58ec497f7339f3c964e933233b657189094;hp=7dcc52697c36fa991a0281cacc732b738337ded6;p=it%2Fdep.git Merge "Add keys, values and volumes for properties files" --- diff --git a/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE index 73e27f02..ef5d1fc0 100644 --- a/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE +++ b/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE @@ -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: diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml index 11d8096a..002c3139 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml @@ -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 diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl index 1aba1a6d..992518b2 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl @@ -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 -}} diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml index b2ec7877..68e19254 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml @@ -15,22 +15,41 @@ # 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 }} diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml index efe01062..f5561d7a 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml @@ -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 index 00000000..cb63ba9d --- /dev/null +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolume.yaml @@ -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 index 00000000..a13dde14 --- /dev/null +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/persistentVolumeClaim.yaml @@ -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 index 00000000..eb1fb94f --- /dev/null +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/storageClass.yaml @@ -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 diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml index 45dc0a11..d0a88170 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml @@ -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