exposing portal on port 8989 outside the cluster 25/45325/3
authorMandeep Khinda <mandeep.khinda@amdocs.com>
Mon, 30 Apr 2018 20:20:45 +0000 (20:20 +0000)
committerMandeep Khinda <mandeep.khinda@amdocs.com>
Tue, 1 May 2018 15:54:24 +0000 (15:54 +0000)
-introducing a loadBalancer object instead of node port.
  this will let us use port 8989 instead of 300xx
-removing port forwarding helper script
-making URLs configurable for flexibility

Issue-ID: OOM-633

Change-Id: I92a0205e6ed68b2217c08d124ddfaf1a1f73a6cd
Signed-off-by: Mandeep Khinda <mandeep.khinda@amdocs.com>
13 files changed:
kubernetes/portal/charts/portal-app/resources/config/deliveries/properties/ONAPPORTAL/fusion.properties
kubernetes/portal/charts/portal-app/resources/config/deliveries/properties/ONAPPORTAL/openid-connect.properties
kubernetes/portal/charts/portal-app/resources/config/deliveries/properties/ONAPPORTAL/portal.properties
kubernetes/portal/charts/portal-app/resources/config/deliveries/properties/ONAPPORTAL/system.properties
kubernetes/portal/charts/portal-app/templates/service.yaml
kubernetes/portal/charts/portal-app/values.yaml
kubernetes/portal/charts/portal-mariadb/resources/config/mariadb/oom_updates.sql
kubernetes/portal/charts/portal-mariadb/values.yaml
kubernetes/portal/charts/portal-sdk/resources/config/deliveries/properties/ONAPPORTALSDK/portal.properties
kubernetes/portal/charts/portal-sdk/resources/config/deliveries/properties/ONAPPORTALSDK/system.properties
kubernetes/portal/charts/portal-widget/resources/config/deliveries/properties/ONAPWIDGETMS/application.properties
kubernetes/portal/launch-onap-portal.sh [deleted file]
kubernetes/portal/values.yaml

index 876c5c7..9c6fc51 100755 (executable)
@@ -4,7 +4,7 @@
 # validator settings
 #default_error_message = Default error message
 
-login_url_no_ret_val = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm
+login_url_no_ret_val = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/login.htm
 
 user_attribute_name      = user
 
index 2a33551..f99b223 100755 (executable)
@@ -1,3 +1,3 @@
-authentication_server_url = http://portal.api.simpledemo.onap.org:8383/openid-connect-server-webapp/
-ecomp_openid_connect_client = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/openid_connect_login
-ecomp_redirect_uri = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/welcome.htm
+authentication_server_url = http://{{.Values.global.portalHostName}}:8383/openid-connect-server-webapp/
+ecomp_openid_connect_client = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/openid_connect_login
+ecomp_redirect_uri = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/welcome.htm
index 6157f29..7561e3a 100755 (executable)
@@ -5,10 +5,10 @@ max.idle.time = 5
 user.attribute.name = user_attribute
 
 # for single sign on
-ecomp_redirect_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm
+ecomp_redirect_url = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/login.htm
 
 # URL of the ECOMP Portal REST API
-ecomp_rest_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/auxapi
+ecomp_rest_url = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/auxapi
 
 ueb_listeners_enable = true
 
index 47c73cd..109d8d2 100755 (executable)
@@ -44,7 +44,7 @@ log_cron                      = 0 * * * * ? *
 sessiontimeout_feed_cron         = 0 0/5 * * * ? *
 
 #Front end URL
-frontend_url                  = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/applicationsHome
+frontend_url                  = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/applicationsHome
 
 
 # An Unqiue 128-bit value defined to indentify a specific version of
@@ -70,7 +70,7 @@ online_user_update_rate                  = 30
 online_user_update_duration       = 300
 
 #authenticate user server
-authenticate_user_server=http://portal.api.simpledemo.onap.org:8383/openid-connect-server-webapp/allUsers
+authenticate_user_server=http://{{.Values.global.portalHostName}}:8383/openid-connect-server-webapp/allUsers
 
 #window width threshold to collapse left/right menu when page onload
 window_width_threshold_left_menu = 1400
index f9339e6..4ccf2b0 100644 (file)
@@ -29,14 +29,14 @@ metadata:
           "version": "v2",
           "url": "/",
           "protocol": "REST"
-          "port": "8989",
+          "port": "{{ .Values.service.externalPort }}",
           "visualRange":"1"
       }
       ]'
 spec:
   type: {{ .Values.service.type }}
   ports:
-    {{if eq .Values.service.type "NodePort" -}}
+    {{- if or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer") }}
     - port: {{ .Values.service.externalPort }}
       targetPort: {{ .Values.service.internalPort }}
       nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
@@ -59,7 +59,7 @@ spec:
     - port: {{ .Values.service.externalPort3 }}
       targetPort: {{ .Values.service.internalPort3 }}
       name: {{ .Values.service.portName }}3
-    {{- end}}
+    {{- end }}
   selector:
     app: {{ include "common.name" . }}
     release: {{ .Release.Name }}
index b0ea028..657fa18 100644 (file)
@@ -31,9 +31,6 @@ repository: nexus3.onap.org:10001
 image: onap/portal-app:2.1-STAGING-latest
 pullPolicy: Always
 
-# flag to enable debugging - application support required
-debugEnabled: false
-
 # default number of instances
 replicaCount: 1
 
@@ -54,7 +51,7 @@ readiness:
   periodSeconds: 10
 
 service:
-  type: NodePort
+  type: LoadBalancer
   name: portal-app
   portName: portal-app
   externalPort: 8989
index 0163d31..f6bd05f 100644 (file)
@@ -5,20 +5,20 @@ Any updates required by OOM to the portaldb are made here.
 while the OOM K8s version has these service split up.
 */
 -- app_url is the FE, app_rest_endpoint is the BE
---portal-sdk => doesnt have a node port so this won't work
-update fn_app set app_url = 'http://portal-sdk.simpledemo.onap.org:8990/ONAPPORTALSDK/welcome.htm', app_rest_endpoint = 'http://portal-sdk:8990/ONAPPORTALSDK/api/v2' where app_name = 'xDemo App';
---dmaap-bc => the dmaap-bc chart actually opens 8080 and 8443, not 8989.  the chart isnt merged yet either. confirm the service name after bc chart merge
-update fn_app set app_url = 'http://dmaap-bc.simpledemo.onap.org:8989/ECOMPDBCAPP/dbc#/dmaap', app_rest_endpoint = 'http://dmaap-bc:8989/ECOMPDBCAPP/api/v2' where app_name = 'DMaaP Bus Ctrl';
+--portal-sdk => TODO: doesn't open a node port yet
+update fn_app set app_url = 'http://{{.Values.config.portalSdkHostName}}:{{.Values.config.portalSdkPort}}/ONAPPORTALSDK/welcome.htm', app_rest_endpoint = 'http://portal-sdk:8990/ONAPPORTALSDK/api/v2' where app_name = 'xDemo App';
+--dmaap-bc => the dmaap-bc doesn't open a node port..
+update fn_app set app_url = 'http://{{.Values.config.dmaapBcHostName}}:{{.Values.config.dmaapBcPort}}/ECOMPDBCAPP/dbc#/dmaap', app_rest_endpoint = 'http://dmaap-bc:8989/ECOMPDBCAPP/api/v2' where app_name = 'DMaaP Bus Ctrl';
 --sdc-be => 8443:30204, 8080:30205
 --sdc-fe => 8181:30206, 9443:30207
-update fn_app set app_url = 'http://sdc.api.fe.simpledemo.onap.org:8181/sdc1/portal', app_rest_endpoint = 'http://sdc-be:8080/api/v2' where app_name = 'SDC';
+update fn_app set app_url = 'http://{{.Values.config.sdcFeHostName}}:{{.Values.config.sdcFePort}}/sdc1/portal', app_rest_endpoint = 'http://sdc-be:8080/api/v2' where app_name = 'SDC';
 --pap => 8443:30219
-update fn_app set app_url = 'http://policy.api.simpledemo.onap.org:8443/onap/policy', app_rest_endpoint = 'http://pap:8443/onap/api/v2' where app_name = 'Policy';
+update fn_app set app_url = 'http://{{.Values.config.papHostName}}:{{.Values.config.papPort}}/onap/policy', app_rest_endpoint = 'http://pap:8443/onap/api/v2' where app_name = 'Policy';
 --vid => 8080:30200
-update fn_app set app_url = 'http://vid.api.simpledemo.onap.org:8080/vid/welcome.htm', app_rest_endpoint = 'http://vid:8080/vid/api/v2' where app_name = 'Virtual Infrastructure Deployment';
---sparky => sparky doesn't open a node port..
-update fn_app set app_url = 'http://aai.api.sparky.simpledemo.onap.org:8080/services/aai/webapp/index.html#/viewInspect', app_rest_endpoint = 'http://aai-sparky-be.{{.Release.Namespace}}:9517/api/v2' where app_name = 'A&AI UI';
+update fn_app set app_url = 'http://{{.Values.config.vidHostName}}:{{.Values.config.vidPort}}/vid/welcome.htm', app_rest_endpoint = 'http://vid:8080/vid/api/v2' where app_name = 'Virtual Infrastructure Deployment';
+--sparky => TODO: sparky doesn't open a node port yet
+update fn_app set app_url = 'http://{{.Values.config.aaiSparkyHostName}}:{{.Values.config.aaiSparkyPort}}/services/aai/webapp/index.html#/viewInspect', app_rest_endpoint = 'http://aai-sparky-be.{{.Release.Namespace}}:9517/api/v2' where app_name = 'A&AI UI';
 --cli => 8080:30260
-update fn_app set app_url = 'http://cli.api.simpledemo.onap.org:8080/', app_type = 1 where app_name = 'CLI';
+update fn_app set app_url = 'http://{{.Values.config.cliHostName}}:{{.Values.config.cliPort}}/', app_type = 1 where app_name = 'CLI';
 --msb-discovery => 10081:30281  this is clearly incorrect
-update fn_app set app_url = 'http://msb.api.discovery.simpledemo.onap.org:8080/iui/microservices/default.html' where app_name = 'MSB';
\ No newline at end of file
+update fn_app set app_url = 'http://{{.Values.config.msbDiscoveryHostName}}:{{.Values.config.msbDiscoveryPort}}/iui/microservices/default.html' where app_name = 'MSB';
\ No newline at end of file
index 8118db3..7d9b82a 100644 (file)
@@ -36,7 +36,38 @@ config:
   mariadbRootPassword: Aa123456
   #The directory where sql files are found in the projects gerrit repo.
   sqlSourceDirectory: portal/deliveries
-
+  # sdc frontend assignment for port 8181
+  sdcFePort: "30206"
+  # application's front end hostname.  Must be resolvable on the client side environment
+  sdcFeHostName: "sdc.api.fe.simpledemo.onap.org"
+  # policy pap ui assignment for port 8443
+  papPort: "30219"
+  # application's front end hostname.  Must be resolvable on the client side environment
+  papHostName: "policy.api.simpledemo.onap.org"
+  # vid ui  assignment for port 8080
+  vidPort: "30200"
+  # application's front end hostname.  Must be resolvable on the client side environment
+  vidHostName: "vid.api.simpledemo.onap.org"
+  # aai sparky ui assignment for port 8080
+  aaiSparkyPort: "" # TODO: populate with
+  # application's front end hostname.  Must be resolvable on the client side environment
+  aaiSparkyHostName: "aai.api.sparky.simpledemo.onap.org"
+  # cli ui  assignment for port 8080
+  cliPort: "30260"
+  # application's front end hostname.  Must be resolvable on the client side environment
+  cliHostName: "cli.api.simpledemo.onap.org"
+  # portal sdk (demo app) ui assignment for port 8990
+  portalSdkPort: "" # TODO: populate with port
+  # application's front end hostname.  Must be resolvable on the client side environment
+  portalSdkHostName: "portal-sdk.simpledemo.onap.org"
+  # dmaap bus controller ui assignment for port ?
+  dmaapBcPort: "" # TODO: populate with
+  # application's front end hostname.  Must be resolvable on the client side environment
+  dmaapBcHostName: "dmaap-bc.simpledemo.onap.org"
+  # msb discovery ui assignment for port ?
+  msbDiscoveryPort: "30281"
+  # application's front end hostname.  Must be resolvable on the client side environment
+  msbDiscoveryHostName: "msb.api.discovery.simpledemo.onap.org"
 
 # default number of instances
 replicaCount: 1
index 2b199cc..f161609 100755 (executable)
@@ -20,11 +20,11 @@ use_rest_for_functional_menu=true
 portal.api.impl.class = org.onap.portalapp.service.OnBoardingApiServiceImpl
 
 # CSP Global Log On for single sign on
-ecomp_redirect_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm
+ecomp_redirect_url = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/login.htm
 
 # URL of the ECOMP Portal REST API
 
-ecomp_rest_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/auxapi
+ecomp_rest_url = http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/auxapi
 
 # Applications do not need to run a UEB listener in 1610.
 ueb_listeners_enable = false
index 531c96c..2d92cd3 100755 (executable)
@@ -62,7 +62,7 @@ guard_notebook_url=
 
 #authenticate user server
 #TODO: what is this URL supposed to be pointing to?  Nothing in portal opens 8383
-authenticate_user_server=http://portal.api.simpledemo.onap.org:8383/openid-connect-server-webapp/allUsers
+authenticate_user_server=http://{{.Values.global.portalHostName}}:8383/openid-connect-server-webapp/allUsers
 
 #cookie domain
 cookie_domain = onap.org
index 547a882..7388349 100644 (file)
@@ -19,7 +19,7 @@ security.user.name=widget_user
 security.user.password=ENC(IjywcRnI9+nuVEh9+OFFiRWAjBT1n718)
 
 initialization.default.widgets=true
-initialization.widgetData.url=http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/commonWidgets
+initialization.widgetData.url=http://{{.Values.global.portalHostName}}:{{.Values.global.portalPort}}/ONAPPORTAL/commonWidgets
 
 ## Account Basic Authentication Properties
 account.user.name=portal
diff --git a/kubernetes/portal/launch-onap-portal.sh b/kubernetes/portal/launch-onap-portal.sh
deleted file mode 100755 (executable)
index d9f64c1..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/bash
-
-usage () { echo "Usage : $0 <namespace> <helm release name>"; }
-
-READY_JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
-
-NAMESPACE=$1
-RELEASE_NAME=$2
-
-if [ ! "$NAMESPACE" ] || [ ! "$RELEASE_NAME" ]
-then
-  usage
-  exit 1
-fi
-
-PORTAL_POD_NAME=`kubectl get pods --namespace $NAMESPACE --selector=app=portal-app,release=$RELEASE_NAME \
--o jsonpath='{.items[*].metadata.name}' -o jsonpath="$READY_JSONPATH" | grep "Ready=True"|awk -F: '{print $1}' `
-SDC_POD_NAME=`kubectl get pods --namespace $NAMESPACE --selector=app=sdc-fe,release=$RELEASE_NAME \
--o jsonpath='{.items[*].metadata.name}' -o jsonpath="$READY_JSONPATH" | grep "Ready=True" |awk -F: '{print $1}'`
-VID_POD_NAME=`kubectl get pods --namespace $NAMESPACE --selector=app=vid,release=$RELEASE_NAME \
--o jsonpath='{.items[*].metadata.name}' -o jsonpath="$READY_JSONPATH" | grep "Ready=True" |awk -F: '{print $1}'`
-POLICY_POD_NAME=`kubectl get pods --namespace $NAMESPACE --selector=app=pap,release=$RELEASE_NAME \
--o jsonpath='{.items[*].metadata.name}' -o jsonpath="$READY_JSONPATH" | grep "Ready=True" |awk -F: '{print $1}'`
-PORTALSDK_POD_NAME=`kubectl get pods --namespace $NAMESPACE --selector=app=portal-sdk,release=$RELEASE_NAME \
--o jsonpath='{.items[*].metadata.name}' -o jsonpath="$READY_JSONPATH" | grep "Ready=True" |awk -F: '{print $1}'`
-
-#TODO: Add more as testing progresses
-[[ -z "$PORTAL_POD_NAME" ]] && { echo "WARNING: portal-app is not running in your Kubernetes cluster"; }
-[[ -z "$SDC_POD_NAME" ]] && { echo "WARNING: sdc-fe is not running in your Kubernetes cluster"; }
-[[ -z "$VID_POD_NAME" ]] && { echo "WARNING: vid is not running in your Kubernetes cluster"; }
-[[ -z "$POLICY_POD_NAME" ]] && { echo "WARNING: pap is not running in your Kubernetes cluster"; }
-[[ -z "$PORTALSDK_POD_NAME" ]] && { echo "WARNING: portal-sdk is not running in your Kubernetes cluster"; }
-
-if [ ! -z "$PORTAL_POD_NAME" ]
-then
-  kubectl -n $NAMESPACE port-forward "$PORTAL_POD_NAME" 8989:8080 &
-  PORTAL_PID=$!
-fi
-
-if [ ! -z "$VID_POD_NAME" ]
-then
-  kubectl -n $NAMESPACE port-forward "$VID_POD_NAME" 8080:8080 &
-  VID_PID=$!
-fi
-
-if [ ! -z "$SDC_POD_NAME" ]
-then
-  kubectl -n $NAMESPACE port-forward "$SDC_POD_NAME" 8181:8181 &
-  SDC_PID=$!
-fi
-
-if [ ! -z "$POLICY_POD_NAME" ]
-then
-  kubectl -n $NAMESPACE port-forward "$POLICY_POD_NAME" 8443:8443 &
-  POLICY_PID=$!
-fi
-
-if [ ! -z "$PORTALSDK_POD_NAME" ]
-then
-  kubectl -n $NAMESPACE port-forward "$PORTALSDK_POD_NAME" 8990:8080 &
-  PORTALSDK_PID=$!
-fi
-
-trap "{ kill -9 $PORTAL_PID $VID_PID $SDC_PID $POLICY_PID $PORTALSDK_PID; exit 0; }" INT
-echo -e $'Press Ctrl+C to exit...\n'
-
-while :
-do
-  sleep 60
-done
\ No newline at end of file
index 949efad..ebbfbc3 100644 (file)
 global:
   env:
     tomcatDir: "/opt/apache-tomcat-8.0.37"
+  # portal frontend port
+  portalPort: "8989"
+  # application's front end hostname.  Must be resolvable on the client side environment
+  portalHostName: "portal.api.simpledemo.onap.org"
+
 config:
   logstashServiceName: log-ls
   logstashPort: 5044