From: Zhe Huang Date: Fri, 12 Jul 2019 14:47:45 +0000 (+0000) Subject: Merge "Update docker version" X-Git-Tag: 0.0.2~64 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=0309475769b27702c8c886411222882da8b519b1;hp=e7873992010cbe1274c8afc432b51be090bcd2d5;p=it%2Fdep.git Merge "Update docker version" --- diff --git a/.gitignore b/.gitignore index a245a231..2fd1c281 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.tar *.tgz *.swp +*.lock diff --git a/README.md b/README.md index 742ceb74..6b84be25 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,17 @@ different deployable components. The prefix of these subdirectories represents t prefix number the eariler the corresponding component will be deployed. Consider the following example, ├── ric-aux │   ├── 80-Auxiliary-Functions +│   ├── 85-Ext-Services │   └── README.md ├── ric-infra │   ├── 00-Kubernetes │   ├── 10-Nexus -│   ├── 20-Credential +│   ├── 20-Monitoring +│   ├── 40-Credential │   └── README.md ├── ric-platform │   ├── 50-RIC-Platform +│   ├── 55-Ext-Services │   └── README.md └── ric-xapps ├── 90-xApps diff --git a/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE index 2510331b..f1a62904 100644 --- a/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE +++ b/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE @@ -29,7 +29,7 @@ global: imagePullPolicy: Always # Helm repo that will be used by xApp manager - helmRepository: "https://ricaux-entry/helm" + helmRepository: "https://helm-entry" # Certificate of the helm repo helmRepositoryCert: xapp-mgr-certs @@ -46,13 +46,22 @@ global: # The port the xApp helm tiller is listening to helmRepositoryTillerPort: 44134 - - + # The ingress URL definitions for the ingress controller in four namespaces + ingressurl: + platform: ricplt-entry + xapp: ricxapp-entry + aux: ricaux-entry + infra: ricinfra-entry + localnexus: nexus-entry + localhelm: helm-entry + localdocker: docker-entry #------------------------------------------------------------------------- # Auxiliary Functions #------------------------------------------------------------------------- dashboard: + # Override the name using the following option + # nameOverride: image: name:: ric-dash-be tag: 1.0.5 @@ -63,4 +72,4 @@ dashboard: ext: ip: - 192.168.130.110 \ No newline at end of file + 192.168.130.110 diff --git a/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE index b97ef1c6..3912aeac 100644 --- a/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE +++ b/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE @@ -29,7 +29,7 @@ global: imagePullPolicy: Always # Helm repo that will be used by xApp manager - helmRepository: "https://ricaux-entry/helm" + helmRepository: "https://helm-entry" # Certificate of the helm repo helmRepositoryCert: xapp-mgr-certs @@ -46,6 +46,15 @@ global: # The port the xApp helm tiller is listening to helmRepositoryTillerPort: 44134 + # The ingress URL definitions for the ingress controller in four namespaces + ingressurl: + platform: ricplt-entry + xapp: ricxapp-entry + aux: ricaux-entry + infra: ricinfra-entry + localnexus: nexus-entry + localhelm: helm-entry + localdocker: docker-entry #------------------------------------------------------------------------- # Infrastructure #------------------------------------------------------------------------- @@ -56,17 +65,26 @@ cluster: useLocalHelmRepo: false useLocalDockerRegistry: false +credential: + repositoryCredential: + user: + password: + + + helmrepoCredential: + user: + password: + + helmCertificate: |2 + -----BEGIN CERTIFICATE----- + + -----END CERTIFICATE----- + +nexus: + image: + name: nexus-repository-helm-apt + tag: 1.0.0 + adminPassword: + datapath: /tmp/nexus3-data/ + storagesize: 20Gi -repositoryCredential: - user: "docker" - password: "docker" - - -helmrepoCredential: - user: "helm" - password: "helm" - - -adminPassword: admin123 - -datapath: /tmp/nexus3-data/ diff --git a/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE index 7be8304f..483e7364 100644 --- a/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE +++ b/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE @@ -29,7 +29,7 @@ global: imagePullPolicy: Always # Helm repo that will be used by xApp manager - helmRepository: "https://ricaux-entry/helm" + helmRepository: "https://helm-entry" # Certificate of the helm repo helmRepositoryCert: xapp-mgr-certs @@ -46,56 +46,83 @@ global: # The port the xApp helm tiller is listening to helmRepositoryTillerPort: 44134 + # The ingress URL definitions for the ingress controller in four namespaces + ingressurl: + platform: ricplt-entry + xapp: ricxapp-entry + aux: ricaux-entry + infra: ricinfra-entry + localnexus: nexus-entry + localhelm: helm-entry + localdocker: docker-entry #------------------------------------------------------------------------- # Platform Components #------------------------------------------------------------------------- # A1 Mediator a1mediator: + # Use the following option to override the docker registry value + # repositoryOverride: image: name: ric-plt-a1 tag: 0.8.3 + rmr_timeout_config: + rcv_retry_interval_ms: 500 + rcv_retry_times: 20 # xApp Manager appmgr: + # Use the following option to override the docker registry value + # repositoryOverride: image: name: appmgr tag: 1.0.4 + + # DBAAS dbaas: + # Use the following option to override the docker registry value + # repositoryOverride: backend: + iterminationGracePeriodSeconds: 0 image: name: ric-plt-dbaas tag: 0.1.0 # E2 Manager e2mgr: + # Use the following option to override the docker registry value + # repositoryOverride: image: name: e2mgr tag: 1.6.0 env: - RMR_RTG_SVC: "service-ricplt-rtmgr-rmr" RIC_ID: "bbbccc-abcd0e/20" # E2 Termination e2term: + # Use the following option to override the docker registry value + # repositoryOverride: image: name: e2 tag: 1.6.0 env: print: "1" - RMR_RTG_SVC: "service-ricplt-rtmgr-rmr" # Routing Manager rtmgr: + # Use the following option to override the docker registry value + # repositoryOverride: image: name: rtmgr tag: 0.0.2 # Subscription Manager submgr: + # Use the following option to override the docker registry value + # repositoryOverride: image: name: submgr tag: v0.1.0 @@ -103,4 +130,5 @@ submgr: # the service for redirecting to AUX cluster ext: ip: - 192.168.130.102 \ No newline at end of file + # The ip address of the aux cluster ingress controller + IP_ADDRESS diff --git a/ric-aux/80-Auxiliary-Functions/bin/install b/ric-aux/80-Auxiliary-Functions/bin/install index df15d9be..2526b66a 100755 --- a/ric-aux/80-Auxiliary-Functions/bin/install +++ b/ric-aux/80-Auxiliary-Functions/bin/install @@ -23,23 +23,45 @@ OVERRIDEYAML=$1 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -source $DIR/../etc/dashboard.conf +source $DIR/../etc/aux.conf if [ -z "$RICAUX_RELEASE_NAME" ];then RELEASE_NAME=$helm_release_name else RELEASE_NAME=$RICAUX_RELEASE_NAME fi + +# Namespace configuration +if [ -z "$RICPLT_NAMESPACE" ];then + PLT_NAMESPACE=$plt_namespace +else + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi if [ -z "$RICAUX_NAMESPACE" ];then - NAMESPACE=$namespace + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + INFRA_NAMESPACE=$infra_namespace +else + INFRA_NAMESPACE=$RICINFRA_NAMESPACE +fi + +if [ -z "$RIC_COMMON_OVERRIDE" ];then + COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE" else - NAMESPACE=$RICAUX_NAMESPACE + COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE fi RICAUX_COMPONENTS="dashboard ves message-router kong-aux" echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" @@ -56,7 +78,7 @@ for component in $RICAUX_COMPONENTS; do if [ $component = "kong-aux" ]; then mkdir -p $DIR/../helm/$component/charts helm dep up $DIR/../helm/$component - helm install --namespace ricaux --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off + helm install --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off continue fi @@ -65,8 +87,8 @@ for component in $RICAUX_COMPONENTS; do mkdir -p $DIR/../helm/$component/charts/ cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/ if [ -z $OVERRIDEYAML ]; then - helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install -f $OVERRIDEYAML --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component fi done diff --git a/ric-aux/80-Auxiliary-Functions/bin/uninstall b/ric-aux/80-Auxiliary-Functions/bin/uninstall index 67e68403..fcd1761a 100755 --- a/ric-aux/80-Auxiliary-Functions/bin/uninstall +++ b/ric-aux/80-Auxiliary-Functions/bin/uninstall @@ -22,23 +22,17 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -source $DIR/../etc/dashboard.conf +source $DIR/../etc/aux.conf if [ -z "$RICAUX_RELEASE_NAME" ];then RELEASE_NAME=$helm_release_name else RELEASE_NAME=$RICAUX_RELEASE_NAME fi -if [ -z "$RICAUX_NAMESPACE" ];then - NAMESPACE=$namespace -else - NAMESPACE=$RICAUX_NAMESPACE -fi RICAUX_COMPONENTS="dashboard message-router ves kong-aux" echo "Undeploying RIC AUX components [$RICAUX_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" diff --git a/ric-aux/80-Auxiliary-Functions/etc/dashboard.conf b/ric-aux/80-Auxiliary-Functions/etc/aux.conf similarity index 75% rename from ric-aux/80-Auxiliary-Functions/etc/dashboard.conf rename to ric-aux/80-Auxiliary-Functions/etc/aux.conf index 0ee625be..92008b59 100644 --- a/ric-aux/80-Auxiliary-Functions/etc/dashboard.conf +++ b/ric-aux/80-Auxiliary-Functions/etc/aux.conf @@ -17,9 +17,21 @@ # helm_release_name defines the release name helm will use to deploy RIC -# It will be overrided by RICAUX_RELEASE_NAME -helm_release_name=r0 +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r1 + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICPLT_NAMESPACE +plt_namespace=ricplt + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICXAPP_NAMESPACE +xapp_namespace=ricxapp # namespace defines the namespace that helm will use to deploy RIC # It will be overrided by RICAUX_NAMESPACE -namespace=ricaux +aux_namespace=ricaux + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICINFRA_NAMESPACE +infra_namespace=ricinfra diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl new file mode 100644 index 00000000..9f89c39c --- /dev/null +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_genurl.tpl @@ -0,0 +1,57 @@ +################################################################################ +# 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.endpoint.a1mediator" -}} + {{- $ingress := ( include "common.ingressurl.ricplt" . ) -}} + {{- if .Values.dashboard.properties.a1med.url.override -}} + {{- printf "%s" .Values.dashboard.properties.a1med.url.override -}} + {{- else -}} + {{- printf "http://%s/a1mediator%s" $ingress .Values.dashboard.properties.a1med.url.suffix -}} + {{- end -}} +{{- end -}} + +{{- define "dashboard.endpoint.anrxapp" -}} + {{- $ingress := ( include "common.ingressurl.ricxapp" . ) -}} + {{- if .Values.dashboard.properties.anrxapp.url.override -}} + {{- printf "%s" .Values.dashboard.properties.anrxapp.url.override -}} + {{- else -}} + {{- printf "http://%s/anr%s" $ingress .Values.dashboard.properties.anrxapp.url.suffix -}} + {{- end -}} +{{- end -}} + +{{- define "dashboard.endpoint.e2mgr" -}} + {{- $ingress := ( include "common.ingressurl.ricplt" . ) -}} + {{- if .Values.dashboard.properties.e2mgr.url.override -}} + {{- printf "%s" .Values.dashboard.properties.e2mgr.url.override -}} + {{- else -}} + {{- printf "http://%s/e2mgr%s" $ingress .Values.dashboard.properties.e2mgr.url.suffix -}} + {{- end -}} +{{- end -}} + +{{- define "dashboard.endpoint.xappmgr" -}} + {{- $ingress := ( include "common.ingressurl.ricplt" . ) -}} + {{- if .Values.dashboard.properties.xappmgr.url.override -}} + {{- printf "%s" .Values.dashboard.properties.xappmgr.url.override -}} + {{- else -}} + {{- printf "http://%s/appmgr%s" $ingress .Values.dashboard.properties.xappmgr.url.suffix -}} + {{- end -}} +{{- end -}} diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl deleted file mode 100644 index 2a6a3ccb..00000000 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl +++ /dev/null @@ -1,49 +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: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "dashboard.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "dashboard.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "dashboard.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- 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 837f4b1a..2b68de28 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml @@ -20,15 +20,15 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "dashboard.fullname" . }}-appconfig + name: {{ include "common.configmapname.dashboard" . }}-appconfig data: # 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 }} - # mock names for R1 testing, empty or missing entry disables the mock + server.port = {{ .Values.dashboard.service.http.containerPort }} + a1med.url = {{ include "dashboard.endpoint.a1mediator" . }} + anrxapp.url = {{ include "dashboard.endpoint.anrxapp" . }} + e2mgr.url = {{ include "dashboard.endpoint.e2mgr" . }} + # mock names for R1 testing, removing this entry disables the mock e2mgr.mock.rannames = {{ .Values.dashboard.properties.e2mgr.mock.rannames }} - xappmgr.url = {{ .Values.dashboard.properties.xappmgr.url }} + xappmgr.url = {{ include "dashboard.endpoint.xappmgr" . }} 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 a4b311da..adacef25 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml @@ -18,10 +18,10 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "dashboard.fullname" . }} - namespace: {{ include "common.namespace" . }} + name: {{ include "common.deploymentname.dashboard" . }} + namespace: {{ include "common.namespace.aux" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -29,24 +29,24 @@ spec: replicas: {{ .Values.dashboard.replicaCount }} selector: matchLabels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }} release: {{ .Release.Name }} spec: - hostname: {{ .Chart.Name }} + hostname: {{ include "common.name.dashboard" . }} imagePullSecrets: - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + - name: {{ include "common.containername.dashboard" . }} image: {{ include "common.repository" . }}/{{ .Values.dashboard.image.name }}:{{ .Values.dashboard.image.tag }} imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - name: http - containerPort: {{ .Values.dashboard.server.port }} + containerPort: {{ .Values.dashboard.service.http.containerPort }} protocol: TCP volumeMounts: - name: application-config @@ -64,4 +64,4 @@ spec: volumes: - name: application-config configMap: - name: {{ include "dashboard.fullname" . }}-appconfig + name: {{ include "common.configmapname.dashboard" . }}-appconfig diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml index 08a48875..b35e4085 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml @@ -18,20 +18,20 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "dashboard.fullname" . }} - namespace: {{ include "common.namespace" . }} + name: {{ include "common.servicename.dashboard.http" . }} + namespace: {{ include "common.namespace.aux" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: - type: {{ .Values.dashboard.service.type }} + type: NodePort ports: - - port: {{ .Values.dashboard.server.port }} - nodePort: {{ .Values.dashboard.service.port }} + - port: {{ .Values.dashboard.service.http.containerPort }} + nodePort: {{ .Values.dashboard.service.http.nodeport }} targetPort: http protocol: TCP selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.aux" . }}-{{ include "common.name.dashboard" . }} release: {{ .Release.Name }} diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml index 2b8e9a4f..17188ac5 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml @@ -26,27 +26,41 @@ dashboard: name: ric-dash-be tag: 1.0.5 replicaCount: 1 - server: - # Tomcat listens here - port: 8080 service: - type: NodePort - port: 30080 - name: dashboard-service + http: + nodeport: 30080 + # Tomcat listens here + containerPort: 8080 # config URLs must be specified at deployment properties: # These URLs use K8S/Kong service names a1med: - # no suffix required - url: http://ricplt-entry/a1mediator + # The URL will be provided by the RIC common template + url: + # no suffix required + suffix: "" + # You can override the URL using the following option + # override: http://ricplt-entry/a1mediator anrxapp: - # no suffix required - url: http://ricxapp-entry/anr + # The URL will be provided by the RIC common template + url: + # no suffix required + suffix: "" + # You can override the URL using the following option + # override: http://ricxapp-entry/anr e2mgr: - # suffix must be "/v1" - url: http://ricplt-entry/e2mgr/v1 + # The URL will be provided by the RIC common template + url: + # suffix must be "/v1" + suffix: "/v1" + # You can override the URL using the following option + # override: http://ricplt-entry/e2mgr/v1 mock: - rannames: "" # mock with CSV: "ABCD123456, EFGH123456" + rannames: "" # mock with CSV; e.g., ABCD123456, EFGH123456 xappmgr: - # suffix must be "/ric/v1" - url: http://ricplt-entry/appmgr/ric/v1 + # The URL will be provided by the RIC common template + url: + # suffix must be "/ric/v1" + suffix: "/ric/v1" + # You can override the URL using the following option + # override: http://ricplt-entry/appmgr/ric/v1 diff --git a/ric-aux/85-Ext-Services/bin/install b/ric-aux/85-Ext-Services/bin/install index 552c237d..39ca0ea7 100755 --- a/ric-aux/85-Ext-Services/bin/install +++ b/ric-aux/85-Ext-Services/bin/install @@ -29,16 +29,38 @@ if [ -z "$RICAUX_RELEASE_NAME" ];then else RELEASE_NAME=$RICAUX_RELEASE_NAME fi + +# Namespace configuration +if [ -z "$RICPLT_NAMESPACE" ];then + PLT_NAMESPACE=$plt_namespace +else + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi if [ -z "$RICAUX_NAMESPACE" ];then - NAMESPACE=$namespace + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + INFRA_NAMESPACE=$infra_namespace +else + INFRA_NAMESPACE=$RICINFRA_NAMESPACE +fi + +if [ -z "$RIC_COMMON_OVERRIDE" ];then + COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE" else - NAMESPACE=$RICAUX_NAMESPACE + COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE fi RICAUX_COMPONENTS="ext" echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" @@ -52,8 +74,8 @@ for component in $RICAUX_COMPONENTS; do mkdir -p $DIR/../helm/$component/charts/ cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/ if [ -z $OVERRIDEYAML ]; then - helm install --debug --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install --debug --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install -f $OVERRIDEYAML --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component fi done diff --git a/ric-aux/85-Ext-Services/bin/uninstall b/ric-aux/85-Ext-Services/bin/uninstall index 97edfa22..fd51c57c 100755 --- a/ric-aux/85-Ext-Services/bin/uninstall +++ b/ric-aux/85-Ext-Services/bin/uninstall @@ -29,16 +29,10 @@ if [ -z "$RICAUX_RELEASE_NAME" ];then else RELEASE_NAME=$RICAUX_RELEASE_NAME fi -if [ -z "$RICAUX_NAMESPACE" ];then - NAMESPACE=$namespace -else - NAMESPACE=$RICAUX_NAMESPACE -fi RICAUX_COMPONENTS="ext" echo "Undeploying RIC AUX components [$RICAUX_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" diff --git a/ric-aux/85-Ext-Services/etc/ext.conf b/ric-aux/85-Ext-Services/etc/ext.conf index 0ee625be..92008b59 100644 --- a/ric-aux/85-Ext-Services/etc/ext.conf +++ b/ric-aux/85-Ext-Services/etc/ext.conf @@ -17,9 +17,21 @@ # helm_release_name defines the release name helm will use to deploy RIC -# It will be overrided by RICAUX_RELEASE_NAME -helm_release_name=r0 +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r1 + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICPLT_NAMESPACE +plt_namespace=ricplt + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICXAPP_NAMESPACE +xapp_namespace=ricxapp # namespace defines the namespace that helm will use to deploy RIC # It will be overrided by RICAUX_NAMESPACE -namespace=ricaux +aux_namespace=ricaux + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICINFRA_NAMESPACE +infra_namespace=ricinfra diff --git a/ric-aux/README.md b/ric-aux/README.md index 34ce2cfd..c9ab4763 100644 --- a/ric-aux/README.md +++ b/ric-aux/README.md @@ -13,6 +13,7 @@ VEScollector) that interact with RIC using A1/O1 interfaces. │   ├── bin Contains deployment and uninstall scripts │   ├── etc Contains deployment configuration files │   └── helm Contains helm charts +├── 85-External Services Deployment scripts and chart for external service used by RIC to reach services outside of cluster └── README.md This file @@ -38,3 +39,21 @@ In the one-click deployment solution, the above setting will be overrided by env *RICAUX_RELEASE_NAME *RICAUX_NAMESPACE + +### To deploy the External services +The IP address described below should be the interface IP address of the VM hosting the platform cluster. +If the platform cluster is multi-node, any of the nodes can be specified here. + +```sh +$ # Set the value of ext/ip in values.yaml to be the external IP address. If you will use an override file and it has ext/ip set, +$ # make sure it is set correctly. +$ . ./85-Ext-Services/bin/install +$ # If you have an override value.yaml file, please use +$ #. ./85-Ext-Services/bin/install YOUR_OVERRIDE_FILE +``` + + +### To undeploy the Auxiliary Functions +```sh +$ . ./85-Ext-Services/bin/uninstall +``` \ No newline at end of file diff --git a/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl b/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl index 8cb57d74..7aa27956 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl @@ -56,3 +56,18 @@ {{- $name := ( include "common.fullname.nexus" . ) -}} {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- define "common.configmapname.dashboard" -}} + {{- $name := ( include "common.fullname.dashboard" . ) -}} + {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.configmapname.messagerouter" -}} + {{- $name := ( include "common.fullname.messagerouter" . ) -}} + {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.configmapname.ves" -}} + {{- $name := ( include "common.fullname.ves" . ) -}} + {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_containername.tpl b/ric-common/Common-Template/helm/ric-common/templates/_containername.tpl new file mode 100644 index 00000000..3935beb9 --- /dev/null +++ b/ric-common/Common-Template/helm/ric-common/templates/_containername.tpl @@ -0,0 +1,71 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* + Resolve the name of a chart's container. +*/}} + + +{{- define "common.containername.appmgr" -}} + {{- $name := ( include "common.fullname.appmgr" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.dbaas" -}} + {{- $name := ( include "common.fullname.dbaas" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.e2mgr" -}} + {{- $name := ( include "common.fullname.e2mgr" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.e2term" -}} + {{- $name := ( include "common.fullname.e2term" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.rtmgr" -}} + {{- $name := ( include "common.fullname.rtmgr" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.a1mediator" -}} + {{- $name := ( include "common.fullname.a1mediator" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.nexus" -}} + {{- $name := ( include "common.fullname.nexus" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.dashboard" -}} + {{- $name := ( include "common.fullname.dashboard" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.messagerouter" -}} + {{- $name := ( include "common.fullname.messagerouter" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.ves" -}} + {{- $name := ( include "common.fullname.ves" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_deploymentname.tpl b/ric-common/Common-Template/helm/ric-common/templates/_deploymentname.tpl index 4242ab84..185bfc1b 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_deploymentname.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_deploymentname.tpl @@ -50,9 +50,22 @@ {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} - - {{- define "common.deploymentname.nexus" -}} {{- $name := ( include "common.fullname.nexus" . ) -}} {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- define "common.deploymentname.dashboard" -}} + {{- $name := ( include "common.fullname.dashboard" . ) -}} + {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.deploymentname.messagerouter" -}} + {{- $name := ( include "common.fullname.messagerouter" . ) -}} + {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.deploymentname.ves" -}} + {{- $name := ( include "common.fullname.ves" . ) -}} + {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_ingressname.tpl b/ric-common/Common-Template/helm/ric-common/templates/_ingressname.tpl index 894ad050..f80063f4 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_ingressname.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_ingressname.tpl @@ -46,3 +46,8 @@ {{- $name := ( include "common.fullname.nexus" . ) -}} {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- define "common.ingressname.ves" -}} + {{- $name := ( include "common.fullname.ves" . ) -}} + {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_name.tpl b/ric-common/Common-Template/helm/ric-common/templates/_name.tpl index f7121844..9ad9ffac 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_name.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_name.tpl @@ -35,7 +35,8 @@ {{- define "common.fullname.appmgr" -}} {{- $name := ( include "common.name.appmgr" . ) -}} - {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -53,7 +54,8 @@ {{- define "common.fullname.dbaas" -}} {{- $name := ( include "common.name.dbaas" . ) -}} - {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -81,7 +83,8 @@ {{- define "common.fullname.e2mgr" -}} {{- $name := ( include "common.name.e2mgr" . ) -}} - {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- define "common.name.e2term" -}} @@ -99,7 +102,8 @@ {{- define "common.fullname.e2term" -}} {{- $name := ( include "common.name.e2term" . ) -}} - {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -125,7 +129,32 @@ {{- define "common.fullname.rtmgr" -}} {{- $name := ( include "common.name.rtmgr" . ) -}} - {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + + + + + +{{- define "common.name.submgr" -}} + {{- if .Values.submgr -}} + {{- if .Values.submgr.nameOverride -}} + {{- printf "%s" .Values.submgr.nameOverride -}} + {{- else -}} + {{- printf "submgr" -}} + {{- end -}} + {{- else -}} + {{- printf "submgr" -}} + {{- end -}} +{{- end -}} + + +{{- define "common.fullname.submgr" -}} + {{- $name := ( include "common.name.submgr" . ) -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -148,7 +177,8 @@ {{- define "common.fullname.a1mediator" -}} {{- $name := ( include "common.name.a1mediator" . ) -}} - {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} + {{- $namespace := ( include "common.namespace.platform" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -168,12 +198,68 @@ {{- define "common.fullname.nexus" -}} {{- $name := ( include "common.name.nexus" . ) -}} - {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} + {{- $namespace := ( include "common.namespace.infra" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + +{{- define "common.name.dashboard" -}} + {{- if .Values.dashboard -}} + {{- if .Values.dashboard.nameOverride -}} + {{- printf "%s" .Values.dashboard.nameOverride -}} + {{- else -}} + {{- printf "dashboard" -}} + {{- end -}} + {{- else -}} + {{- printf "dashboard" -}} + {{- end -}} {{- end -}} +{{- define "common.fullname.dashboard" -}} + {{- $name := ( include "common.name.dashboard" . ) -}} + {{- $namespace := ( include "common.namespace.aux" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.name.messagerouter" -}} + {{- if .Values.messagerouter -}} + {{- if .Values.messagerouter.nameOverride -}} + {{- printf "%s" .Values.messagerouter.nameOverride -}} + {{- else -}} + {{- printf "messagerouter" -}} + {{- end -}} + {{- else -}} + {{- printf "messagerouter" -}} + {{- end -}} +{{- end -}} +{{- define "common.fullname.messagerouter" -}} + {{- $name := ( include "common.name.messagerouter" . ) -}} + {{- $namespace := ( include "common.namespace.aux" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + +{{- define "common.name.ves" -}} + {{- if .Values.ves -}} + {{- if .Values.ves.nameOverride -}} + {{- printf "%s" .Values.ves.nameOverride -}} + {{- else -}} + {{- printf "ves" -}} + {{- end -}} + {{- else -}} + {{- printf "ves" -}} + {{- end -}} +{{- end -}} + + +{{- define "common.fullname.ves" -}} + {{- $name := ( include "common.name.ves" . ) -}} + {{- $namespace := ( include "common.namespace.aux" . ) -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} {{- define "common.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl b/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl index a657432b..c506a59c 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl @@ -22,6 +22,71 @@ - .Values.nsPrefix : override namespace prefix */}} + +{{- define "common.namespace.platform" -}} + {{- if .Values.global -}} + {{- if .Values.global.namespace -}} + {{- if .Values.global.namespace.platform -}} + {{- printf "%s" .Values.global.namespace.platform -}} + {{- else -}} + {{- printf "ricplt" -}} + {{- end -}} + {{- else -}} + {{- printf "ricplt" -}} + {{- end -}} + {{- else -}} + {{- printf "ricplt" -}} + {{- end -}} +{{- end -}} + +{{- define "common.namespace.aux" -}} + {{- if .Values.global -}} + {{- if .Values.global.namespace -}} + {{- if .Values.global.namespace.aux -}} + {{- printf "%s" .Values.global.namespace.aux -}} + {{- else -}} + {{- printf "ricaux" -}} + {{- end -}} + {{- else -}} + {{- printf "ricaux" -}} + {{- end -}} + {{- else -}} + {{- printf "ricaux" -}} + {{- end -}} +{{- end -}} + +{{- define "common.namespace.xapp" -}} + {{- if .Values.global -}} + {{- if .Values.global.namespace -}} + {{- if .Values.global.namespace.xapp -}} + {{- printf "%s" .Values.global.namespace.xapp -}} + {{- else -}} + {{- printf "ricxapp" -}} + {{- end -}} + {{- else -}} + {{- printf "ricxapp" -}} + {{- end -}} + {{- else -}} + {{- printf "ricxapp" -}} + {{- end -}} +{{- end -}} + +{{- define "common.namespace.infra" -}} + {{- if .Values.global -}} + {{- if .Values.global.namespace -}} + {{- if .Values.global.namespace.infra -}} + {{- printf "%s" .Values.global.namespace.infra -}} + {{- else -}} + {{- printf "ricinfra" -}} + {{- end -}} + {{- else -}} + {{- printf "ricinfra" -}} + {{- end -}} + {{- else -}} + {{- printf "ricinfra" -}} + {{- end -}} +{{- end -}} + {{- define "common.namespace" -}} {{- default .Release.Namespace .Values.nsPrefix -}} {{- end -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_serviceaccountname.tpl b/ric-common/Common-Template/helm/ric-common/templates/_serviceaccountname.tpl new file mode 100644 index 00000000..9daabc91 --- /dev/null +++ b/ric-common/Common-Template/helm/ric-common/templates/_serviceaccountname.tpl @@ -0,0 +1,71 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* + Resolve the name of a chart's serviceaccount +*/}} + + +{{- define "common.serviceaccountname.appmgr" -}} + {{- $name := ( include "common.fullname.appmgr" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.dbaas" -}} + {{- $name := ( include "common.fullname.dbaas" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.e2mgr" -}} + {{- $name := ( include "common.fullname.e2mgr" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.e2term" -}} + {{- $name := ( include "common.fullname.e2term" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.rtmgr" -}} + {{- $name := ( include "common.fullname.rtmgr" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.a1mediator" -}} + {{- $name := ( include "common.fullname.a1mediator" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.nexus" -}} + {{- $name := ( include "common.fullname.nexus" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.dashboard" -}} + {{- $name := ( include "common.fullname.dashboard" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.messagerouter" -}} + {{- $name := ( include "common.fullname.messagerouter" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceaccountname.ves" -}} + {{- $name := ( include "common.fullname.ves" . ) -}} + {{- printf "svcacct-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_servicename.tpl b/ric-common/Common-Template/helm/ric-common/templates/_servicename.tpl index c9804f55..b480cec7 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_servicename.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_servicename.tpl @@ -50,6 +50,11 @@ {{- printf "service-%s-rmr" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- define "common.servicename.submgr.rmr" -}} + {{- $name := ( include "common.fullname.submgr" . ) -}} + {{- printf "service-%s-rmr" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + {{- define "common.servicename.a1mediator.rmr" -}} {{- $name := ( include "common.fullname.a1mediator" . ) -}} {{- printf "service-%s-rmr" $name | trunc 63 | trimSuffix "-" -}} @@ -83,14 +88,30 @@ {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} - {{- define "common.servicename.nexus.http" -}} {{- $name := ( include "common.fullname.nexus" . ) -}} {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- define "common.servicename.dashboard.http" -}} + {{- $name := ( include "common.fullname.dashboard" . ) -}} + {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + ###################### TCP Service ################################## {{- define "common.servicename.dbaas.tcp" -}} {{- $name := ( include "common.fullname.dbaas" . ) -}} {{- printf "service-%s-tcp" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- define "common.servicename.messagerouter.tcp" -}} + {{- $name := ( include "common.fullname.messagerouter" . ) -}} + {{- printf "service-%s-tcp" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.servicename.ves.tcp" -}} + {{- $name := ( include "common.fullname.ves" . ) -}} + {{- printf "service-%s-tcp" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-infra/10-Nexus/bin/install b/ric-infra/10-Nexus/bin/install index f160a48e..f1ca83ab 100755 --- a/ric-infra/10-Nexus/bin/install +++ b/ric-infra/10-Nexus/bin/install @@ -27,16 +27,36 @@ if [ -z "$RICINFRA_RELEASE_NAME" ];then else RELEASE_NAME=$RICINFRA_RELEASE_NAME fi + +# Namespace configuration +if [ -z "$RICPLT_NAMESPACE" ];then + PLT_NAMESPACE=$plt_namespace +else + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi +if [ -z "$RICAUX_NAMESPACE" ];then + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi if [ -z "$RICINFRA_NAMESPACE" ];then - NAMESPACE=$namespace + INFRA_NAMESPACE=$infra_namespace else - NAMESPACE=$RICINFRA_NAMESPACE + INFRA_NAMESPACE=$RICINFRA_NAMESPACE fi - +if [ -z "$RIC_COMMON_OVERRIDE" ];then + COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE" +else + COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE +fi echo "Deploying nexus repo managers for local docker registry and helm repo." -echo "Name Space: $NAMESPACE" echo "Helm Release: $RELEASE_NAME" @@ -57,9 +77,9 @@ mkdir -p $DIR/../helm/charts/ cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/ if [ -z $OVERRIDEYAML ]; then -helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../helm +helm install --namespace $INFRA_NAMESPACE --name "${RELEASE_NAME}-nexus" $COMMON_OVERRIDE $DIR/../helm else -helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../helm +helm install -f $OVERRIDEYAML --namespace $INFRA_NAMESPACE --name "${RELEASE_NAME}-nexus" $COMMON_OVERRIDE $DIR/../helm fi diff --git a/ric-infra/10-Nexus/bin/uninstall b/ric-infra/10-Nexus/bin/uninstall index d185b61a..0f965dee 100755 --- a/ric-infra/10-Nexus/bin/uninstall +++ b/ric-infra/10-Nexus/bin/uninstall @@ -27,20 +27,10 @@ if [ -z "$RICINFRA_RELEASE_NAME" ];then else RELEASE_NAME=$RICINFRA_RELEASE_NAME fi -if [ -z "$RICINFRA_NAMESPACE" ];then - NAMESPACE=$namespace -else - NAMESPACE=$RICINFRA_NAMESPACE -fi -if [ -z "$INGRESS_PORT" ];then - INGRESS_PORT_NEXUS=$ingress_port -else - INGRESS_PORT_NEXUS=$INGRESS_PORT -fi + echo "Undeploying nexus repo managers for local docker registry and helm repo." -echo "Name Space: $NAMESPACE" echo "Helm Release: $RELEASE_NAME" helm delete --purge "${RELEASE_NAME}-nexus" diff --git a/ric-infra/10-Nexus/etc/nexus.conf b/ric-infra/10-Nexus/etc/nexus.conf index f706d463..038dbe76 100644 --- a/ric-infra/10-Nexus/etc/nexus.conf +++ b/ric-infra/10-Nexus/etc/nexus.conf @@ -16,14 +16,25 @@ ################################################################################ +# helm_release_name defines the release name helm will use to deploy RIC +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r1 -# helm_release_name defines the release name helm will use to deploy nexus -# It will be overrided by RICINFRA_RELEASE_NAME -helm_release_name=r0 +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICPLT_NAMESPACE +plt_namespace=ricplt -# namespace defines the namespace that helm will use to deploy nexus +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICXAPP_NAMESPACE +xapp_namespace=ricxapp + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICAUX_NAMESPACE +aux_namespace=ricaux + +# namespace defines the namespace that helm will use to deploy RIC # It will be overrided by RICINFRA_NAMESPACE -namespace=ricinfra +infra_namespace=ricinfra default_admin_password=admin123 diff --git a/ric-infra/10-Nexus/helm/templates/job-save-certs.yaml b/ric-infra/10-Nexus/helm/templates/job-save-certs.yaml index 6ed84d13..91f72efe 100644 --- a/ric-infra/10-Nexus/helm/templates/job-save-certs.yaml +++ b/ric-infra/10-Nexus/helm/templates/job-save-certs.yaml @@ -18,7 +18,7 @@ apiVersion: batch/v1 kind: Job metadata: - name: job-{{ include "common.name.nexus" . }}-save-certs + name: job-{{ include "common.fullname.nexus" . }}-save-certs spec: template: spec: diff --git a/ric-infra/20-Monitoring/bin/install b/ric-infra/20-Monitoring/bin/install index b7d0c6f1..a714ceea 100755 --- a/ric-infra/20-Monitoring/bin/install +++ b/ric-infra/20-Monitoring/bin/install @@ -29,10 +29,32 @@ if [ -z "$RICAUX_RELEASE_NAME" ];then else RELEASE_NAME=$RICAUX_RELEASE_NAME fi +# Namespace configuration +if [ -z "$RICPLT_NAMESPACE" ];then + PLT_NAMESPACE=$plt_namespace +else + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi if [ -z "$RICAUX_NAMESPACE" ];then - NAMESPACE=$namespace + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + INFRA_NAMESPACE=$infra_namespace +else + INFRA_NAMESPACE=$RICINFRA_NAMESPACE +fi + +if [ -z "$RIC_COMMON_OVERRIDE" ];then + COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE" else - NAMESPACE=$RICAUX_NAMESPACE + COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE fi #helm install --name my-release stable/elastic-stack --set elasticsearch.data.persistence.enabled=false --set elasticsearch.master.persistence.enabled=false --set logstash.persistence.enabled=false @@ -40,7 +62,6 @@ fi RICAUX_COMPONENTS="elfkp" echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" @@ -62,8 +83,8 @@ for component in $RICAUX_COMPONENTS; do #eval "$CMD" if [ -z $OVERRIDEYAML ]; then - helm install --debug --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $component + helm install --debug --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $component + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component fi done diff --git a/ric-infra/20-Monitoring/bin/uninstall b/ric-infra/20-Monitoring/bin/uninstall index dba83ea9..8a3ba149 100755 --- a/ric-infra/20-Monitoring/bin/uninstall +++ b/ric-infra/20-Monitoring/bin/uninstall @@ -29,16 +29,10 @@ if [ -z "$RICAUX_RELEASE_NAME" ];then else RELEASE_NAME=$RICAUX_RELEASE_NAME fi -if [ -z "$RICAUX_NAMESPACE" ];then - NAMESPACE=$namespace -else - NAMESPACE=$RICAUX_NAMESPACE -fi RICAUX_COMPONENTS="elfkp" echo "Undeploying RIC AUX components [$RICAUX_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" diff --git a/ric-infra/20-Monitoring/etc/elfkp.conf b/ric-infra/20-Monitoring/etc/elfkp.conf index 700ad791..92008b59 100644 --- a/ric-infra/20-Monitoring/etc/elfkp.conf +++ b/ric-infra/20-Monitoring/etc/elfkp.conf @@ -17,9 +17,21 @@ # helm_release_name defines the release name helm will use to deploy RIC -# It will be overrided by RICAUX_RELEASE_NAME -helm_release_name=r0 +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r1 + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICPLT_NAMESPACE +plt_namespace=ricplt + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICXAPP_NAMESPACE +xapp_namespace=ricxapp # namespace defines the namespace that helm will use to deploy RIC # It will be overrided by RICAUX_NAMESPACE -namespace=ricinfra +aux_namespace=ricaux + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICINFRA_NAMESPACE +infra_namespace=ricinfra diff --git a/ric-infra/40-Credential/bin/install b/ric-infra/40-Credential/bin/install index 1c38a863..bae31070 100755 --- a/ric-infra/40-Credential/bin/install +++ b/ric-infra/40-Credential/bin/install @@ -30,10 +30,32 @@ if [ -z "$RICPLT_RELEASE_NAME" ];then else RELEASE_NAME=$RICPLT_RELEASE_NAME fi +# Namespace configuration if [ -z "$RICPLT_NAMESPACE" ];then - NAMESPACE=$namespace + PLT_NAMESPACE=$plt_namespace else - NAMESPACE=$RICPLT_NAMESPACE + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi +if [ -z "$RICAUX_NAMESPACE" ];then + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + INFRA_NAMESPACE=$infra_namespace +else + INFRA_NAMESPACE=$RICINFRA_NAMESPACE +fi + +if [ -z "$RIC_COMMON_OVERRIDE" ];then + COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE" +else + COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE fi COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') @@ -45,8 +67,14 @@ cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/ if [ -z $OVERRIDEYAML ]; then - helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-${NAMESPACE}-credential" $DIR/../helm + helm install --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-${PLT_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm + helm install --namespace "${XAPP_NAMESPACE}" --name "${RELEASE_NAME}-${XAPP_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm + helm install --namespace "${AUX_NAMESPACE}" --name "${RELEASE_NAME}-${AUX_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm + helm install --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-${INFRA_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-${NAMESPACE}-credential" $DIR/../helm + helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-${PLT_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm + helm install -f $OVERRIDEYAML --namespace "${XAPP_NAMESPACE}" --name "${RELEASE_NAME}-${XAPP_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm + helm install -f $OVERRIDEYAML --namespace "${AUX_NAMESPACE}" --name "${RELEASE_NAME}-${AUX_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm + helm install -f $OVERRIDEYAML --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-${INFRA_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm fi diff --git a/ric-infra/40-Credential/bin/uninstall b/ric-infra/40-Credential/bin/uninstall index c820c7f7..4eda7978 100755 --- a/ric-infra/40-Credential/bin/uninstall +++ b/ric-infra/40-Credential/bin/uninstall @@ -30,11 +30,32 @@ if [ -z "$RICPLT_RELEASE_NAME" ];then else RELEASE_NAME=$RICPLT_RELEASE_NAME fi + +# Namespace configuration if [ -z "$RICPLT_NAMESPACE" ];then - NAMESPACE=$namespace + PLT_NAMESPACE=$plt_namespace +else + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi +if [ -z "$RICAUX_NAMESPACE" ];then + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + INFRA_NAMESPACE=$infra_namespace else - NAMESPACE=$RICPLT_NAMESPACE + INFRA_NAMESPACE=$RICINFRA_NAMESPACE fi -helm delete --purge "${RELEASE_NAME}-${NAMESPACE}-credential" +helm delete --purge "${RELEASE_NAME}-${PLT_NAMESPACE}-credential" +helm delete --purge "${RELEASE_NAME}-${XAPP_NAMESPACE}-credential" +helm delete --purge "${RELEASE_NAME}-${AUX_NAMESPACE}-credential" +helm delete --purge "${RELEASE_NAME}-${INFRA_NAMESPACE}-credential" + diff --git a/ric-infra/40-Credential/etc/credential.conf b/ric-infra/40-Credential/etc/credential.conf index c4fc9028..92008b59 100644 --- a/ric-infra/40-Credential/etc/credential.conf +++ b/ric-infra/40-Credential/etc/credential.conf @@ -16,12 +16,22 @@ ################################################################################ -# helm_release_name defines the release name helm will use to deploy the credential +# helm_release_name defines the release name helm will use to deploy RIC # It will be overrided by RICPLT_RELEASE_NAME -helm_release_name=r0 +helm_release_name=r1 -# namespace defines the namespace that helm will use to deploy the credential +# namespace defines the namespace that helm will use to deploy RIC # It will be overrided by RICPLT_NAMESPACE -namespace=ricplt +plt_namespace=ricplt +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICXAPP_NAMESPACE +xapp_namespace=ricxapp +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICAUX_NAMESPACE +aux_namespace=ricaux + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICINFRA_NAMESPACE +infra_namespace=ricinfra diff --git a/ric-infra/40-Credential/helm/resources/tls.crt b/ric-infra/40-Credential/helm/resources/tls.crt deleted file mode 100644 index 08bcca20..00000000 --- a/ric-infra/40-Credential/helm/resources/tls.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIJALB/C/KeS4iuMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD -VQQGEwJVUzETMBEGA1UECAwKTmV3IEplcnNleTETMBEGA1UEBwwKQmVkbWluc3Rl -cjENMAsGA1UECgwEQVQmVDEWMBQGA1UECwwNTGFicyBSZXNlYXJjaDEXMBUGA1UE -AwwOcmljaW5mcmEtZW50cnkxGzAZBgkqhkiG9w0BCQEWDHJpY0BvcmFuLm9yZzAe -Fw0xOTA2MjkwMjAyNTdaFw0yMDA2MjgwMjAyNTdaMIGUMQswCQYDVQQGEwJVUzET -MBEGA1UECAwKTmV3IEplcnNleTETMBEGA1UEBwwKQmVkbWluc3RlcjENMAsGA1UE -CgwEQVQmVDEWMBQGA1UECwwNTGFicyBSZXNlYXJjaDEXMBUGA1UEAwwOcmljaW5m -cmEtZW50cnkxGzAZBgkqhkiG9w0BCQEWDHJpY0BvcmFuLm9yZzCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAKSXZuxSxglJdRgrfYbaPIjivpv6fNPOQ3mL -LRAYWn4KwQFzwx+8c++BE4isG037hwsSbco8ZmFIduOdos7tqKSMPSwZkz7n6rUu -xgis2VGJhgcEzpsnqai+pmcbnu2IaisAR73V4ILCRQBn+5QIH7EXbPOGc9eyEvjq -s8zKSx73ScxUNFR3D3SPdPU3hGbGGb77LStfV3mzUigYd7zbfPjp0v50xRRMS/tr -nv9MjRtZjuKwLHJfMsoFJtMBIP/IoggSb1VfHZR8GJhFWxPu+lGGqFxiuylVIcp3 -mkxBZ5xfX13RHJshrGChtf/aqudju1j3hBbAxSkftFkkceQ0cTECAwEAAaNTMFEw -HQYDVR0OBBYEFDHaLptOqWPK9UdkcWlw6XnKx51IMB8GA1UdIwQYMBaAFDHaLptO -qWPK9UdkcWlw6XnKx51IMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQAD -ggEBAAKtolJatF/nbQU2jdTqq0iwGdG4vngRZvCUyQM2aVozb+znR44fOxbDtZ3V -z9gBicFjdGEtml3wWY1hiFkoJNQOMyAjZZ+Du17u0Y3HcQHCtvaODwHhjE6iQTEq -H8SAjWMQumrBkdGLUt+LkPoGbwS5JBv4vnVaEOkIf5uDCM2RQea2pZRmHDLYS8tT -sGdg5LVq4luu7NI/WIIoDH6OnSerenoqEZLIuTL62/kGqiNSzkpUCjQYWClCwlGX -CuDMDJuGIrdNt16mR3PAe4NkWeyMD2HeG/Ka2GdSq9UT5F4lDyDtOLqD+PCHjTMb -hCBc7V4Ppj0+JVHzXWU2m+5HK0Q= ------END CERTIFICATE----- diff --git a/ric-infra/40-Credential/helm/templates/_helper.tpl b/ric-infra/40-Credential/helm/templates/_helper.tpl index 83d49679..e908b87f 100644 --- a/ric-infra/40-Credential/helm/templates/_helper.tpl +++ b/ric-infra/40-Credential/helm/templates/_helper.tpl @@ -15,39 +15,6 @@ # limitations under the License. # ################################################################################ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "ricapp.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "ricapp.fullname" -}} -{{- if .Values.ricapp.fullnameOverride -}} -{{- .Values.ricapp.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.ricapp.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "ricapp.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - {{/* Resolve the image repository secret token. @@ -59,7 +26,7 @@ Create chart name and version as used by the chart label. */}} {{- define "repository.secret" -}} {{- $repo := include "common.repository" . }} - {{- $cred := .Values.repositoryCredential }} + {{- $cred := .Values.credential.repositoryCredential }} {{- $user := default "docker" $cred.user }} {{- $password := default "docker" $cred.password }} {{- $mail := default "@" $cred.mail }} @@ -70,12 +37,12 @@ Create chart name and version as used by the chart label. {{- define "helmrepo.secret.user" -}} - {{- $user := default "helm" .Values.helmrepoCredential.user -}} + {{- $user := default "helm" .Values.credential.helmrepoCredential.user -}} {{- printf "%s" $user |b64enc }} {{- end -}} {{- define "helmrepo.secret.password" -}} - {{- $pass := default "helm" .Values.helmrepoCredential.password -}} + {{- $pass := default "helm" .Values.credential.helmrepoCredential.password -}} {{- printf "%s" $pass |b64enc }} {{- end -}} diff --git a/ric-infra/40-Credential/helm/templates/config-helm-cert.yaml b/ric-infra/40-Credential/helm/templates/config-helm-cert.yaml index 7140d6bf..09620616 100644 --- a/ric-infra/40-Credential/helm/templates/config-helm-cert.yaml +++ b/ric-infra/40-Credential/helm/templates/config-helm-cert.yaml @@ -20,5 +20,6 @@ kind: ConfigMap metadata: name: xapp-mgr-certs data: - {{ (.Files.Glob "resources/tls.crt").AsConfig | nindent 2 }} + tls.crt: | + {{- .Values.credential.helmCertificate | nindent 4 }} diff --git a/ric-infra/40-Credential/helm/values.yaml b/ric-infra/40-Credential/helm/values.yaml index ad22a1ab..e47f912b 100644 --- a/ric-infra/40-Credential/helm/values.yaml +++ b/ric-infra/40-Credential/helm/values.yaml @@ -20,11 +20,18 @@ repository: "nexus3.o-ran-sc.org:10004" -repositoryCredential: - user: "docker" - password: "docker" - -helmrepoCredential: - user: "helm" - password: "helm" +credential: + repositoryCredential: + user: "docker" + password: "docker" + + + helmrepoCredential: + user: "helm" + password: "helm" + + helmCertificate: |2 + -----BEGIN CERTIFICATE----- + + -----END CERTIFICATE----- diff --git a/ric-infra/README.md b/ric-infra/README.md index 55251a62..487bfb7c 100644 --- a/ric-infra/README.md +++ b/ric-infra/README.md @@ -1,15 +1,16 @@ # RIC Infrastructure Support Helm charts, configuration files, and automation scripts that deploy a development enviroment for RIC. -A developer should star from here to create a kubernetes cluster that is pre-configured for RIC. -Such development cluster is mimicking a closed field-trial environment. - +A developer should start from here to create a kubernetes cluster that is pre-configured for RIC. +Such a development cluster is mimicking a closed field-trial environment. ### Directory Structure . ├── 00-Kubernetes Contains scripts to deploy K8S cluster ├── 10-Nexus Contains scripts and helm charts to deploy the docker registry and helm repo +├── 20-Monitoring Helm charts for installed ELFK stack +├── 40-Credential Helm charts to onboard credential and secrets for docker registry and helm repo └── README.md This file @@ -40,4 +41,26 @@ In the one-click deployment solution, the above setting will be overrided by env The installation process of the Nexus repo manager will generate certificates and credential for docker registry and helm repo. +### To deploy ELFK stack +```sh +$ # Modify the configuration files in ./20-Monitoring/etc/ +$ . ./20-Monitoring/bin/install +``` + + +### To onboard credentials +```sh +$ # Modify the user name and password in ./40-Credential/helm/values.yaml +$ # Alternatively, include the credential information in an override value yaml file +$ . ./40-Credential/bin/install +$ # If you have an override value.yaml file, please use +$ #. ./40-Credential/bin/install YOUR_OVERRIDE_FILE +``` + +### Credential Deployment Options +You can configure the Helm release name, Kubernetes namespace using configuration files located in ./40-Credential/etc/ +Please make sure that the namespace is the same one as the one used for RIC platform components. + + + TODO: Fill in the details about how to pass the credential to RIC diff --git a/ric-platform/50-RIC-Platform/bin/install b/ric-platform/50-RIC-Platform/bin/install index e4c031e9..ea7f493e 100755 --- a/ric-platform/50-RIC-Platform/bin/install +++ b/ric-platform/50-RIC-Platform/bin/install @@ -30,17 +30,39 @@ if [ -z "$RICPLT_RELEASE_NAME" ];then else RELEASE_NAME=$RICPLT_RELEASE_NAME fi + +# Namespace configuration if [ -z "$RICPLT_NAMESPACE" ];then - NAMESPACE=$namespace + PLT_NAMESPACE=$plt_namespace +else + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi +if [ -z "$RICAUX_NAMESPACE" ];then + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + INFRA_NAMESPACE=$infra_namespace +else + INFRA_NAMESPACE=$RICINFRA_NAMESPACE +fi + +if [ -z "$RIC_COMMON_OVERRIDE" ];then + COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE" else - NAMESPACE=$RICPLT_NAMESPACE + COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE fi RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator kong-platform kong-xapp" echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" @@ -57,24 +79,23 @@ for component in $RICPLT_COMPONENTS; do if [ $component = "kong-platform" ]; then mkdir -p $DIR/../helm/$component/charts helm dep up $DIR/../helm/$component - helm install --namespace ricplt --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off + helm install --namespace $PLT_NAMESPACE --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off continue fi if [ $component = "kong-xapp" ]; then mkdir -p $DIR/../helm/$component/charts helm dep up $DIR/../helm/$component - helm install --namespace ricxapp --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off + helm install --namespace $XAPP_NAMESPACE --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off continue fi - echo "not kong component" mkdir -p $DIR/../helm/$component/charts/ cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/ if [ -z $OVERRIDEYAML ]; then - helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component fi done diff --git a/ric-platform/50-RIC-Platform/bin/uninstall b/ric-platform/50-RIC-Platform/bin/uninstall index d4d2c627..38e7ca4c 100755 --- a/ric-platform/50-RIC-Platform/bin/uninstall +++ b/ric-platform/50-RIC-Platform/bin/uninstall @@ -29,18 +29,11 @@ if [ -z "$RICPLT_RELEASE_NAME" ];then else RELEASE_NAME=$RICPLT_RELEASE_NAME fi -if [ -z "$RICPLT_NAMESPACE" ];then - NAMESPACE=$namespace -else - NAMESPACE=$RICPLT_NAMESPACE -fi - RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator kong-platform kong-xapp" echo "Undeploying RIC Platform components [$RICPLT_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" diff --git a/ric-platform/50-RIC-Platform/etc/ric.conf b/ric-platform/50-RIC-Platform/etc/ric.conf index 29339d8b..92008b59 100644 --- a/ric-platform/50-RIC-Platform/etc/ric.conf +++ b/ric-platform/50-RIC-Platform/etc/ric.conf @@ -18,10 +18,20 @@ # helm_release_name defines the release name helm will use to deploy RIC # It will be overrided by RICPLT_RELEASE_NAME -helm_release_name=r0 +helm_release_name=r1 # namespace defines the namespace that helm will use to deploy RIC # It will be overrided by RICPLT_NAMESPACE -namespace=ricplt +plt_namespace=ricplt +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICXAPP_NAMESPACE +xapp_namespace=ricxapp + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICAUX_NAMESPACE +aux_namespace=ricaux +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICINFRA_NAMESPACE +infra_namespace=ricinfra diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/files/ricmanifest.json b/ric-platform/50-RIC-Platform/helm/a1mediator/resources/ricmanifest.json similarity index 100% rename from ric-platform/50-RIC-Platform/helm/a1mediator/files/ricmanifest.json rename to ric-platform/50-RIC-Platform/helm/a1mediator/resources/ricmanifest.json diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/files/rmr_string_int_mapping.txt b/ric-platform/50-RIC-Platform/helm/a1mediator/resources/rmr_string_int_mapping.txt similarity index 100% rename from ric-platform/50-RIC-Platform/helm/a1mediator/files/rmr_string_int_mapping.txt rename to ric-platform/50-RIC-Platform/helm/a1mediator/resources/rmr_string_int_mapping.txt diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/config.yaml b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/config.yaml index 7e52fda5..db68c150 100644 --- a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/config.yaml +++ b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/config.yaml @@ -23,21 +23,21 @@ metadata: data: local.rt: | newrt|start - rte|10060|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|10061|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10062|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10080|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10360|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|10361|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10362|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|12010|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|20001|{{ include "common.servicename.a1mediator.rmr" . }}.ricplt:4562 - rte|12011|service-ricxapp-admctrl-rmr.ricxapp:4563 - rte|12012|service-ricxapp-admctrl-rmr.ricxapp:4563 - rte|12021|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|12022|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|12050|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|20000|service-ricxapp-admctrl-rmr.ricxapp:4563 + rte|10060|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|10061|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10062|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10080|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10360|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|10361|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10362|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|12010|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|20001|{{ include "common.servicename.a1mediator.rmr" . }}.{{ include "common.namespace.platform" . }}:4562 + rte|12011|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 + rte|12012|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 + rte|12021|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|12022|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|12050|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|20000|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 newrt|end - rmr_string_int_mapping.txt: {{ tpl (.Files.Get "files/rmr_string_int_mapping.txt") . | quote }} - ricmanifest.json: {{ tpl (.Files.Get "files/ricmanifest.json") . | quote }} + rmr_string_int_mapping.txt: {{ tpl (.Files.Get "resources/rmr_string_int_mapping.txt") . | quote }} + ricmanifest.json: {{ tpl (.Files.Get "resources/ricmanifest.json") . | quote }} diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/deployment.yaml index 4eb0110d..dbd8857c 100644 --- a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/deployment.yaml @@ -20,9 +20,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "common.deploymentname.a1mediator" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -30,19 +30,19 @@ spec: replicas: {{ .Values.a1mediator.replicaCount }} selector: matchLabels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }} release: {{ .Release.Name }} spec: - hostname: {{ .Chart.Name }} + hostname: {{ include "common.name.a1mediator" . }} imagePullSecrets: - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + - name: {{ include "common.containername.a1mediator" . }} volumeMounts: - name: a1conf mountPath: /opt/ricmanifest.json @@ -53,21 +53,20 @@ spec: - name: a1conf mountPath: /opt/route/local.rt subPath: local.rt - env: - - name: PYTHONUNBUFFERED - value: "0" - - name: RMR_RCV_RETRY_INTERVAL - value: "{{ .Values.a1mediator.rmr_timeout_config.rcv_retry_interval_ms }}" - - name: RMR_RETRY_TIMES - value: "{{ .Values.a1mediator.rmr_timeout_config.rcv_retry_times }}" + envFrom: + - configMapRef: + name: {{ include "common.configmapname.a1mediator" . }}-env image: {{ include "common.repository" . }}/{{ .Values.a1mediator.image.name }}:{{ .Values.a1mediator.image.tag }} imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - name: http containerPort: {{ .Values.a1mediator.service.http.containerPort }} protocol: TCP - - name: rmr - containerPort: {{ .Values.a1mediator.service.rmr.containerPort }} + - name: rmrroute + containerPort: {{ .Values.a1mediator.service.rmr.route.port }} + protocol: TCP + - name: rmrdata + containerPort: {{ .Values.a1mediator.service.rmr.data.port }} protocol: TCP livenessProbe: httpGet: @@ -80,4 +79,4 @@ spec: volumes: - name: "a1conf" configMap: - name: {{ include "common.configmapname.a1mediator" . }}-a1conf \ No newline at end of file + name: {{ include "common.configmapname.a1mediator" . }}-a1conf diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/env.yaml b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/env.yaml new file mode 100644 index 00000000..3b4203aa --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/env.yaml @@ -0,0 +1,29 @@ +################################################################################ +# 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. # +################################################################################ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.configmapname.a1mediator" . }}-env +data: + DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_SERVICE_PORT: "6379" + DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_PORT_6379_TCP_PORT: "6379" + RMR_RTG_SVC: "{{ .Values.a1mediator.service.rmr.route.port }}" + PYTHONUNBUFFERED: "0" + RMR_RCV_RETRY_INTERVAL: "{{ .Values.a1mediator.rmr_timeout_config.rcv_retry_interval_ms }}" + RMR_RETRY_TIMES: "{{ .Values.a1mediator.rmr_timeout_config.rcv_retry_times }}" diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-http.yaml b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-http.yaml index c04f6f36..b0f5a499 100644 --- a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-http.yaml +++ b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-http.yaml @@ -19,9 +19,9 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.a1mediator.http" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -33,6 +33,6 @@ spec: name: "http" targetPort: "http" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-rmr.yaml b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-rmr.yaml index 987dde40..7f555ca8 100644 --- a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-rmr.yaml +++ b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/service-rmr.yaml @@ -19,19 +19,23 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.a1mediator.rmr" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: type: ClusterIP ports: - - port: {{ .Values.a1mediator.service.rmr.port }} + - port: {{ .Values.a1mediator.service.rmr.route.port }} protocol: "TCP" - name: "rmr" - targetPort: "rmr" + name: "rmrroute" + targetPort: "rmrroute" + - port: {{ .Values.a1mediator.service.rmr.data.port }} + protocol: "TCP" + name: "rmrdata" + targetPort: "rmrdata" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.a1mediator" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/values.yaml b/ric-platform/50-RIC-Platform/helm/a1mediator/values.yaml index d09cb189..7893d3c5 100644 --- a/ric-platform/50-RIC-Platform/helm/a1mediator/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/a1mediator/values.yaml @@ -29,15 +29,17 @@ a1mediator: image: name: ric-plt-a1 - tag: 0.8.2 + tag: 0.8.3 service: http: port: 10000 containerPort: 10000 rmr: - port: 4562 - containerPort: 4562 + route: + port: 4561 + data: + port: 4562 # these are ENV variables that A1 takes; see docs diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/resources/appenv.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/resources/appenv.yaml deleted file mode 100644 index 733bf073..00000000 --- a/ric-platform/50-RIC-Platform/helm/appmgr/resources/appenv.yaml +++ /dev/null @@ -1,5 +0,0 @@ -NAME: xappmgr -DBAAS_SERVICE_HOST: __DBAAS_SERVICE_HOST__ -DBAAS_SERVICE_PORT: "6379" -DBAAS_PORT_6379_TCP_ADDR: __DBAAS_SERVICE_HOST__ -DBAAS_PORT_6379_TCP_PORT: "6379" diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/resources/appmgr.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/resources/appmgr.yaml index c7c80863..62400389 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/resources/appmgr.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/resources/appmgr.yaml @@ -18,7 +18,7 @@ "retry": 1 "xapp": #Namespace to install xAPPs - "namespace": "ricxapp" + "namespace": __XAPP_NAMESPACE__ "tarDir": "/tmp" "schema": "descriptors/schema.json" "config": "config/config-file.json" diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml index 02275f02..1a152175 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml @@ -26,4 +26,5 @@ data: {{- $tiller := include "common.helmrepositorytiller" . | quote -}} {{- $tillernamespace := include "common.helmrepositorytillernamespace" . | quote -}} {{- $tillerport := include "common.helmrepositorytillerport" . | quote -}} - {{- (.Files.Glob "resources/appmgr.yaml").AsConfig | replace "__HELM_REPO__" $helmrepo | replace "__REST_PORT__" $restport | replace "__REPO_NAME__" $reponame | replace "__TILLER_SERVICE__" $tiller | replace "__TILLER_NAMESPACE__" $tillernamespace | replace "__TILLER_PORT__" $tillerport | nindent 2 }} + {{- $xappnamespace := include "common.namespace.xapp" . | quote -}} + {{- (.Files.Glob "resources/appmgr.yaml").AsConfig | replace "__XAPP_NAMESPACE__" $xappnamespace | replace "__HELM_REPO__" $helmrepo | replace "__REST_PORT__" $restport | replace "__REPO_NAME__" $reponame | replace "__TILLER_SERVICE__" $tiller | replace "__TILLER_NAMESPACE__" $tillernamespace | replace "__TILLER_PORT__" $tillerport | nindent 2 }} diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml index fafcb421..1ea190b8 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml @@ -19,9 +19,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "common.deploymentname.appmgr" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -29,27 +29,31 @@ spec: replicas: {{ .Values.appmgr.replicaCount }} selector: matchLabels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} release: {{ .Release.Name }} spec: - hostname: {{ .Chart.Name }} + hostname: {{ include "common.name.appmgr" . }} + serviceAccountName: {{ include "common.serviceaccountname.appmgr" . }} imagePullSecrets: - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + - name: {{ include "common.containername.appmgr" . }} image: {{ include "common.repository" . }}/{{ .Values.appmgr.image.name }}:{{ .Values.appmgr.image.tag }} imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - name: http containerPort: {{ .Values.appmgr.service.http.containerPort }} protocol: TCP - - name: rmr - containerPort: {{ .Values.appmgr.service.rmr.containerPort }} + - name: rmrroute + containerPort: {{ .Values.appmgr.service.rmr.route.port }} + protocol: TCP + - name: rmrdata + containerPort: {{ .Values.appmgr.service.rmr.data.port }} protocol: TCP volumeMounts: - name: config-volume @@ -61,7 +65,7 @@ spec: mountPath: {{ .Values.appmgr.appcertpath }} envFrom: - configMapRef: - name: {{ include "common.configmapname.appmgr" . }}-appenv + name: {{ include "common.configmapname.appmgr" . }}-env livenessProbe: #exec: # command: diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/env.yaml similarity index 78% rename from ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/templates/env.yaml index 07a20193..d371589b 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/env.yaml @@ -18,7 +18,11 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.configmapname.appmgr" . }}-appenv + name: {{ include "common.configmapname.appmgr" . }}-env data: - {{- $dbaasservicehost := include "common.servicename.dbaas.tcp" . | quote -}} - {{- (.Files.Get "resources/appenv.yaml") | replace "__DBAAS_SERVICE_HOST__" $dbaasservicehost | nindent 2 }} + NAME: "xappmgr" + DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_SERVICE_PORT: "6379" + DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_PORT_6379_TCP_PORT: "6379" + RMR_RTG_SVC: "{{ .Values.appmgr.service.rmr.route.port }}" diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-http.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-http.yaml index edc144d4..265b1e9c 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-http.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-http.yaml @@ -19,9 +19,9 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.appmgr.http" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -33,6 +33,6 @@ spec: name: "http" targetPort: "http" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-rmr.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-rmr.yaml index 972a2631..3451529d 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-rmr.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-rmr.yaml @@ -19,20 +19,24 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.appmgr.rmr" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: type: ClusterIP ports: - - port: {{ .Values.appmgr.service.rmr.port }} + - port: {{ .Values.appmgr.service.rmr.route.port }} protocol: "TCP" - name: "rmr" - targetPort: "rmr" + name: "rmrroute" + targetPort: "rmrroute" + - port: {{ .Values.appmgr.service.rmr.data.port }} + protocol: "TCP" + name: "rmrdata" + targetPort: "rmrdata" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-test.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-test.yaml new file mode 100644 index 00000000..b3ad56a6 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-test.yaml @@ -0,0 +1,38 @@ +################################################################################ +# 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. # +################################################################################ + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.servicename.dashboard.http" . }} + namespace: {{ include "common.namespace.platform" . }} + labels: + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.appmgr.service.http.port }} + protocol: "TCP" + name: "http" + targetPort: "http" + selector: + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.appmgr" . }} + release: {{ .Release.Name }} + diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/serviceaccount.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/serviceaccount.yaml new file mode 100644 index 00000000..8dbb63c7 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/serviceaccount.yaml @@ -0,0 +1,30 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "common.serviceaccountname.appmgr" . }} + namespace: {{ include "common.namespace.platform" . }} +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: Role +metadata: + name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.helmrepositorytillernamespace" . }}-access + namespace: {{ include "common.helmrepositorytillernamespace" . }} +rules: +- apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list"] +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: RoleBinding +metadata: + name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.helmrepositorytillernamespace" .}}-access + namespace: {{ include "common.helmrepositorytillernamespace" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.helmrepositorytillernamespace" .}}-access +subjects: + - kind: ServiceAccount + name: {{ include "common.serviceaccountname.appmgr" . }} + namespace: {{ include "common.namespace.platform" . }} diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml index 58a6a206..d0929ce3 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml @@ -24,7 +24,7 @@ repositoryCred: docker-reg-cred # By default a local helm repo is used. The global setting will override # the default value. You can further override using #helmRepositoryOverride: "" -helmRepository: "https://ricaux-entry/helm" +helmRepository: "https://helm-entry" # Default secret name for Helm Repo credential. .Value.golbal.helmRepositoryCred will # override the default value. You can further override uing @@ -78,8 +78,10 @@ appmgr: port: 8080 containerPort: 8080 rmr: - port: 4560 - containerPort: 4560 + route: + port: 4561 + data: + port: 4560 # config diff --git a/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml index d4213b2e..867b4c26 100644 --- a/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml @@ -19,9 +19,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "common.deploymentname.dbaas" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -29,12 +29,12 @@ spec: replicas: {{ .Values.dbaas.backend.replicas }} selector: matchLabels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }} release: {{ .Release.Name }} spec: imagePullSecrets: @@ -47,5 +47,5 @@ spec: - containerPort: {{ .Values.dbaas.backend.containerPort }} name: sql protocol: TCP - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + name: {{ include "common.containername.dbaas" . }} restartPolicy: Always diff --git a/ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml index d9ef65e4..d0f3df50 100644 --- a/ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml @@ -19,15 +19,15 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.dbaas.tcp" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }} release: {{ .Release.Name }} ports: - port: {{ .Values.dbaas.backend.port }} diff --git a/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml index 58b2febf..965aaa67 100644 --- a/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml @@ -27,4 +27,4 @@ dbaas: containerPort: 6379 image: name: ric-plt-dbaas - tag: latest \ No newline at end of file + tag: 0.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml index 35632c15..6c9b3181 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml @@ -20,24 +20,23 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "common.configmapname.e2mgr" . }}-router-configmap - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} data: router.txt: | newrt|start - rte|10060|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|10061|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10062|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10080|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10360|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|10361|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10362|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|12010|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|20001|{{ include "common.servicename.a1mediator.rmr" . }}.ricplt:4562 - rte|12011|service-ricxapp-admctrl-rmr.ricxapp:4563 - rte|12012|service-ricxapp-admctrl-rmr.ricxapp:4563 - rte|12021|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|12022|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|12050|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|20000|service-ricxapp-admctrl-rmr.ricxapp:4563 + rte|10060|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|10061|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10062|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10080|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10360|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|10361|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10362|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|12010|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|20001|{{ include "common.servicename.a1mediator.rmr" . }}.{{ include "common.namespace.platform" . }}:4562 + rte|12011|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 + rte|12012|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 + rte|12021|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|12022|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|12050|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|20000|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 newrt|end - diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml index e62dfd4a..330f1236 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml @@ -19,9 +19,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "common.deploymentname.e2mgr" .}} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2mgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -29,35 +29,35 @@ spec: replicas: {{ .Values.e2mgr.replicaCount }} selector: matchLabels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2mgr" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2mgr" . }} release: {{ .Release.Name }} spec: - hostname: {{ .Chart.Name }} + hostname: {{ include "common.name.e2mgr" . }} imagePullSecrets: - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + - name: {{ include "common.containername.e2mgr" . }} image: {{ include "common.repository" . }}/{{ .Values.e2mgr.image.name }}:{{ .Values.e2mgr.image.tag }} imagePullPolicy: {{ include "common.pullPolicy" . }} volumeMounts: - mountPath: /opt/E2Manager/router.txt name: local-router-file subPath: router.txt - env: - - name: RMR_RTG_SVC - value: "{{ .Values.e2mgr.env.RMR_RTG_SVC }}" - - name: RIC_ID - value: "{{ .Values.e2mgr.env.RIC_ID }}" + envFrom: + - configMapRef: + name: {{ include "common.configmapname.e2mgr" . }}-env ports: - name: "http" containerPort: {{ .Values.e2mgr.service.http.containerPort }} - - name: "rmr" - containerPort: {{ .Values.e2mgr.service.rmr.containerPort }} + - name: "rmrroute" + containerPort: {{ .Values.e2mgr.service.rmr.route.port }} + - name: "rmrdata" + containerPort: {{ .Values.e2mgr.service.rmr.data.port }} stdin: true tty: true securityContext: diff --git a/ric-xapps/90-xApps/scripts/ric_env.sh b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/env.yaml old mode 100755 new mode 100644 similarity index 74% rename from ric-xapps/90-xApps/scripts/ric_env.sh rename to ric-platform/50-RIC-Platform/helm/e2mgr/templates/env.yaml index ea960c19..b37cfc42 --- a/ric-xapps/90-xApps/scripts/ric_env.sh +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/env.yaml @@ -1,4 +1,3 @@ -#!/bin/bash ################################################################################ # Copyright (c) 2019 AT&T Intellectual Property. # # Copyright (c) 2019 Nokia. # @@ -15,10 +14,14 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ - - -# customize the following repo info to local environment -export __RICENV_SET__='true' -export __RUNRICENV_DOCKER_HOST__='192.168.0.6' -export __RUNRICENV_DOCKER_PORT__='5000' -export __RUNRICENV_HELMREPO_DIR__='/var/www/html/charts/' \ No newline at end of file +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.configmapname.e2mgr" . }}-env +data: + DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_SERVICE_PORT: "6379" + DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_PORT_6379_TCP_PORT: "6379" + RMR_RTG_SVC: "{{ .Values.e2mgr.service.rmr.route.port }}" + RIC_ID: "{{ .Values.e2mgr.env.RIC_ID }}" diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-http.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-http.yaml index 95e05901..5e309247 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-http.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-http.yaml @@ -19,9 +19,9 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.e2mgr.http" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2mgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -33,5 +33,5 @@ spec: name: "http" targetPort: "http" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2mgr" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-rmr.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-rmr.yaml index d7d39d97..6a4bdade 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-rmr.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-rmr.yaml @@ -19,19 +19,23 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.e2mgr.rmr" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2mgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: type: ClusterIP ports: - - port: {{ .Values.e2mgr.service.rmr.port }} + - port: {{ .Values.e2mgr.service.rmr.route.port }} protocol: "TCP" - name: "rmr" - targetPort: "rmr" + name: "rmrroute" + targetPort: "rmrroute" + - port: {{ .Values.e2mgr.service.rmr.data.port }} + protocol: "TCP" + name: "rmrdata" + targetPort: "rmrdata" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2mgr" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml index 9a84755f..f2509d8b 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml @@ -45,7 +45,6 @@ e2mgr: replicaCount: 1 env: - RMR_RTG_SVC: "ric-full-rtmgr" RIC_ID: "bbbccc-abcd0e/20" service: @@ -53,5 +52,7 @@ e2mgr: port: 3800 containerPort: 3800 rmr: - port: 3801 - containerPort: 3801 + route: + port: 4561 + data: + port: 3801 diff --git a/ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml index d82ab13f..8bd6c124 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml @@ -20,23 +20,23 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "common.configmapname.e2term" . }}-router-configmap - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} data: router.txt: | newrt|start - rte|10060|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|10061|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10062|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10080|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10360|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|10361|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|10362|{{ include "common.servicename.e2mgr.rmr" . }}.ricplt:3801 - rte|12010|{{ include "common.servicename.e2term.rmr" . }}.ricplt:38000 - rte|20001|{{ include "common.servicename.a1mediator.rmr" . }}.ricplt:4562 - rte|12011|service-ricxapp-admctrl-rmr.ricxapp:4563 - rte|12012|service-ricxapp-admctrl-rmr.ricxapp:4563 - rte|12021|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|12022|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|12050|service-ricxapp-admctrl-rmr.ricxapp:4563;service-ricxapp-ueec-rmr.ricxapp:4560 - rte|20000|service-ricxapp-admctrl-rmr.ricxapp:4563 + rte|10060|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|10061|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10062|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10080|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10360|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|10361|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|10362|{{ include "common.servicename.e2mgr.rmr" . }}.{{ include "common.namespace.platform" . }}:3801 + rte|12010|{{ include "common.servicename.e2term.rmr" . }}.{{ include "common.namespace.platform" . }}:38000 + rte|20001|{{ include "common.servicename.a1mediator.rmr" . }}.{{ include "common.namespace.platform" . }}:4562 + rte|12011|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 + rte|12012|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 + rte|12021|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|12022|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|12050|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563;service-ricxapp-ueec-rmr.{{ include "common.namespace.xapp" . }}:4560 + rte|20000|service-ricxapp-admctrl-rmr.{{ include "common.namespace.xapp" . }}:4563 newrt|end diff --git a/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml index f3b5ce2a..993fd52d 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml @@ -19,9 +19,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "common.deploymentname.e2term" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -29,39 +29,35 @@ spec: replicas: {{ .Values.e2term.replicaCount }} selector: matchLabels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} release: {{ .Release.Name }} spec: - hostname: {{ .Chart.Name }} + hostname: {{ include "common.name.e2term" . }} hostNetwork: true dnsPolicy: ClusterFirstWithHostNet imagePullSecrets: - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ .Chart.Name }} + - name: {{ include "common.containername.e2term" . }} image: {{ include "common.repository" . }}/{{ .Values.e2term.image.name }}:{{ .Values.e2term.image.tag }} imagePullPolicy: {{ include "common.pullPolicy" . }} volumeMounts: - mountPath: /opt/e2/router.txt name: local-router-file subPath: router.txt - env: - - name: sctp - value: "5577" - - name: nano - value: "{{ .Values.e2term.service.rmr.port }}" - - name: print - value: "{{ .Values.e2term.env.print }}" - - name: RMR_RTG_SVC - value: "{{ .Values.e2term.env.RMR_RTG_SVC }}" + envFrom: + - configMapRef: + name: {{ include "common.configmapname.e2term" . }}-env ports: - - name: "rmr" - containerPort: {{ .Values.e2term.service.rmr.containerPort }} + - name: "rmrroute" + containerPort: {{ .Values.e2term.service.rmr.route.port }} + - name: "rmrdata" + containerPort: {{ .Values.e2term.service.rmr.data.port }} stdin: true tty: true securityContext: diff --git a/ric-platform/50-RIC-Platform/helm/e2term/templates/env.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/env.yaml new file mode 100644 index 00000000..7637a413 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/env.yaml @@ -0,0 +1,29 @@ +################################################################################ +# 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. # +################################################################################ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.configmapname.e2term" . }}-env +data: + DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_SERVICE_PORT: "6379" + DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_PORT_6379_TCP_PORT: "6379" + RMR_RTG_SVC: "{{ .Values.e2term.service.rmr.route.port }}" + sctp: "5577" + nano: "{{ .Values.e2term.service.rmr.data.port }}" + print: "{{ .Values.e2term.env.print }}" diff --git a/ric-platform/50-RIC-Platform/helm/e2term/templates/service-rmr.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/service-rmr.yaml index 08a8a4c6..f4cf20a9 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/templates/service-rmr.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/service-rmr.yaml @@ -19,19 +19,23 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.e2term.rmr" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: type: ClusterIP ports: - - port: {{ .Values.e2term.service.rmr.port }} + - port: {{ .Values.e2term.service.rmr.route.port }} protocol: "TCP" - targetPort: "rmr" - name: "rmr" + targetPort: "rmrroute" + name: "rmrroute" + - port: {{ .Values.e2term.service.rmr.data.port }} + protocol: "TCP" + targetPort: "rmrdata" + name: "rmrdata" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.e2term" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/e2term/values.yaml b/ric-platform/50-RIC-Platform/helm/e2term/values.yaml index 17d2c5cf..f40e0684 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/values.yaml @@ -36,16 +36,17 @@ repositoryCred: docker-reg-cred e2term: image: name: e2 - tag: 1.0.0 + tag: 1.6.0 replicaCount: 1 env: print: "1" - RMR_RTG_SVC: "ric-full-rtmgr" service: rmr: - port: 38000 - containerPort: 38000 + route: + port: 4561 + data: + port: 38000 diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/config.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/config.yaml new file mode 100644 index 00000000..9cd05fa3 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/config.yaml @@ -0,0 +1,51 @@ +# +#================================================================================== +# 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. +#================================================================================== +# +# +# Abstract: Configuration values for the routing manager +# Date: 29 May 2019 +# +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.configmapname.rtmgr" . }}-rtmgrcfg +data: + # FQDN and port info of the platform components for routing manager to form + # and distribute corresponding routes to them + rtmgrcfg: | + { + "PlatformComponents": + [ + { + "name": "E2TERM", + "fqdn": "{{ include "common.servicename.e2term.rmr" . }}", + "port": 4561 + }, + { + "name": "SUBMAN", + "fqdn": "{{ include "common.servicename.submgr.rmr" . }}", + "port": 4561 + }, + { + "name": "E2MAN", + "fqdn": "{{ include "common.servicename.e2mgr.rmr" . }}", + "port": 4561 + } + ] + } + diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/deployment.yaml index d6f3259b..fd930045 100644 --- a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/deployment.yaml @@ -19,9 +19,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "common.deploymentname.rtmgr" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.rtmgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} @@ -29,37 +29,41 @@ spec: replicas: {{ .Values.rtmgr.replicaCount }} selector: matchLabels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.rtmgr" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.rtmgr" . }} release: {{ .Release.Name }} spec: - hostname: {{ .Chart.Name }} + hostname: {{ include "common.name.rtmgr" . }} imagePullSecrets: - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + - name: {{ include "common.containername.rtmgr" . }} image: {{ include "common.repository" . }}/{{ .Values.rtmgr.image.name }}:{{ .Values.rtmgr.image.tag }} imagePullPolicy: {{ include "common.pullPolicy" . }} command: ["/run_rtmgr.sh"] - env: - - name: XMURL - value: "http://{{ include "common.servicename.appmgr.http" . }}:8080/ric/v1/xapps" - - name: SOCKET - value: "tcp://0.0.0.0:4560" - - name: RTFILE - value: "/db/rt.json" - - name: NBI - value: "httpGetter" - - name: SBI - value: "nngpub" - - name: RPE - value: "rmr" - - name: SDL - value: "file" + #command: ["/bin/sh"] + #args: ["-c", "while true; do echo hello; sleep 10;done"] + envFrom: + - configMapRef: + name: {{ include "common.configmapname.rtmgr" . }}-env + volumeMounts: + - mountPath: /cfg + name: rtmgrcfg + readOnly: true ports: - - name: "rmr" - containerPort: {{ .Values.rtmgr.service.rmr.containerPort }} + - name: "rmrroute" + containerPort: {{ .Values.rtmgr.service.rmr.route.port }} + - name: "rmrdata" + containerPort: {{ .Values.rtmgr.service.rmr.data.port }} + volumes: + - name: "rtmgrcfg" + configMap: + name: {{ include "common.configmapname.rtmgr" . }}-rtmgrcfg + items: + - key: rtmgrcfg + path: rtmgr-config.json + mode: 0644 diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/env.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/env.yaml new file mode 100644 index 00000000..2f6ab6a0 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/env.yaml @@ -0,0 +1,36 @@ +############################################################################### +# 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. # +################################################################################ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.configmapname.rtmgr" . }}-env +data: + DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_SERVICE_PORT: "6379" + DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_PORT_6379_TCP_PORT: "6379" + RMR_RTG_SVC: "{{ .Values.rtmgr.service.rmr.route.port }}" + XMURL: "http://{{ include "common.servicename.appmgr.http" . }}:8080/ric/v1/xapps" + RTFILE: "/db/rt.json" + CFGFILE: "/cfg/rtmgr-config.json" + RPE: "{{ .Values.rtmgr.rpe }}" + SBI: "{{ .Values.rtmgr.sbi }}" + SBIURL: "{{ .Values.rtmgr.sbiurl }}" + NBI: "{{ .Values.rtmgr.nbi }}" + NBIURL: "{{ .Values.rtmgr.nbiurl }}" + LOGLEVEL: "{{ .Values.rtmgr.loglevel }}" + diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service-rmr.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service-rmr.yaml index 0ded6afe..74712047 100644 --- a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service-rmr.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service-rmr.yaml @@ -19,19 +19,23 @@ apiVersion: v1 kind: Service metadata: name: {{ include "common.servicename.rtmgr.rmr" . }} - namespace: {{ include "common.namespace" . }} + namespace: {{ include "common.namespace.platform" . }} labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.rtmgr" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: type: ClusterIP ports: - - port: {{ .Values.rtmgr.service.rmr.port }} + - port: {{ .Values.rtmgr.service.rmr.route.port }} protocol: TCP - targetPort: "rmr" - name: "rmr" + targetPort: "rmrroute" + name: "rmrroute" + - port: {{ .Values.rtmgr.service.rmr.data.port }} + protocol: TCP + targetPort: "rmrdata" + name: "rmrdata" selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.rtmgr" . }} release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml index 74d479fd..904a5971 100644 --- a/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml @@ -41,5 +41,15 @@ rtmgr: service: rmr: - port: 4560 - containerPort: 5656 + route: + port: 4561 + data: + port: 4560 + + rpe: rmrpush + sbi: nngpush + sbiurl: 0.0.0.0 + nbi: httpRESTful + nbiurl: http://0.0.0.0:8888 + loglevel: DEBUG + diff --git a/ric-platform/55-Ext-Services/bin/install b/ric-platform/55-Ext-Services/bin/install index 6f6f6e92..68fb4dc6 100755 --- a/ric-platform/55-Ext-Services/bin/install +++ b/ric-platform/55-Ext-Services/bin/install @@ -29,16 +29,38 @@ if [ -z "$RICAUX_RELEASE_NAME" ];then else RELEASE_NAME=$RICAUX_RELEASE_NAME fi +# Namespace configuration +if [ -z "$RICPLT_NAMESPACE" ];then + PLT_NAMESPACE=$plt_namespace +else + PLT_NAMESPACE=$RICPLT_NAMESPACE +fi +if [ -z "$RICXAPP_NAMESPACE" ];then + XAPP_NAMESPACE=$xapp_namespace +else + XAPP_NAMESPACE=$RICXAPP_NAMESPACE +fi if [ -z "$RICAUX_NAMESPACE" ];then - NAMESPACE=$namespace + AUX_NAMESPACE=$aux_namespace +else + AUX_NAMESPACE=$RICAUX_NAMESPACE +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + INFRA_NAMESPACE=$infra_namespace +else + INFRA_NAMESPACE=$RICINFRA_NAMESPACE +fi + + +if [ -z "$RIC_COMMON_OVERRIDE" ];then + COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE" else - NAMESPACE=$RICAUX_NAMESPACE + COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE fi RICAUX_COMPONENTS="ext" echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]" -echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" @@ -52,8 +74,8 @@ for component in $RICAUX_COMPONENTS; do mkdir -p $DIR/../helm/$component/charts/ cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/ if [ -z $OVERRIDEYAML ]; then - helm install --debug --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install --debug --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component else - helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component + helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component fi done diff --git a/ric-platform/55-Ext-Services/etc/ext.conf b/ric-platform/55-Ext-Services/etc/ext.conf index 5eb5b4a4..92008b59 100644 --- a/ric-platform/55-Ext-Services/etc/ext.conf +++ b/ric-platform/55-Ext-Services/etc/ext.conf @@ -17,9 +17,21 @@ # helm_release_name defines the release name helm will use to deploy RIC -# It will be overrided by RICAUX_RELEASE_NAME -helm_release_name=r0 +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r1 + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICPLT_NAMESPACE +plt_namespace=ricplt + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICXAPP_NAMESPACE +xapp_namespace=ricxapp # namespace defines the namespace that helm will use to deploy RIC # It will be overrided by RICAUX_NAMESPACE -namespace=ricplt +aux_namespace=ricaux + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICINFRA_NAMESPACE +infra_namespace=ricinfra diff --git a/ric-platform/55-Ext-Services/helm/ext/templates/services-aux.yaml b/ric-platform/55-Ext-Services/helm/ext/templates/services-aux.yaml index 96839eb9..e5958749 100644 --- a/ric-platform/55-Ext-Services/helm/ext/templates/services-aux.yaml +++ b/ric-platform/55-Ext-Services/helm/ext/templates/services-aux.yaml @@ -70,5 +70,5 @@ subsets: ports: - port: {{ include "common.ingresshttpport.ricinfra" . }} name: {{ include "common.ingressurl.ricinfra" . }}-http-ingress-port - - port: {{ include "common.ingresshttspport.ricinfra" . }} + - port: {{ include "common.ingresshttpsport.ricinfra" . }} name: {{ include "common.ingressurl.ricinfra" . }}-https-ingress-port diff --git a/ric-platform/README.md b/ric-platform/README.md index 6b8f3a0a..44f67c26 100644 --- a/ric-platform/README.md +++ b/ric-platform/README.md @@ -4,22 +4,10 @@ Helm charts, deployment scripts and configuration files for RIC platform compone ### Directory Structure . -├── 20-Credential Helm charts to onboard credential and secrets for docker registry and helm repo ├── 50-RIC-Platform Deployment scripts, charts and configuration files for RIC platform components +├── 55-Ext-Services Deployment scripts and chart for external service used by RIC to reach services outside of cluster └── README.md This file -### To onboard credentials -```sh -$ # Modify the user name and password in ./20-Credential/helm/values.yaml -$ # Alternatively, include the credential information in an override value yaml file -$ . ./20-Credential/bin/install -$ # If you have an override value.yaml file, please use -$ #. ./20-Credential/bin/install YOUR_OVERRIDE_FILE -``` - -### Credential Deployment Options -You can configure the Helm release name, Kubernetes namespace using configuration files located in ./20-Credential/etc/ -Please make sure that the namespace is the same one as the one used for RIC platform components. In the one-click deployment solution, the above setting will be overrided by environment variables shown below. *RICPLT_RELEASE_NAME @@ -45,3 +33,21 @@ In the one-click deployment solution, the above setting will be overrided by env ### To Undeploy RIC Platform ```sh $ . ./50-RIC-Platform/bin/uninstall +``` + +### To Deploy External services +The IP address described below should be the interface IP address of the VM hosting the aux cluster. +If the aux cluster is multi-node, any of the nodes can be specified here. + +```sh +$ # Set the value of ext/ip in values.yaml to be the external IP address. If you will use an override file and it has ext/ip set, +$ # make sure it is set correctly. +$ . ./55-Ext-Services/bin/install +$ # If you have an override value.yaml file, please use +$ #. ./50-Ext-Services/bin/install YOUR_OVERRIDE_FILE +``` + +### To Undeploy External services +```sh +$ . ./55-Ext-Services/bin/uninstall +``` \ No newline at end of file diff --git a/ric-xapps/90-xApps/bin/install b/ric-xapps/90-xApps/bin/install new file mode 100755 index 00000000..08f45635 --- /dev/null +++ b/ric-xapps/90-xApps/bin/install @@ -0,0 +1,170 @@ +#!/bin/bash +################################################################################ +# 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. # +################################################################################ + + +while [ -n "$1" ]; do # while loop starts + + case "$1" in + + -n) + CHART_NAME=$2 + shift + ;; + + -v) CHART_VERSION=$2 + shift + ;; # Message for -b option + + -f) OVERRIDEYAML=$2 + shift + ;; # Message for -c option + + -i) FULLIMAGE=$2 + shift + ;; + + -d) DESCRIPTOR_PATH=$2 + shift + ;; + + -c) CONFIG_JSON_PATH=$2 + shift + ;; + + -h) HELM_REPO_USERNAME=$2 + shift + ;; + + -p) HELM_REPO_PASSWORD=$2 + shift + ;; + + *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c + + esac + + shift + +done + + + + +if [ -z $CHART_NAME ]; then + echo "Please specify chart name using -n option." + exit 1 +fi +if [ -z $CHART_VERSION ]; then + echo "Please specify chart version using -v option." + exit 1 +fi +if [ -z $FULLIMAGE ]; then + echo "Please specify image using -i option." + exit 1 +fi +if [ -z $DESCRIPTOR_PATH ]; then + echo "Please specify descriptor file using -d option." + exit 1 +fi +if [ -z $CONFIG_JSON_PATH ]; then + echo "Please specify config json file using -c option." + exit 1 +fi + + +if [ ! -f $DESCRIPTOR_PATH ]; then + echo "Descriptor file cannot be founded at $DESCRIPTOR_PATH" + exit 1 +fi +if [ ! -f $CONFIG_JSON_PATH ]; then + echo "Config json file cannot be founded at $CONFIG_JSON_PATH" + exit 1 +fi + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/xapp.conf + +if [ -z $OVERRIDEYAML ]; then + HELM_REPO=$default_helm_repo + DOCKER_REGISTRY=$default_docker_registry +else + helm_repo_override=$(grep "^ *helmRepository:" $OVERRIDEYAML | awk '{gsub(/ /,""); gsub(/\"/,""); split($0, b, "tory:");split(b[2],c,"#"); print c[1]}') + docker_reg_override=$(grep "^ *repository:" $OVERRIDEYAML | awk '{ gsub(/ /,""); gsub(/\"/,""); split($0, b, "tory:");split(b[2],c,"#"); print c[1]}') + if [ -z $helm_repo_override ]; then + HELM_REPO=$default_helm_repo + else + HELM_REPO=$helm_repo_override + fi + + if [ -z $docker_reg_override ]; then + DOCKER_REGISTRY=$default_docker_registry + else + DOCKER_REGISTRY=$docker_reg_override + fi +fi + + + + +rm -rf /tmp/$CHART_NAME + +cp -r $DIR/../helm/xapp-std/ /tmp/$CHART_NAME + + + +sed -i "s/^name: xapp-std/name: $CHART_NAME/" /tmp/$CHART_NAME/Chart.yaml +sed -i "s/^version: 0.0.1/version: $CHART_VERSION/" /tmp/$CHART_NAME/Chart.yaml + + +registry_path=$(echo $FULLIMAGE | awk '{n=split($0, a, "/"); if(n>1) print a[1]}') + + + +tag=$(echo $FULLIMAGE | awk '{n=split($0, a, "/"); split(a[n], b, ":"); print b[2]}') + +image=$(echo $FULLIMAGE | awk -v head="$registry_path/" -v tail=":$tag" '{gsub (head, ""); gsub(tail,""); gsub(/\//,"\\/"); print $0}') + + +sed -i "s/^ name: xapp-std/ name: $CHART_NAME/" /tmp/$CHART_NAME/values.yaml +sed -i "s/^ name: xapp-std/ name: $image/" /tmp/$CHART_NAME/values.yaml +sed -i "s/^ tag: latest/ tag: $tag/" /tmp/$CHART_NAME/values.yaml + + +if [ -z $registry_path ]; then + sed -i "s/^ repository: xapp-std-reg/ repository: $DOCKER_REGISTRY/" /tmp/$CHART_NAME/values.yaml +else + sed -i "s/^ repository: xapp-std-reg/ repository: $registry_path/" /tmp/$CHART_NAME/values.yaml +fi + + + + +cp $CONFIG_JSON_PATH /tmp/$CHART_NAME/config/ +cp $DESCRIPTOR_PATH /tmp/$CHART_NAME/descriptors/ + + +helm package -d /tmp /tmp/$CHART_NAME + + +echo $HELM_REPO +curl -k -u $HELM_REPO_USERNAME:$HELM_REPO_PASSWORD $HELM_REPO --upload-file /tmp/$CHART_NAME-$CHART_VERSION.tgz -v + + diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/appsecret.yaml b/ric-xapps/90-xApps/etc/xapp.conf similarity index 87% rename from ric-xapps/90-xApps/helm/xapp-std/templates/appsecret.yaml rename to ric-xapps/90-xApps/etc/xapp.conf index a0dce0e3..956b3671 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/appsecret.yaml +++ b/ric-xapps/90-xApps/etc/xapp.conf @@ -14,13 +14,9 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Release.Name }}-appsecret -type: Opaque -stringData: - {{- with .Values.ricapp.appsecret }} - {{- toYaml . | nindent 2 }} - {{- end }} + +default_helm_repo=https://helm-entry + +default_docker_registry=docker-entry + diff --git a/ric-xapps/90-xApps/helm/xapp-std/config/config-file.json b/ric-xapps/90-xApps/helm/xapp-std/config/config-file.json deleted file mode 100755 index 33c5f207..00000000 --- a/ric-xapps/90-xApps/helm/xapp-std/config/config-file.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "local": { - "host": ":8080" - }, - "logger": { - "level": 3 - }, - "rmr": { - "protPort": "tcp:4560", - "maxSize": 2072, - "numWorkers": 1, - "txMessages": ["RIC_X2_LOAD_INFORMATION"], - "rxMessages": ["RIC_X2_LOAD_INFORMATION"] - }, - "db": { - "namespace": "ricxapp", - "host": "dbaas", - "port": 6379 - } -} diff --git a/ric-xapps/90-xApps/helm/xapp-std/descriptors/schema.json b/ric-xapps/90-xApps/helm/xapp-std/descriptors/schema.json deleted file mode 100755 index 5fd3b23c..00000000 --- a/ric-xapps/90-xApps/helm/xapp-std/descriptors/schema.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://example.com/root.json", - "type": "object", - "title": "The Root Schema", - "required": [ - "local", - "logger", - "rmr", - "db" - ], - "properties": { - "local": { - "$id": "#/properties/local", - "type": "object", - "title": "The Local Schema", - "required": [ - "host" - ], - "properties": { - "host": { - "$id": "#/properties/local/properties/host", - "type": "string", - "title": "The Host Schema", - "default": "", - "examples": [ - ":8080" - ], - "pattern": "^(.*)$" - } - } - }, - "logger": { - "$id": "#/properties/logger", - "type": "object", - "title": "The Logger Schema", - "required": [ - "level" - ], - "properties": { - "level": { - "$id": "#/properties/logger/properties/level", - "type": "integer", - "title": "The Level Schema", - "default": 0, - "examples": [ - 3 - ] - } - } - }, - "rmr": { - "$id": "#/properties/rmr", - "type": "object", - "title": "The Rmr Schema", - "required": [ - "protPort", - "maxSize", - "numWorkers", - "txMessages", - "rxMessages" - ], - "properties": { - "protPort": { - "$id": "#/properties/rmr/properties/protPort", - "type": "string", - "title": "The Protport Schema", - "default": "", - "examples": [ - "tcp:4560" - ], - "pattern": "^(.*)$" - }, - "maxSize": { - "$id": "#/properties/rmr/properties/maxSize", - "type": "integer", - "title": "The Maxsize Schema", - "default": 0, - "examples": [ - 2072 - ] - }, - "numWorkers": { - "$id": "#/properties/rmr/properties/numWorkers", - "type": "integer", - "title": "The Numworkers Schema", - "default": 0, - "examples": [ - 1 - ] - }, - "txMessages": { - "$id": "#/properties/rmr/properties/txMessages", - "type": "array", - "title": "The Txmessages Schema" - }, - "rxMessages": { - "$id": "#/properties/rmr/properties/rxMessages", - "type": "array", - "title": "The Rxmessages Schema" - } - } - }, - "db": { - "$id": "#/properties/db", - "type": "object", - "title": "The Db Schema", - "required": [ - "host", - "namespace", - "port" - ], - "properties": { - "host": { - "$id": "#/properties/db/properties/host", - "type": "string", - "title": "The Host Schema", - "default": "", - "examples": [ - "dbaas" - ], - "pattern": "^(.*)$" - }, - "namespace": { - "$id": "#/properties/db/properties/namespace", - "type": "string", - "title": "The Namespace Schema", - "default": "", - "examples": [ - "ricxapp" - ], - "pattern": "^(.*)$" - }, - "port": { - "$id": "#/properties/db/properties/port", - "type": "integer", - "title": "The Port Schema", - "default": 0, - "examples": [ - 6379 - ] - } - } - } - } -} \ No newline at end of file diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl b/ric-xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl index e2309bf5..d427a461 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl @@ -19,7 +19,7 @@ Expand the name of the chart. */}} {{- define "ricxapp.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} + {{- default .Chart.Name .Values.ricxapp.name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -28,23 +28,16 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this If release name contains chart name it will be used as a full name. */}} {{- define "ricxapp.fullname" -}} -{{- if .Values.ricxapp.fullnameOverride -}} -{{- .Values.ricxapp.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.ricxapp.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} + {{- $name := ( include "ricxapp.name" . ) -}} + {{- $fullname := ( printf "%s-%s" .Release.Namespace $name ) -}} + {{- default $fullname .Values.ricxapp.fullname | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create chart name and version as used by the chart label. */}} {{- define "ricxapp.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- define "ricxapp.namespace" -}} @@ -74,6 +67,11 @@ Create chart name and version as used by the chart label. {{- end -}} +{{- define "ricxapp.containername" -}} + {{- $name := ( include "ricxapp.fullname" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + {{- define "ricxapp.imagepullsecret" -}} {{- printf "docker-reg-cred" -}} {{- end -}} diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml index fc6e6229..e08ecc8d 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml @@ -1,14 +1,32 @@ -# -# ================================================================================== -# Copyright (c) 2019 Nokia -# ================================================================================== -# +################################################################################ +# 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 (eq .Values.ricapp.appconfig.override "") }} apiVersion: v1 kind: ConfigMap metadata: - name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }} + name: {{ include "ricxapp.configmapname" . }}-appconfig data: -{{ (.Files.Glob "config/*").AsConfig | indent 2 }} -{{ end }} +{{- $dbaasservice := .Values.ricplt.dbaasService | quote -}} +{{- $pltingressurl := .Values.ricplt.pltIngressUrl | quote -}} +{{- $xappingressurl := .Values.ricplt.xappIngressUrl | quote -}} +{{- $appmgrrmrservice := .Values.ricplt.appmgrRMRService | quote -}} +{{- $e2mgrrmrservice := .Values.ricplt.e2mgrRMRService | quote -}} +{{- $e2termrmrservice := .Values.ricplt.e2termRMRService | quote -}} +{{- $rtmgrrmrservice := .Values.ricplt.rtmgrRMRService | quote -}} +{{- $a1mediatorrmrservice := .Values.ricplt.a1mediatorRMRService | quote -}} + +{{ (.Files.Glob "config/*").AsConfig | replace "__DBAAS_SERVICE__" $dbaasservice | replace "__PLT_INGRESS_URL__" $pltingressurl | replace "__XAPP_INGRESS_URL__" $xappingressurl | replace "__APPMGR_RMR_SERVICE__" $appmgrrmrservice | replace "__E2MGR_RMR_SERVICE__" $e2mgrrmrservice | replace "__E2TERM_RMR_SERVICE__" $e2termrmrservice | replace "__RTMGR_RMR_SERVICE__" $rtmgrrmrservice | replace "__A1MEDIATOR_RMR_SERVICE__" $a1mediatorrmrservice | indent 2 }} diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/appenv.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/appenv.yaml index 8f16b036..0d55f4e9 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/appenv.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/appenv.yaml @@ -17,8 +17,13 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Release.Name }}-appenv + name: {{ include "ricxapp.configmapname" . }}-appenv data: - {{- with .Values.ricapp.appenv }} - {{- toYaml . | nindent 2 }} + {{- if .Values.ricxapp.appenv }} + {{- toYaml .Values.ricxapp.appenv | nindent 2 }} {{- end }} + DBAAS_SERVICE_HOST: "{{ .Values.ricplt.dbaasService }}" + DBAAS_SERVICE_PORT: "6379" + DBAAS_PORT_6379_TCP_ADDR: "{{ .Values.ricplt.dbaasService }}" + DBAAS_PORT_6379_TCP_PORT: "6379" + RMR_RTG_SVC: "{{ .Values.ricxapp.service.rmr.route.port }}" diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml index e6fa26d9..28bd23bb 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml @@ -1,84 +1,77 @@ -# -# ================================================================================== -# Copyright (c) 2019 Nokia -# ================================================================================== -# - +################################################################################ +# 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. # +################################################################################' apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "ricapp.fullname" . }} + name: {{ include "ricxapp.fullname" . }} labels: - app.kubernetes.io/name: {{ include "ricapp.name" . }} - helm.sh/chart: {{ include "ricapp.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} spec: - replicas: {{ .Values.ricapp.replicaCount }} + replicas: {{ .Values.ricxapp.replicaCount }} selector: matchLabels: - app.kubernetes.io/name: {{ include "ricapp.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} + release: {{ .Release.Name }} template: metadata: labels: - app.kubernetes.io/name: {{ include "ricapp.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} + release: {{ .Release.Name }} spec: - hostname: {{ .Values.ricapp.hostname }} + hostname: {{ include "ricxapp.name" . }} imagePullSecrets: - name: {{ include "ricxapp.imagepullsecret" . }} containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.global.repository }}/{{ .Values.ricapp.image.name }}:{{ .Values.ricapp.image.tag }}" - imagePullPolicy: {{ .Values.global.image.pullPolicy }} + - name: {{ include "ricxapp.containername" . }} + image: "{{ .Values.ricxapp.image.repository }}/{{ .Values.ricxapp.image.name }}:{{ .Values.ricxapp.image.tag }}" + imagePullPolicy: {{ .Values.ricxapp.image.pullPolicy }} ports: - name: http - containerPort: {{ .Values.ricapp.service.http.containerPort }} + containerPort: {{ .Values.ricxapp.service.http.containerPort }} protocol: TCP - - name: rmr - containerPort: {{ .Values.ricapp.service.rmr.containerPort }} + - name: rmrRoute + containerPort: {{ .Values.ricxapp.service.rmr.route.port }} + protocol: TCP + - name: rmrData + containerPort: {{ .Values.ricxapp.service.rmr.data.port }} protocol: TCP volumeMounts: - name: config-volume - mountPath: {{ .Values.ricapp.appconfig.path }} - - name: cert-volume - mountPath: {{ .Values.ricapp.cert.path }} + mountPath: {{ .Values.ricxapp.appconfig.path }} + envFrom: + - configMapRef: + name: {{ include "ricxapp.configmapname" . }}-appenv livenessProbe: httpGet: - path: {{ .Values.ricapp.probes.healthAliveCheckEndpoint }} - port: 8080 + path: {{ .Values.ricxapp.probes.healthAliveCheckEndpoint }} + port: {{ .Values.ricxapp.service.http.containerPort }} initialDelaySeconds: 5 periodSeconds: 15 readinessProbe: httpGet: - path: {{ .Values.ricapp.probes.healthReadyCheckEndpoint }} - port: 8080 + path: {{ .Values.ricxapp.probes.healthReadyCheckEndpoint }} + port: {{ .Values.ricxapp.service.http.containerPort }} initialDelaySeconds: 5 periodSeconds: 15 restartPolicy: Always - resources: - {{- toYaml .Values.ricapp.resources | nindent 12 }} - securityContext: - # ubuntu - #runAsUser: 1000 - #allowPrivilegeEscalation: false - {{- with .Values.ricapp.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ricapp.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ricapp.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - name: config-volume configMap: - name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }} - - name: cert-volume - emptyDir: {} + name: {{ include "ricxapp.configmapname" . }}-appconfig diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml index 1d9ce926..ee1670b1 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml @@ -28,10 +28,14 @@ metadata: spec: type: ClusterIP ports: - - port: {{ .Values.ricxapp.service.rmr.port }} - targetPort: rmr + - port: {{ .Values.ricxapp.service.rmr.data.port }} + targetPort: rmrData protocol: TCP - name: rmr + name: rmrData + - port: {{ .Values.ricxapp.service.rmr.route.port }} + targetPort: rmrRoute + protocol: TCP + name: rmrRoute selector: app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} release: {{ .Release.Name }} diff --git a/ric-xapps/90-xApps/helm/xapp-std/values.yaml b/ric-xapps/90-xApps/helm/xapp-std/values.yaml index 1eaa11ae..bf9be32c 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/values.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/values.yaml @@ -16,31 +16,30 @@ ################################################################################' # This is a YAML-formatted file. # Declare variables to be passed into your templates. - -global: - # modify this section to point to your local testing settings - repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" - repositoryCred: - user: "${__RUNRICENV_DOCKER_USER__}" - password: "${__RUNRICENV_DOCKER_PASS__}" - image: - pullPolicy: IfNotPresent - ricplt: # This section is reserved for values imported from RIC Platform charts + dbaasService: "service-ricplt-dbaas-tcp.ricplt.svc.cluster.local" + pltIngressUrl: "ricplt-entry" + xappIngressUrl: "ricxapp-entry" -ricapp: + appmgrRMRService: "service-ricplt-appmgr-rmr.ricplt.svc.cluster.local" + e2mgrRMRService: "service-ricplt-e2mgr-rmr.ricplt.svc.cluster.local" + e2termRMRService: "service-ricplt-e2term-rmr.ricplt.svc.cluster.local" + rtmgrRMRService: "service-ricplt-rtmgr-rmr.ricplt.svc.cluster.local" + a1mediatorRMRService: "service-ricplt-a1mediator-rmr.ricplt.svc.cluster.local" + + + +ricxapp: # This section is for xapp. Templates to be resolved from xApp descriptor replicaCount: 1 name: xapp-std - fullname: xapp-std - nameOverride: "" - fullnameOverride: "" - - # The name of the process that indicates the liveness of the component - livenessprocessname: xapp-std + # Your can specify the chart fullname by using the following option + #fullname: xapp-std image: + pullPolicy: IfNotPresent + repository: xapp-std-reg name: xapp-std tag: latest @@ -49,8 +48,10 @@ ricapp: port: 8080 containerPort: 8080 rmr: - port: 4560 - containerPort: 4560 + route: + port: 4561 + data: + port: 4560 probes: healthAliveCheckEndpoint: ric/v1/health/alive @@ -58,19 +59,5 @@ ricapp: appconfig: path: /opt/ric/config - override: "" - - cert: - path: /opt/ric/certificates - object: {} - - hostname: xapp-std - - resources: {} - - nodeSelector: {} - - tolerations: [] - - affinity: {} + appenv: diff --git a/ric-xapps/90-xApps/scripts/localize.sh b/ric-xapps/90-xApps/scripts/localize.sh deleted file mode 100755 index 90f90384..00000000 --- a/ric-xapps/90-xApps/scripts/localize.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -################################################################################ -# 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 (( $# != 1 )); then - echo "Missing parameters: " - exit -fi - -source ./scripts/ric_env.sh -if [ -z $__RICENV_SET__ ]; then - echo "Edit your ric_env.sh for first!" - exit -fi - -# Update the local values -RESULT_DIR=./generated -rm -rf $RESULT_DIR && mkdir -p $RESULT_DIR && cp -rf ./helm $RESULT_DIR - -FILELIST=$(find ./helm \( -name "*.tpl" -o -name "*.yaml" \)) -for f in $FILELIST; do - envsubst '${__RUNRICENV_DOCKER_HOST__} ${__RUNRICENV_DOCKER_PORT__}' < $f > "$RESULT_DIR/$f"; -done - -# Rename the helm chart folder -mv $RESULT_DIR/helm/xapp-std $RESULT_DIR/helm/$1 -find $RESULT_DIR/helm/$1 -type f | xargs sed -i -e "s/xapp-std/$1/g" - -# Push to helm chart repo -helm package generated/helm/$1 | awk '{ print $NF }' | xargs mv -t $__RUNRICENV_HELMREPO_DIR__ -helm repo index $__RUNRICENV_HELMREPO_DIR__ -helm repo update