From 8e21354a7b5d795a56c12e9847f79dc430425027 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Mon, 3 Feb 2020 14:09:33 -0500 Subject: [PATCH] Update Dashboard deployment for ver 2.0.0/R3 Use version 2.0.0 which requires properties in YAML format. Move some URL path components from prefix to suffix. Define a single region with a single instance in the aux recipe. Drop the template that generates URLs from common values. Signed-off-by: Lott, Christopher (cl778h) Change-Id: I3e86439ddf533899c9a453bb79d9d0c31d8b507b --- bin/verify-ric-charts | 29 +++------ ric-aux/RECIPE_EXAMPLE/example_recipe.yaml | 63 +++++------------- ric-aux/helm/dashboard/Chart.yaml | 2 +- ric-aux/helm/dashboard/templates/_genurl.tpl | 58 ----------------- ric-aux/helm/dashboard/templates/appconfig.yaml | 51 ++++++++------- ric-aux/helm/dashboard/templates/deployment.yaml | 4 +- .../helm/dashboard/templates/persistentVolume.yaml | 16 +++++ .../dashboard/templates/persistentVolumeClaim.yaml | 16 +++++ ric-aux/helm/dashboard/values.yaml | 74 ++++++++++++---------- 9 files changed, 127 insertions(+), 186 deletions(-) delete mode 100644 ric-aux/helm/dashboard/templates/_genurl.tpl diff --git a/bin/verify-ric-charts b/bin/verify-ric-charts index 3cdbab61..cf7b7a92 100755 --- a/bin/verify-ric-charts +++ b/bin/verify-ric-charts @@ -29,7 +29,7 @@ if [ -z "$HELM_REPO_PID" ]; then nohup helm serve >& /dev/null & fi -# Package ric-common and serve it using Helm local repo +echo "Package ric-common and serve it using Helm local repo" HELM_HOME=$(helm home) COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/ric-common @@ -39,16 +39,13 @@ AUX_COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/aux- helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/aux-common cp /tmp/aux-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/ - - helm repo index $HELM_HOME/repository/local/ - -# Make sure that helm local repo is added +echo "Make sure that helm local repo is added" helm repo remove local helm repo add local http://127.0.0.1:8879/charts -# Create array of helm charts +echo "Create array of helm charts" CHART_ARRAY=() while IFS= read -r -d $'\0'; do CHART_ARRAY+=("$REPLY") @@ -59,9 +56,8 @@ echo "***************************************" for dir in "${CHART_ARRAY[@]}" do - - echo "Update chart depenedency" - helm dep up $dir + echo "Update chart dependency for directory $dir" + helm dep up $dir # Lint clearly marks errors; e.g., [ERROR] if [ -z $OVERRIDEYAML ]; then helm lint $dir > /tmp/output 2>&1 @@ -69,8 +65,8 @@ do helm lint -f $OVERRIDEYAML $dir> /tmp/output 2>&1 fi echo "***************************************************************************************************************" - cat /tmp/output - + cat /tmp/output + egrep -q '^Error: [0-9]* chart\(s\) linted, [0-9]* chart\(s\) failed' /tmp/output && exit 1 echo "***************************************************************************************************************" @@ -80,15 +76,8 @@ do helm template -f $OVERRIDEYAML $dir > /tmp/output 2>&1 fi echo "***************************************************************************************************************" - cat /tmp/output - sleep 1 + cat /tmp/output + sleep 1 egrep -n '%!.\(.*=.*\)' /tmp/output && echo "Error: Type mismatch." && exit 1 echo "***************************************************************************************************************" - done -#Error: 1 chart(s) linted, 1 chart(s) failed - - - -exit 0 - diff --git a/ric-aux/RECIPE_EXAMPLE/example_recipe.yaml b/ric-aux/RECIPE_EXAMPLE/example_recipe.yaml index 20eabacd..e380e5ae 100644 --- a/ric-aux/RECIPE_EXAMPLE/example_recipe.yaml +++ b/ric-aux/RECIPE_EXAMPLE/example_recipe.yaml @@ -58,52 +58,12 @@ extsvcaux: dashboard: imagePullPolicy: IfNotPresent image: - registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + registry: nexus3.o-ran-sc.org:10004/o-ran-sc name: ric-dashboard - tag: 1.3.0 - # Many 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 - caasingress: - # Ignore SSL problems to CaaS-Ingress by enabling this - insecure: true - aux: - url: - # The default AUX CaaS-Ingress prefix is TBD - # You can override the value using the following option - # prefix: - suffix: /api - plt: - url: - # The default PLT CaaS-Ingress prefix is TBD - # You can override the value using the following option - # prefix: - suffix: /api - e2mgr: - url: - # The default e2mgr prefix is http://ricplt-entry/e2mgr - # You can override the value using the following option - # prefix: - suffix: /v1 + tag: 2.0.0 cipher: enc: - key: + key: AGLDdG4D04BKm2IxIWEr8o== portalapi: security: false appname: RIC-Dashboard @@ -112,11 +72,18 @@ dashboard: ecomp_redirect_url: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm ecomp_rest_url: http://portal-app:8989/ONAPPORTAL/auxapi ueb_app_key: uebkey - metrics: - url: - ac: http://ric-aux-kibana-server:5601/goto/1234567890abcdef?embed=true - mc: http://ric-aux-kibana-server:5601/goto/b35690798f2a32d065f5107aecd84308?embed=true - + # instances are passed as string and reformatted into YAML + ricinstances: | + regions: + - + name: Region PIZ-R4 + instances: + - + key: i1 + name: RIC + appUrlPrefix: http://ric-entry + caasUrlPrefix: http://caas-ingress-is-REC-only + pltUrlPrefix: http://ric-entry portal-mariadb: config: diff --git a/ric-aux/helm/dashboard/Chart.yaml b/ric-aux/helm/dashboard/Chart.yaml index 110927a1..95d34781 100644 --- a/ric-aux/helm/dashboard/Chart.yaml +++ b/ric-aux/helm/dashboard/Chart.yaml @@ -19,5 +19,5 @@ apiVersion: v1 appVersion: "1.0" description: Helm Chart for RIC Dashboard name: dashboard -version: 1.2.2 +version: 2.0.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/helm/dashboard/templates/_genurl.tpl b/ric-aux/helm/dashboard/templates/_genurl.tpl deleted file mode 100644 index dffb938d..00000000 --- a/ric-aux/helm/dashboard/templates/_genurl.tpl +++ /dev/null @@ -1,58 +0,0 @@ -################################################################################ -# Copyright (c) 2019 AT&T Intellectual Property. # -# Copyright (c) 2019 Nokia. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ -{{/* vim: set filetype=mustache: */}} -{{/* -Generate the URLS of the endpoints. -*/}} - - -{{- define "dashboard.prefix.a1mediator" -}} - {{- $ingress := ( include "common.ingresscontroller.url.platform" . ) -}} - {{- if .Values.dashboard.a1med.url.prefix -}} - {{- printf "%s" .Values.dashboard.a1med.url.prefix -}} - {{- else -}} - {{- printf "http://%s/a1mediator" $ingress -}} - {{- end -}} -{{- end -}} - -{{- define "dashboard.prefix.anrxapp" -}} - {{- $ingress := ( include "common.ingresscontroller.url.platform" . ) -}} - {{- if .Values.dashboard.anrxapp.url.prefix -}} - {{- printf "%s" .Values.dashboard.anrxapp.url.prefix -}} - {{- else -}} - {{- printf "http://%s/anr" $ingress -}} - {{- end -}} -{{- end -}} - -{{- define "dashboard.prefix.e2mgr" -}} - {{- $ingress := ( include "common.ingresscontroller.url.platform" . ) -}} - {{- if .Values.dashboard.e2mgr.url.prefix -}} - {{- printf "%s" .Values.dashboard.e2mgr.url.prefix -}} - {{- else -}} - {{- printf "http://%s/e2mgr" $ingress -}} - {{- end -}} -{{- end -}} - -{{- define "dashboard.prefix.appmgr" -}} - {{- $ingress := ( include "common.ingresscontroller.url.platform" . ) -}} - {{- if .Values.dashboard.appmgr.url.prefix -}} - {{- printf "%s" .Values.dashboard.appmgr.url.prefix -}} - {{- else -}} - {{- printf "http://%s/appmgr" $ingress -}} - {{- end -}} -{{- end -}} - diff --git a/ric-aux/helm/dashboard/templates/appconfig.yaml b/ric-aux/helm/dashboard/templates/appconfig.yaml index 424294ed..7f34a523 100644 --- a/ric-aux/helm/dashboard/templates/appconfig.yaml +++ b/ric-aux/helm/dashboard/templates/appconfig.yaml @@ -27,28 +27,35 @@ metadata: name: {{ include "common.configmapname.dashboard" . }}-appconfig data: # one key per file - application.properties: | - 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.anrxapp.url.suffix }} - appmgr.url.prefix = {{ include "dashboard.prefix.appmgr" . }} - appmgr.url.suffix = {{ .Values.dashboard.appmgr.url.suffix }} - caasingress.insecure = {{ .Values.dashboard.caasingress.insecure }} - caasingress.aux.url.prefix = {{ .Values.dashboard.caasingress.aux.url.prefix }} - caasingress.aux.url.suffix = {{ .Values.dashboard.caasingress.aux.url.suffix }} - caasingress.plt.url.prefix = {{ .Values.dashboard.caasingress.plt.url.prefix }} - caasingress.plt.url.suffix = {{ .Values.dashboard.caasingress.plt.url.suffix }} - e2mgr.url.prefix = {{ include "dashboard.prefix.e2mgr" . }} - e2mgr.url.suffix = {{ .Values.dashboard.e2mgr.url.suffix }} - portalapi.security = {{ .Values.dashboard.portalapi.security }} - portalapi.appname = {{ .Values.dashboard.portalapi.appname }} - portalapi.username = {{ .Values.dashboard.portalapi.username }} - portalapi.password = {{ .Values.dashboard.portalapi.password }} - metrics.url.ac = {{ .Values.dashboard.metrics.url.ac }} - metrics.url.mc = {{ .Values.dashboard.metrics.url.mc }} + application.yaml: | + server: + port: {{ include "common.serviceport.dashboard.container" . }} + userfile: {{ .Values.dashboard.userfile }} + portalapi: + # constants for all deployments + decryptor: org.oransc.ric.portal.dashboard.portalapi.PortalSdkDecryptorAes + usercookie: UserId + # different in all deployments + security: {{ .Values.dashboard.portalapi.security }} + appname: {{ .Values.dashboard.portalapi.appname }} + username: {{ .Values.dashboard.portalapi.username }} + password: {{ .Values.dashboard.portalapi.password }} + a1med: + url: + suffix: {{ .Values.dashboard.a1med.url.suffix }} + appmgr: + url: + suffix: {{ .Values.dashboard.appmgr.url.suffix }} + e2mgr: + url: + suffix: {{ .Values.dashboard.e2mgr.url.suffix }} + caasingress: + insecure: {{ .Values.dashboard.caasingress.insecure }} + plt: + url: + suffix: {{ .Values.dashboard.caasingress.plt.url.suffix }} + ricinstances: +{{ tpl .Values.dashboard.ricinstances . | indent 6 }} key.properties: | cipher.enc.key = {{ .Values.dashboard.cipher.enc.key }} diff --git a/ric-aux/helm/dashboard/templates/deployment.yaml b/ric-aux/helm/dashboard/templates/deployment.yaml index 503488ab..aab93f8d 100644 --- a/ric-aux/helm/dashboard/templates/deployment.yaml +++ b/ric-aux/helm/dashboard/templates/deployment.yaml @@ -54,8 +54,8 @@ spec: protocol: TCP volumeMounts: - name: appconfig - mountPath: /config/application.properties - subPath: application.properties + mountPath: /config/application.yaml + subPath: application.yaml readOnly: true - name: appconfig mountPath: /maven/key.properties diff --git a/ric-aux/helm/dashboard/templates/persistentVolume.yaml b/ric-aux/helm/dashboard/templates/persistentVolume.yaml index 01bc7b33..988b6a72 100644 --- a/ric-aux/helm/dashboard/templates/persistentVolume.yaml +++ b/ric-aux/helm/dashboard/templates/persistentVolume.yaml @@ -1,3 +1,19 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ {{- if not .Values.dashboard.storageclass }} kind: StorageClass diff --git a/ric-aux/helm/dashboard/templates/persistentVolumeClaim.yaml b/ric-aux/helm/dashboard/templates/persistentVolumeClaim.yaml index c436a424..0c6d3132 100644 --- a/ric-aux/helm/dashboard/templates/persistentVolumeClaim.yaml +++ b/ric-aux/helm/dashboard/templates/persistentVolumeClaim.yaml @@ -1,3 +1,19 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/ric-aux/helm/dashboard/values.yaml b/ric-aux/helm/dashboard/values.yaml index 68fb2d52..c1cd5504 100644 --- a/ric-aux/helm/dashboard/values.yaml +++ b/ric-aux/helm/dashboard/values.yaml @@ -17,13 +17,12 @@ # Deployment values for dashboard. - dashboard: imagePullPolicy: IfNotPresent image: registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" name: ric-dashboard - tag: 1.3.0 + tag: 2.0.0 replicaCount: 1 # Service ports are now defined in @@ -41,47 +40,27 @@ dashboard: userfile: /dashboard-data/users.json # on the server datapath: /opt/data/dashboard-data - - # Many URL prefixes use K8S/Kong service names + # The URL prefixes are specific to instances + # and may be K8S service names, see below. 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: '' + # uses pltUrlPrefix + suffix: /a1mediator appmgr: url: - # The default appmgr prefix is http://ricplt-entry/appmgr - # You can override the value using the following option - # prefix: - suffix: /ric/v1 + # uses pltUrlPrefix + suffix: /appmgr/ric/v1 caasingress: # Ignore SSL problems to CaaS-Ingress by enabling this insecure: true - aux: - url: - # The default AUX CaaS-Ingress prefix is TBD - # You can override the value using the following option - # prefix: - suffix: /api plt: url: - # The default PLT CaaS-Ingress prefix is TBD - # You can override the value using the following option - # prefix: + # uses caasUrlPrefix suffix: /api e2mgr: url: - # The default e2mgr prefix is http://ricplt-entry/e2mgr - # You can override the value using the following option - # prefix: - suffix: /v1 + # uses pltUrlPrefix + suffix: /e2mgr/v1 cipher: enc: key: @@ -93,7 +72,32 @@ dashboard: ecomp_redirect_url: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm ecomp_rest_url: http://portal-app:8989/ONAPPORTAL/auxapi ueb_app_key: uebkey - metrics: - url: - ac: http://ric-aux-kibana-server:5601/goto/1234567890abcdef?embed=true - mc: http://ric-aux-kibana-server:5601/goto/b35690798f2a32d065f5107aecd84308?embed=true + # Instance keys must be unique, but region names are for users only. + # Regions and instances are shown here only as documentation of the format. + ricinstances: | + regions: + - + name: Region AAA + instances: + - + key: i1 + name: Primary RIC Instance + appUrlPrefix: App prefix 1 + caasUrlPrefix: Caas prefix 1 + pltUrlPrefix: Plt prefix 1 + - + key: i2 + name: RIC Instance Nr Two + appUrlPrefix: App prefix 2 + caasUrlPrefix: Caas prefix 2 + pltUrlPrefix: Plt prefix 2 + - + name: Region DDD + instances: + - + key: i3 + name: RIC Instance in region D + appUrlPrefix: App prefix 3 + caasUrlPrefix: Caas prefix 3 + pltUrlPrefix: Plt prefix 3 +# end -- 2.16.6