From: Zhe Huang Date: Fri, 28 Jun 2019 13:05:20 +0000 (-0400) Subject: New version of the common template. It unifies the naming convention between platform... X-Git-Tag: 0.0.2~78^2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=948cb92657906b0c6ede9e1f82a56b95521fe0b4;p=it%2Fdep.git New version of the common template. It unifies the naming convention between platform and xapp components, enabling cross referencing. Signed-off-by: Zhe Huang Change-Id: I683f36a64512854dfb4c30c1df3e4204da7b708b --- diff --git a/.gitignore b/.gitignore index ec0ccdeb..a245a231 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.log *.tar *.tgz +*.swp diff --git a/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE index 2aa79e0e..52751af5 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: nexus.ricinfra.local + helmRepository: "https://ricaux-entry/helm" # Certificate of the helm repo helmRepositoryCert: xapp-mgr-certs diff --git a/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE index 737526d3..b97ef1c6 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: nexus.ricinfra.local + helmRepository: "https://ricaux-entry/helm" # Certificate of the helm repo helmRepositoryCert: xapp-mgr-certs @@ -64,7 +64,7 @@ repositoryCredential: helmrepoCredential: user: "helm" - password: "docker" + password: "helm" adminPassword: admin123 diff --git a/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE index dd547cd3..d12ae12a 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: helm.ricinfra.local + helmRepository: "https://ricaux-entry/helm" # Certificate of the helm repo helmRepositoryCert: xapp-mgr-certs diff --git a/ric-aux/80-Auxiliary-Functions/bin/install b/ric-aux/80-Auxiliary-Functions/bin/install index e759f665..c44cfbb4 100755 --- a/ric-aux/80-Auxiliary-Functions/bin/install +++ b/ric-aux/80-Auxiliary-Functions/bin/install @@ -43,15 +43,15 @@ echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" -COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}') +COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') -helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common +helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common/ for component in $RICAUX_COMPONENTS; do echo "Preparing chart for comonent $component" mkdir -p $DIR/../helm/$component/charts/ - cp /tmp/common-$COMMON_CHART_VERSION.tgz $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 else diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 diff --git a/ric-aux/85-Ext-Services/bin/install b/ric-aux/85-Ext-Services/bin/install index d4a538de..552c237d 100755 --- a/ric-aux/85-Ext-Services/bin/install +++ b/ric-aux/85-Ext-Services/bin/install @@ -42,15 +42,15 @@ echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" -COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}') +COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') -helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common +helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common/ for component in $RICAUX_COMPONENTS; do echo "Preparing chart for comonent $component" mkdir -p $DIR/../helm/$component/charts/ - cp /tmp/common-$COMMON_CHART_VERSION.tgz $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 else diff --git a/ric-aux/85-Ext-Services/helm/ext/requirements.yaml b/ric-aux/85-Ext-Services/helm/ext/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-aux/85-Ext-Services/helm/ext/requirements.yaml +++ b/ric-aux/85-Ext-Services/helm/ext/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 diff --git a/ric-platform/50-RIC-Platform/helm/common/Chart.yaml b/ric-common/Common-Template/helm/ric-common/Chart.yaml similarity index 97% rename from ric-platform/50-RIC-Platform/helm/common/Chart.yaml rename to ric-common/Common-Template/helm/ric-common/Chart.yaml index b137e27a..a6dde6e7 100644 --- a/ric-platform/50-RIC-Platform/helm/common/Chart.yaml +++ b/ric-common/Common-Template/helm/ric-common/Chart.yaml @@ -17,5 +17,5 @@ apiVersion: v1 description: Common templates for inclusion in other charts -name: common -version: 1.1.0 +name: ric-common +version: 2.0.0 diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_chart.tpl b/ric-common/Common-Template/helm/ric-common/templates/_chart.tpl similarity index 100% rename from ric-platform/50-RIC-Platform/helm/common/templates/_chart.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_chart.tpl diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_configmapname.tpl b/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl similarity index 93% rename from ric-platform/50-RIC-Platform/helm/common/templates/_configmapname.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl index 671b620a..8cb57d74 100644 --- a/ric-platform/50-RIC-Platform/helm/common/templates/_configmapname.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl @@ -52,3 +52,7 @@ {{- end -}} +{{- define "common.configmapname.nexus" -}} + {{- $name := ( include "common.fullname.nexus" . ) -}} + {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_deploymentname.tpl b/ric-common/Common-Template/helm/ric-common/templates/_deploymentname.tpl similarity index 93% rename from ric-platform/50-RIC-Platform/helm/common/templates/_deploymentname.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_deploymentname.tpl index 2571a5cb..4242ab84 100644 --- a/ric-platform/50-RIC-Platform/helm/common/templates/_deploymentname.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_deploymentname.tpl @@ -52,3 +52,7 @@ +{{- define "common.deploymentname.nexus" -}} + {{- $name := ( include "common.fullname.nexus" . ) -}} + {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/ric/Chart.yaml b/ric-common/Common-Template/helm/ric-common/templates/_docker_credential_name.tpl similarity index 92% rename from ric-platform/50-RIC-Platform/helm/ric/Chart.yaml rename to ric-common/Common-Template/helm/ric-common/templates/_docker_credential_name.tpl index 103c34f5..717d2381 100644 --- a/ric-platform/50-RIC-Platform/helm/ric/Chart.yaml +++ b/ric-common/Common-Template/helm/ric-common/templates/_docker_credential_name.tpl @@ -15,8 +15,9 @@ # limitations under the License. # ################################################################################ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for full RIC deployment -name: ric -version: 1.1.0 + + + +{{- define "common.dockercred.prefix" -}} + {{- printf "secret-docker" -}} +{{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_repository.tpl b/ric-common/Common-Template/helm/ric-common/templates/_dockerregistry.tpl similarity index 87% rename from ric-platform/50-RIC-Platform/helm/common/templates/_repository.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_dockerregistry.tpl index 07969988..ac692ea6 100644 --- a/ric-platform/50-RIC-Platform/helm/common/templates/_repository.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_dockerregistry.tpl @@ -65,14 +65,29 @@ - .Values.repositoryCredOverride : override global and default docker registry credential */}} {{- define "common.repositoryCred" -}} - {{- if .Values.repositoryCredOverride -}} - {{- printf "%s" .Values.repositoryCredOverride -}} + {{- $componentname := .Chart.Name -}} + {{- $firsttier := (index .Values (printf "%s" $componentname)) -}} + {{- if $firsttier -}} + {{- $secondtier := (index .Values (printf "%s" $componentname) (printf "%s" "repositoryCredOverride")) -}} + {{- if $secondtier -}} + {{- printf "%s" $secondtier -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.repositoryCred -}} + {{- printf "%s" .Values.global.repositoryCred -}} + {{- else -}} + {{- printf "%s" .Values.repositoryCred -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.repositoryCred -}} + {{- end -}} + {{- end -}} {{- else -}} - {{- if .Values.global -}} + {{- if .Values.global -}} {{- if .Values.global.repositoryCred -}} {{- printf "%s" .Values.global.repositoryCred -}} {{- else -}} - {{- printf "%s" .Values.repositoryCred -}} + {{- printf "%s" .Values.repositoryCred -}} {{- end -}} {{- else -}} {{- printf "%s" .Values.repositoryCred -}} @@ -81,6 +96,18 @@ {{- end -}} + + + + + + + + + + + + {{/* Define the golbal image pull policy. The value for .Values.imagePullPolicy is used by default, diff --git a/ric-platform/50-RIC-Platform/helm/ric/values.yaml b/ric-common/Common-Template/helm/ric-common/templates/_helm_credential_name.tpl similarity index 88% rename from ric-platform/50-RIC-Platform/helm/ric/values.yaml rename to ric-common/Common-Template/helm/ric-common/templates/_helm_credential_name.tpl index aea172ef..cac7f1f5 100644 --- a/ric-platform/50-RIC-Platform/helm/ric/values.yaml +++ b/ric-common/Common-Template/helm/ric-common/templates/_helm_credential_name.tpl @@ -15,14 +15,13 @@ # limitations under the License. # ################################################################################ -# Enable/disable helm charts for RIC deployment -dbaas: - enabled: true -e2mgr: - enabled: true -rtmgr: - enabled: true -e2term: - enabled: true -appmgr: - enabled: true + + + +{{- define "common.helmcred.prefix" -}} + {{- printf "secret-helm" -}} +{{- end -}} + +{{- define "common.helmcert.prefix" -}} + {{- printf "configmap-helm" -}} +{{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_helmrepo.tpl b/ric-common/Common-Template/helm/ric-common/templates/_helmrepo.tpl similarity index 100% rename from ric-platform/50-RIC-Platform/helm/common/templates/_helmrepo.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_helmrepo.tpl diff --git a/ric-common/Common-Template/helm/ric-common/templates/_ingresscontroller.tpl b/ric-common/Common-Template/helm/ric-common/templates/_ingresscontroller.tpl new file mode 100644 index 00000000..5602418e --- /dev/null +++ b/ric-common/Common-Template/helm/ric-common/templates/_ingresscontroller.tpl @@ -0,0 +1,183 @@ +################################################################################ +# 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 ingress controller addresses. +*/}} + +####################### Service URL ##################################### +{{- define "common.ingressurl.ricplt" -}} + {{- if .Values.global -}} + {{- if .Values.global.ingressurl -}} + {{- if .Values.global.ingressurl.platform -}} + {{- printf "%s" .Values.global.ingressurl.platform -}} + {{- else -}} + {{- printf "ricplt-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricplt-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricplt-entry" -}} + {{- end -}} +{{- end -}} + +{{- define "common.ingressurl.ricxapp" -}} + {{- if .Values.global -}} + {{- if .Values.global.ingressurl -}} + {{- if .Values.global.ingressurl.xapp -}} + {{- printf "%s" .Values.global.ingressurl.xapp -}} + {{- else -}} + {{- printf "ricxapp-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricxapp-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricxapp-entry" -}} + {{- end -}} +{{- end -}} + +{{- define "common.ingressurl.ricaux" -}} + {{- if .Values.global -}} + {{- if .Values.global.ingressurl -}} + {{- if .Values.global.ingressurl.aux -}} + {{- printf "%s" .Values.global.ingressurl.aux -}} + {{- else -}} + {{- printf "ricaux-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricaux-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricaux-entry" -}} + {{- end -}} +{{- end -}} + +{{- define "common.ingressurl.ricinfra" -}} + {{- if .Values.global -}} + {{- if .Values.global.ingressurl -}} + {{- if .Values.global.ingressurl.infra -}} + {{- printf "%s" .Values.global.ingressurl.infra -}} + {{- else -}} + {{- printf "ricinfra-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricinfra-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "ricinfra-entry" -}} + {{- end -}} +{{- end -}} + +{{- define "common.ingressurl.localdocker" -}} + {{- if .Values.global -}} + {{- if .Values.global.ingressurl -}} + {{- if .Values.global.ingressurl.localdocker -}} + {{- printf "%s" .Values.global.ingressurl.localdocker -}} + {{- else -}} + {{- printf "docker-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "docker-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "docker-entry" -}} + {{- end -}} +{{- end -}} + +{{- define "common.ingressurl.localhelm" -}} + {{- if .Values.global -}} + {{- if .Values.global.ingressurl -}} + {{- if .Values.global.ingressurl.localhelm -}} + {{- printf "%s" .Values.global.ingressurl.localhelm -}} + {{- else -}} + {{- printf "helm-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "helm-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "helm-entry" -}} + {{- end -}} +{{- end -}} + + +{{- define "common.ingressurl.localnexus" -}} + {{- if .Values.global -}} + {{- if .Values.global.ingressurl -}} + {{- if .Values.global.ingressurl.localnexus -}} + {{- printf "%s" .Values.global.ingressurl.localnexus -}} + {{- else -}} + {{- printf "nexus-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "nexus-entry" -}} + {{- end -}} + {{- else -}} + {{- printf "nexus-entry" -}} + {{- end -}} +{{- end -}} + + + + + + +####################### Ingress Controller Ports ########################################### +## Currently the below values are hard-coded due to the fact that kong ingress controller # +## helm charts are not using this common template. We need to make sure that these values # +## agree with the values in the kong helm charts values.yaml files. # +############################################################################################ +{{- define "common.ingresshttpport.ricplt" -}} + {{- printf "30080" -}} +{{- end -}} + +{{- define "common.ingresshttpsport.ricplt" -}} + {{- printf "30443" -}} +{{- end -}} + + +{{- define "common.ingresshttpport.ricxapp" -}} + {{- printf "31080" -}} +{{- end -}} + + +{{- define "common.ingresshttpsport.ricxapp" -}} + {{- printf "31443" -}} +{{- end -}} + + +{{- define "common.ingresshttpport.ricaux" -}} + {{- printf "32080" -}} +{{- end -}} + +{{- define "common.ingresshttpsport.ricaux" -}} + {{- printf "32443" -}} +{{- end -}} + + +{{- define "common.ingresshttpport.ricinfra" -}} + {{- printf "33080" -}} +{{- end -}} + + + +{{- define "common.ingresshttpsport.ricinfra" -}} + {{- printf "33443" -}} +{{- end -}} + diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_servicename.tpl b/ric-common/Common-Template/helm/ric-common/templates/_ingressname.tpl similarity index 62% rename from ric-platform/50-RIC-Platform/helm/common/templates/_servicename.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_ingressname.tpl index 4e93d432..894ad050 100644 --- a/ric-platform/50-RIC-Platform/helm/common/templates/_servicename.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_ingressname.tpl @@ -15,48 +15,34 @@ # limitations under the License. # ################################################################################ -{{/* - Resolve the name of a chart's service. - The default will be the chart name (or .Values.nameOverride if set). - And the use of .Values.service.name overrides all. - - .Values.service.name : override default service (ie. chart) name -*/}} -{{/* - Expand the service name for a chart. -*/}} - - -{{- define "common.servicename.appmgr" -}} +{{- define "common.ingressname.appmgr" -}} {{- $name := ( include "common.fullname.appmgr" . ) -}} - {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "common.servicename.dbaas" -}} - {{- $name := ( include "common.name.dbaas" . ) -}} - {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}} + {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "common.servicename.e2mgr" -}} +{{- define "common.ingressname.e2mgr" -}} {{- $name := ( include "common.fullname.e2mgr" . ) -}} - {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}} + {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "common.servicename.e2term" -}} +{{- define "common.ingressname.e2term" -}} {{- $name := ( include "common.fullname.e2term" . ) -}} - {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}} + {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "common.servicename.rtmgr" -}} +{{- define "common.ingressname.rtmgr" -}} {{- $name := ( include "common.fullname.rtmgr" . ) -}} - {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}} + {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "common.servicename.a1mediator" -}} +{{- define "common.ingressname.a1mediator" -}} {{- $name := ( include "common.fullname.a1mediator" . ) -}} - {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}} + {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} - - +{{- define "common.ingressname.nexus" -}} + {{- $name := ( include "common.fullname.nexus" . ) -}} + {{- printf "ingress-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_name.tpl b/ric-common/Common-Template/helm/ric-common/templates/_name.tpl similarity index 80% rename from ric-platform/50-RIC-Platform/helm/common/templates/_name.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_name.tpl index f9a553e0..f7121844 100644 --- a/ric-platform/50-RIC-Platform/helm/common/templates/_name.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_name.tpl @@ -35,7 +35,7 @@ {{- define "common.fullname.appmgr" -}} {{- $name := ( include "common.name.appmgr" . ) -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -53,7 +53,7 @@ {{- define "common.fullname.dbaas" -}} {{- $name := ( include "common.name.dbaas" . ) -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -81,7 +81,7 @@ {{- define "common.fullname.e2mgr" -}} {{- $name := ( include "common.name.e2mgr" . ) -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- define "common.name.e2term" -}} @@ -99,7 +99,7 @@ {{- define "common.fullname.e2term" -}} {{- $name := ( include "common.name.e2term" . ) -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -125,7 +125,7 @@ {{- define "common.fullname.rtmgr" -}} {{- $name := ( include "common.name.rtmgr" . ) -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -148,11 +148,28 @@ {{- define "common.fullname.a1mediator" -}} {{- $name := ( include "common.name.a1mediator" . ) -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- define "common.name.nexus" -}} + {{- if .Values.nexus -}} + {{- if .Values.nexus.nameOverride -}} + {{- printf "%s" .Values.nexus.nameOverride -}} + {{- else -}} + {{- printf "nexus" -}} + {{- end -}} + {{- else -}} + {{- printf "nexus" -}} + {{- end -}} +{{- end -}} + + +{{- define "common.fullname.nexus" -}} + {{- $name := ( include "common.name.nexus" . ) -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} @@ -168,5 +185,5 @@ */}} {{- define "common.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_namespace.tpl b/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl similarity index 100% rename from ric-platform/50-RIC-Platform/helm/common/templates/_namespace.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_resources.tpl b/ric-common/Common-Template/helm/ric-common/templates/_resources.tpl similarity index 100% rename from ric-platform/50-RIC-Platform/helm/common/templates/_resources.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_resources.tpl diff --git a/ric-common/Common-Template/helm/ric-common/templates/_servicename.tpl b/ric-common/Common-Template/helm/ric-common/templates/_servicename.tpl new file mode 100644 index 00000000..c9804f55 --- /dev/null +++ b/ric-common/Common-Template/helm/ric-common/templates/_servicename.tpl @@ -0,0 +1,96 @@ +################################################################################ +# 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 service. + + The default will be the chart name (or .Values.nameOverride if set). + And the use of .Values.service.name overrides all. + + - .Values.service.name : override default service (ie. chart) name +*/}} +{{/* + Expand the service name for a chart. +*/}} + + +###################### RMR Service ################################## +{{- define "common.servicename.appmgr.rmr" -}} + {{- $name := ( include "common.fullname.appmgr" . ) -}} + {{- printf "service-%s-rmr" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + +{{- define "common.servicename.e2mgr.rmr" -}} + {{- $name := ( include "common.fullname.e2mgr" . ) -}} + {{- printf "service-%s-rmr" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.servicename.e2term.rmr" -}} + {{- $name := ( include "common.fullname.e2term" . ) -}} + {{- printf "service-%s-rmr" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.servicename.rtmgr.rmr" -}} + {{- $name := ( include "common.fullname.rtmgr" . ) -}} + {{- 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 "-" -}} +{{- end -}} + + +###################### Http Service ################################## + +{{- define "common.servicename.appmgr.http" -}} + {{- $name := ( include "common.fullname.appmgr" . ) -}} + {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.servicename.e2mgr.http" -}} + {{- $name := ( include "common.fullname.e2mgr" . ) -}} + {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.servicename.e2term.http" -}} + {{- $name := ( include "common.fullname.e2term" . ) -}} + {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.servicename.rtmgr.http" -}} + {{- $name := ( include "common.fullname.rtmgr" . ) -}} + {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.servicename.a1mediator.http" -}} + {{- $name := ( include "common.fullname.a1mediator" . ) -}} + {{- 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 -}} +###################### TCP Service ################################## + +{{- define "common.servicename.dbaas.tcp" -}} + {{- $name := ( include "common.fullname.dbaas" . ) -}} + {{- printf "service-%s-tcp" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/common/values.yaml b/ric-common/Common-Template/helm/ric-common/values.yaml similarity index 100% rename from ric-platform/50-RIC-Platform/helm/common/values.yaml rename to ric-common/Common-Template/helm/ric-common/values.yaml diff --git a/ric-common/Docker-Credential/bin/install b/ric-common/Docker-Credential/bin/install new file mode 100755 index 00000000..fadb3e69 --- /dev/null +++ b/ric-common/Docker-Credential/bin/install @@ -0,0 +1,52 @@ +#!/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. # +################################################################################ + + + +NAMESPACE=$1 + +DOCKERREG=$2 + +DOCKERREG_NORMALIZED=${DOCKERREG/:/.} +DOCKERREG_NORMALIZED=${DOCKERREG_NORMALIZED/\//.} + +DOCKERUSERNAME=$3 + +DOCKERPASSWORD=$4 + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/credential.conf + +if [ -z "$RICPLT_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICPLT_RELEASE_NAME +fi + +COMMON_CHART_VERSION=$(cat $DIR/../../Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') +helm package -d /tmp $DIR/../../Common-Template/helm/ric-common + + +mkdir -p $DIR/../helm/charts/ +cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/ + + +helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-cred-${NAMESPACE}-${DOCKERREG_NORMALIZED}" --set repository="$DOCKERREG" --set repositoryCredential.user="$DOCKERUSERNAME" --set repositoryCredential.password="$DOCKERPASSWORD" $DIR/../helm + diff --git a/ric-common/Docker-Credential/bin/uninstall b/ric-common/Docker-Credential/bin/uninstall new file mode 100755 index 00000000..777f3ea3 --- /dev/null +++ b/ric-common/Docker-Credential/bin/uninstall @@ -0,0 +1,39 @@ +#!/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. # +################################################################################ + + + +NAMESPACE=$1 + +DOCKERREG=$2 + +DOCKERREG_NORMALIZED=${DOCKERREG/:/.} +DOCKERREG_NORMALIZED=${DOCKERREG_NORMALIZED/\//.} +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/credential.conf + +if [ -z "$RICPLT_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICPLT_RELEASE_NAME +fi + +helm delete --purge "${RELEASE_NAME}-cred-${NAMESPACE}-${DOCKERREG_NORMALIZED}" + diff --git a/ric-common/Docker-Credential/etc/credential.conf b/ric-common/Docker-Credential/etc/credential.conf new file mode 100644 index 00000000..8bee7140 --- /dev/null +++ b/ric-common/Docker-Credential/etc/credential.conf @@ -0,0 +1,23 @@ +################################################################################ +# 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. # +################################################################################ + + +# helm_release_name defines the release name helm will use to deploy the credential +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r0 + + diff --git a/ric-common/Docker-Credential/helm/Chart.yaml b/ric-common/Docker-Credential/helm/Chart.yaml new file mode 100644 index 00000000..4624181b --- /dev/null +++ b/ric-common/Docker-Credential/helm/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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 +appVersion: "1.0" +description: A Helm chart for setting up k8s resources for accessing external and infrastructure resources before RIC deployment" +name: docker-credential +version: 1.1.0 diff --git a/ric-xapps/90-xApps/helm/xapp-admin/Chart.yaml b/ric-common/Docker-Credential/helm/requirements.yaml similarity index 92% rename from ric-xapps/90-xApps/helm/xapp-admin/Chart.yaml rename to ric-common/Docker-Credential/helm/requirements.yaml index 6e2d1bc2..2ab71b4e 100644 --- a/ric-xapps/90-xApps/helm/xapp-admin/Chart.yaml +++ b/ric-common/Docker-Credential/helm/requirements.yaml @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ -apiVersion: v1 -appVersion: "1.0" -description: Admin Control xApp Helm Chart -name: xapp-admin -version: 0.0.1 + +dependencies: + - name: ric-common + version: ~2.0.0 diff --git a/ric-common/Docker-Credential/helm/templates/_helper.tpl b/ric-common/Docker-Credential/helm/templates/_helper.tpl new file mode 100644 index 00000000..b3dd35fb --- /dev/null +++ b/ric-common/Docker-Credential/helm/templates/_helper.tpl @@ -0,0 +1,35 @@ +################################################################################ +# 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 image repository secret token. + The value for .Values.global.repositoryCred is used: + repositoryCred: + user: user + password: password + mail: email (optional) +*/}} +{{- define "repository.secret" -}} + {{- $repo := .Values.repository }} + {{- $cred := .Values.repositoryCredential }} + {{- $user := default "docker" $cred.user }} + {{- $password := default "docker" $cred.password }} + {{- $mail := default "@" $cred.mail }} + {{- $auth := printf "%s:%s" $user $password | b64enc }} + {{- printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $user $password $mail $auth | b64enc -}} +{{- end -}} + diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/secret.yaml b/ric-common/Docker-Credential/helm/templates/secrets-docker-reg.yaml similarity index 91% rename from ric-xapps/90-xApps/helm/xapp-std/templates/secret.yaml rename to ric-common/Docker-Credential/helm/templates/secrets-docker-reg.yaml index 1a88b2cd..fb0f95d1 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/secret.yaml +++ b/ric-common/Docker-Credential/helm/templates/secrets-docker-reg.yaml @@ -17,7 +17,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ .Release.Name }}-docker-registry-key + name: {{ include "common.dockercred.prefix" . }}-{{ .Values.repository | replace "." "-" | replace ":" "-" | replace "/" "-" }} data: .dockercfg: {{ include "repository.secret" . }} type: kubernetes.io/dockercfg diff --git a/ric-common/Docker-Credential/helm/values.yaml b/ric-common/Docker-Credential/helm/values.yaml new file mode 100644 index 00000000..4b02dc90 --- /dev/null +++ b/ric-common/Docker-Credential/helm/values.yaml @@ -0,0 +1,27 @@ +################################################################################ +# 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. # +################################################################################ + +# Values for setting up Kubernetes resources for accessing infrastructure such as docker registry +# helm repo, etc. + +repository: "nexus3.o-ran-sc.org:10004" + +repositoryCredential: + user: "docker" + password: "docker" + + diff --git a/ric-common/Helm-Credential/bin/install b/ric-common/Helm-Credential/bin/install new file mode 100755 index 00000000..00e11bc8 --- /dev/null +++ b/ric-common/Helm-Credential/bin/install @@ -0,0 +1,55 @@ +#!/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. # +################################################################################ +NAMESPACE=$1 + +HELMREPO=$2 + +HELMREPO_NORMALIZED=${HELMREPO/:/.} + +HELMREPO_NORMALIZED=${HELMREPO_NORMALIZED/\//.} + +HELMUSERNAME=$3 + +HELMPASSWORD=$4 + +HELMCERTPATH=$5 + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +cp $HELMCERTPATH $DIR/../helm/cert/tls.crt + + +source $DIR/../etc/credential.conf + +if [ -z "$RICPLT_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICPLT_RELEASE_NAME +fi + +COMMON_CHART_VERSION=$(cat $DIR/../../Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') +helm package -d /tmp $DIR/../../Common-Template/helm/ric-common + + +mkdir -p $DIR/../helm/charts/ +cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/ + +helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-cred-${NAMESPACE}-${HELMREPO_NORMALIZED}" --set helmrepo="$HELMREPO" --set helmrepoCredential.user="$DOCKERUSERNAME" --set helmrepoCredential.password="$DOCKERPASSWORD" $DIR/../helm + + +rm $DIR/../helm/cert/tls.crt diff --git a/ric-common/Helm-Credential/bin/uninstall b/ric-common/Helm-Credential/bin/uninstall new file mode 100755 index 00000000..caee118d --- /dev/null +++ b/ric-common/Helm-Credential/bin/uninstall @@ -0,0 +1,41 @@ +#!/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. # +################################################################################ +NAMESPACE=$1 + +HELMREPO=$2 + +HELMREPO_NORMALIZED=${HELMREPO/:/.} + +HELMREPO_NORMALIZED=${HELMREPO_NORMALIZED/\//.} + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/credential.conf + +if [ -z "$RICPLT_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICPLT_RELEASE_NAME +fi + + +helm delete --purge "${RELEASE_NAME}-cred-${NAMESPACE}-${HELMREPO_NORMALIZED}" + + diff --git a/ric-common/Helm-Credential/etc/credential.conf b/ric-common/Helm-Credential/etc/credential.conf new file mode 100644 index 00000000..8bee7140 --- /dev/null +++ b/ric-common/Helm-Credential/etc/credential.conf @@ -0,0 +1,23 @@ +################################################################################ +# 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. # +################################################################################ + + +# helm_release_name defines the release name helm will use to deploy the credential +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r0 + + diff --git a/ric-common/Helm-Credential/helm/Chart.yaml b/ric-common/Helm-Credential/helm/Chart.yaml new file mode 100644 index 00000000..69bdcc4c --- /dev/null +++ b/ric-common/Helm-Credential/helm/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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 +appVersion: "1.0" +description: A Helm chart for setting up k8s resources for accessing external and infrastructure resources before RIC deployment" +name: credential +version: 1.1.0 diff --git a/ric-common/Helm-Credential/helm/requirements.yaml b/ric-common/Helm-Credential/helm/requirements.yaml new file mode 100644 index 00000000..2ab71b4e --- /dev/null +++ b/ric-common/Helm-Credential/helm/requirements.yaml @@ -0,0 +1,20 @@ +################################################################################ +# 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. # +################################################################################ + +dependencies: + - name: ric-common + version: ~2.0.0 diff --git a/ric-common/Helm-Credential/helm/templates/_helper.tpl b/ric-common/Helm-Credential/helm/templates/_helper.tpl new file mode 100644 index 00000000..9666aa41 --- /dev/null +++ b/ric-common/Helm-Credential/helm/templates/_helper.tpl @@ -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. # +################################################################################ + + + +{{- define "helmrepo.secret.user" -}} + {{- $user := default "helm" .Values.helmrepoCredential.user -}} + {{- printf "%s" $user |b64enc }} +{{- end -}} + + +{{- define "helmrepo.secret.password" -}} + {{- $pass := default "helm" .Values.helmrepoCredential.password -}} + {{- printf "%s" $pass |b64enc }} +{{- end -}} diff --git a/ric-common/Helm-Credential/helm/templates/config-helm-cert.yaml b/ric-common/Helm-Credential/helm/templates/config-helm-cert.yaml new file mode 100644 index 00000000..8485c3ed --- /dev/null +++ b/ric-common/Helm-Credential/helm/templates/config-helm-cert.yaml @@ -0,0 +1,23 @@ +################################################################################ +# 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.helmcert.prefix" . }}-{{ .Values.helmrepo | replace "." "-" | replace ":" "-" | replace "/" "-" }} +data: + {{ (.Files.Glob "cert/tls.crt").AsConfig | nindent 2 }} diff --git a/ric-common/Helm-Credential/helm/templates/secrets-helm-xapp.yaml b/ric-common/Helm-Credential/helm/templates/secrets-helm-xapp.yaml new file mode 100644 index 00000000..2c7034b8 --- /dev/null +++ b/ric-common/Helm-Credential/helm/templates/secrets-helm-xapp.yaml @@ -0,0 +1,25 @@ +################################################################################ +# 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: Secret +metadata: + name: {{ include "common.helmcred.prefix" . }}-{{ .Values.helmrepo | replace "." "-" | replace ":" "-" | replace "/" "-" }} +type: Opaque +data: + helm_repo_username: {{ include "helmrepo.secret.user" . }} + helm_repo_password: {{ include "helmrepo.secret.password" . }} diff --git a/ric-common/Helm-Credential/helm/values.yaml b/ric-common/Helm-Credential/helm/values.yaml new file mode 100644 index 00000000..dc1008d5 --- /dev/null +++ b/ric-common/Helm-Credential/helm/values.yaml @@ -0,0 +1,26 @@ +################################################################################ +# 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. # +################################################################################ + +# Values for setting up Kubernetes resources for accessing infrastructure such as docker registry +# helm repo, etc. + +helmrepo: "ricaux-entry/helm" + + +helmrepoCredential: + user: "helm" + password: "helm" diff --git a/ric-infra/15-Initcontainer/docker/Dockerfile b/ric-common/Initcontainer/docker/Dockerfile similarity index 100% rename from ric-infra/15-Initcontainer/docker/Dockerfile rename to ric-common/Initcontainer/docker/Dockerfile diff --git a/ric-infra/15-Initcontainer/docker/bin/ricplt-init.sh b/ric-common/Initcontainer/docker/bin/ricplt-init.sh similarity index 100% rename from ric-infra/15-Initcontainer/docker/bin/ricplt-init.sh rename to ric-common/Initcontainer/docker/bin/ricplt-init.sh diff --git a/ric-infra/10-Nexus/helm/requirements.yaml b/ric-infra/10-Nexus/helm/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-infra/10-Nexus/helm/requirements.yaml +++ b/ric-infra/10-Nexus/helm/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 diff --git a/ric-infra/40-Credential/bin/install b/ric-infra/40-Credential/bin/install index eb7bf21a..1c38a863 100755 --- a/ric-infra/40-Credential/bin/install +++ b/ric-infra/40-Credential/bin/install @@ -36,12 +36,12 @@ else NAMESPACE=$RICPLT_NAMESPACE fi -COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}') -helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common +COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') +helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common mkdir -p $DIR/../helm/charts/ -cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/ +cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/ if [ -z $OVERRIDEYAML ]; then diff --git a/ric-infra/40-Credential/etc/credential.conf b/ric-infra/40-Credential/etc/credential.conf index fc9b7372..c4fc9028 100644 --- a/ric-infra/40-Credential/etc/credential.conf +++ b/ric-infra/40-Credential/etc/credential.conf @@ -24,3 +24,4 @@ helm_release_name=r0 # It will be overrided by RICPLT_NAMESPACE namespace=ricplt + diff --git a/ric-infra/40-Credential/helm/requirements.yaml b/ric-infra/40-Credential/helm/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-infra/40-Credential/helm/requirements.yaml +++ b/ric-infra/40-Credential/helm/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 diff --git a/ric-infra/40-Credential/helm/resources/tls.crt b/ric-infra/40-Credential/helm/resources/tls.crt index 984701e9..08bcca20 100644 --- a/ric-infra/40-Credential/helm/resources/tls.crt +++ b/ric-infra/40-Credential/helm/resources/tls.crt @@ -1,19 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIDFzCCAf+gAwIBAgIRAPqRsyJWFaoXjwzmI+uQ5GkwDQYJKoZIhvcNAQELBQAw -HTEbMBkGA1UEAxMSaGVsbS1yZXBvc2l0b3J5LWNhMB4XDTE5MDYyMjAzMDYxNVoX -DTIwMDYyMTAzMDYxNVowEDEOMAwGA1UEAxMFbmV4dXMwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDBExs2W0HvXyinLL/LOkgM4Dobe1OVVntQzCGB8tqD -xI4ZcXGh8G4b3GMLVe8vs0c0IUUbPhy23AkDxGUT7whLbo1UwGa41htxY51zok4S -20NN706XVs6E0tKqA1L5kzyxLEAKgHE/EefWIf6MHtRt5GfwFVdjdfZP+9L/ZpUL -u1HKmiWw7fv0m/MrcAQA7lILpB4xeaM8rYWtBj8TGeoMlWLOtOcFKGpY9Kuty1n7 -cebHcz++qY+Vsrf8RlG4lGlit2IY06FE+5ihK24Zt9Ttwf3lsTf6xDwAEGmDxOAp -R61gY9wX8ClLO+ns+nkkEiJ90104a4U+qg115tZCGfBBAgMBAAGjXzBdMA4GA1Ud -DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0T -AQH/BAIwADAeBgNVHREEFzAVghNoZWxtLnJpY2luZnJhLmxvY2FsMA0GCSqGSIb3 -DQEBCwUAA4IBAQA2Mt29tQ/3ACBpmZSKLPj3jTpPulXQKgtH9of9X0XBQ0ZdfqTN -Evyu+K5gY/FF6RhnkaCML4XoOnvJHQQBydwMrK9f6mcC26U8PWZn9+usihw5GJHp -Hu3pc0PDHb87ha+qCeie9ssKitz8pbJarTh6z1Ht8OT9/nktXkgPnIYI9ycAsdwy -uBww45UxDu8OD8TT0/08RzH56ruPpRSYDNRbkcT8FZV8C6KgEKG55e/xNAITQwaD -LD4xYkAZqK7lcPzuIM1kZUQAOJyw72TicMl94r0mL7pZ2NOJUCkkVvkYXo97TUKB -zomEUpolyZnVpdl4HG3v3Lwd2K3bCs2X+HTc +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-platform/50-RIC-Platform/bin/install b/ric-platform/50-RIC-Platform/bin/install index f50435ee..e4c031e9 100755 --- a/ric-platform/50-RIC-Platform/bin/install +++ b/ric-platform/50-RIC-Platform/bin/install @@ -38,18 +38,17 @@ fi RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator kong-platform kong-xapp" -#RICPLT_COMPONENTS="kong-platform kong-xapp" echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]" echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" -COMMON_CHART_VERSION=$(cat $DIR/../helm/common/Chart.yaml | grep version | awk '{print $2}') +COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') helm repo remove local -helm package -d /tmp $DIR/../helm/common +helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common for component in $RICPLT_COMPONENTS; do @@ -72,10 +71,10 @@ for component in $RICPLT_COMPONENTS; do echo "not kong component" mkdir -p $DIR/../helm/$component/charts/ - cp /tmp/common-$COMMON_CHART_VERSION.tgz $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 else helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../helm/$component fi -done \ No newline at end of file +done diff --git a/ric-platform/50-RIC-Platform/bin/uninstall b/ric-platform/50-RIC-Platform/bin/uninstall index a5ccd8cd..d4d2c627 100755 --- a/ric-platform/50-RIC-Platform/bin/uninstall +++ b/ric-platform/50-RIC-Platform/bin/uninstall @@ -38,6 +38,7 @@ 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/helm/appmgr/requirements.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 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 7c6efb89..02275f02 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml @@ -20,7 +20,7 @@ kind: ConfigMap metadata: name: {{ include "common.configmapname.appmgr" . }}-appconfig data: - {{- $restport := default ":8080" (printf ":%.0f" .Values.appmgr.containerPort) | quote -}} + {{- $restport := default ":8080" (printf ":%.0f" .Values.appmgr.service.http.containerPort) | quote -}} {{- $helmrepo := include "common.helmrepository" . | quote -}} {{- $reponame := default "helm-repo" .Values.appmgr.reponame | quote -}} {{- $tiller := include "common.helmrepositorytiller" . | quote -}} diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml index c0382642..07a20193 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml @@ -20,5 +20,5 @@ kind: ConfigMap metadata: name: {{ include "common.configmapname.appmgr" . }}-appenv data: - {{- $dbaasservicehost := include "common.servicename.dbaas" . | quote -}} + {{- $dbaasservicehost := include "common.servicename.dbaas.tcp" . | quote -}} {{- (.Files.Get "resources/appenv.yaml") | replace "__DBAAS_SERVICE_HOST__" $dbaasservicehost | 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 acce1325..fafcb421 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml @@ -38,10 +38,6 @@ spec: release: {{ .Release.Name }} spec: hostname: {{ .Chart.Name }} - hostAliases: - - ip: "137.135.91.204" - hostnames: - - "snapshot.helm.ranco-dev-tools.eastus.cloudapp.azure.com" imagePullSecrets: - name: {{ include "common.repositoryCred" . }} containers: @@ -50,7 +46,10 @@ spec: imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - name: http - containerPort: {{ .Values.appmgr.containerPort }} + containerPort: {{ .Values.appmgr.service.http.containerPort }} + protocol: TCP + - name: rmr + containerPort: {{ .Values.appmgr.service.rmr.containerPort }} protocol: TCP volumeMounts: - name: config-volume diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml index 1f3d49f5..683b32b2 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml @@ -1,12 +1,12 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: ric-ingress-appmgr + name: {{ include "common.ingressname.appmgr" . }} spec: rules: - http: paths: - path: /appmgr backend: - serviceName: {{ include "common.servicename.appmgr" . }} - servicePort: {{ .Values.appmgr.service.port }} + serviceName: {{ include "common.servicename.appmgr.http" . }} + servicePort: {{ .Values.appmgr.service.http.port }} diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-http.yaml similarity index 82% rename from ric-platform/50-RIC-Platform/helm/appmgr/templates/service.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/templates/service-http.yaml index 6c1241a0..edc144d4 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/service.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-http.yaml @@ -18,7 +18,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.servicename.appmgr" . }} + name: {{ include "common.servicename.appmgr.http" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} @@ -26,12 +26,12 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: - type: {{ .Values.appmgr.service.type }} + type: ClusterIP ports: - - port: {{ .Values.appmgr.service.port }} - protocol: {{ .Values.appmgr.service.protocol }} - name: "{{ .Values.appmgr.service.name }}" - {{ if (eq .Values.appmgr.service.type "NodePort") }}nodePort: {{ .Values.appmgr.service.extport }} {{ end }} + - port: {{ .Values.appmgr.service.http.port }} + protocol: "TCP" + name: "http" + targetPort: "http" selector: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} 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 new file mode 100644 index 00000000..972a2631 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service-rmr.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.appmgr.rmr" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.appmgr.service.rmr.port }} + protocol: "TCP" + name: "rmr" + targetPort: "rmr" + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml index 3b20e64b..58a6a206 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://helm.ricinfra.local:31000" +helmRepository: "https://ricaux-entry/helm" # Default secret name for Helm Repo credential. .Value.golbal.helmRepositoryCred will # override the default value. You can further override uing @@ -71,15 +71,15 @@ appmgr: # This section describes xAppManager replicaCount: 1 - containerPort: 8080 reponame: "helm-repo" service: - type: ClusterIP - port: 8080 - name: appmgr-service - protocol: "TCP" - extport: 30020 + http: + port: 8080 + containerPort: 8080 + rmr: + port: 4560 + containerPort: 4560 # config diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_ingresscontroller.tpl b/ric-platform/50-RIC-Platform/helm/common/templates/_ingresscontroller.tpl deleted file mode 100644 index 7ebbcd1a..00000000 --- a/ric-platform/50-RIC-Platform/helm/common/templates/_ingresscontroller.tpl +++ /dev/null @@ -1,189 +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. # -################################################################################ - -{{/* - Resolve the ingress controller addresses. -*/}} -{{- define "common.ingressurl.ricplt" -}} - {{- if .Values.kongplatform -}} - {{- if .Values.kongplatform.ingressurlOverride -}} - {{- printf "%s" .Values.kongplatform.ingressurlOverride -}} - {{- else -}} - {{- printf "ricplt-entry" -}} - {{- end -}} - {{- else -}} - {{- printf "ricplt-entry" -}} - {{- end -}} -{{- end -}} - - - -{{- define "common.ingresshttpport.ricplt" -}} - {{- if .Values.kongplatform -}} - {{- if .Values.kongplatform.ingresshttpportOverride -}} - {{- printf "%.0f" .Values.kongplatform.ingresshttpportOverride -}} - {{- else -}} - {{- printf "30080" -}} - {{- end -}} - {{- else -}} - {{- printf "30080" -}} - {{- end -}} -{{- end -}} - - - -{{- define "common.ingresshttpsport.ricplt" -}} - {{- if .Values.kongplatform -}} - {{- if .Values.kongplatform.ingresshttpsportOverride -}} - {{- printf "%.0f" .Values.kongplatform.ingresshttpsportOverride -}} - {{- else -}} - {{- printf "30443" -}} - {{- end -}} - {{- else -}} - {{- printf "30443" -}} - {{- end -}} -{{- end -}} - - - - - - - - - - - - - - - - -{{- define "common.ingressurl.ricxapp" -}} - {{- if .Values.kongxapp -}} - {{- if .Values.kongxapp.ingressurlOverride -}} - {{- printf "%s" .Values.kongxapp.ingressurlOverride -}} - {{- else -}} - {{- printf "ricxapp-entry" -}} - {{- end -}} - {{- else -}} - {{- printf "ricxapp-entry" -}} - {{- end -}} -{{- end -}} - - - -{{- define "common.ingresshttpport.ricxapp" -}} - {{- if .Values.kongxapp -}} - {{- if .Values.kongxapp.ingresshttpportOverride -}} - {{- printf "%.0f" .Values.kongxapp.ingresshttpportOverride -}} - {{- else -}} - {{- printf "31080" -}} - {{- end -}} - {{- else -}} - {{- printf "31080" -}} - {{- end -}} -{{- end -}} - - - -{{- define "common.ingresshttpsport.ricxapp" -}} - {{- if .Values.kongxapp -}} - {{- if .Values.kongxapp.ingresshttpsportOverride -}} - {{- printf "%.0f" .Values.kongxapp.ingresshttpsportOverride -}} - {{- else -}} - {{- printf "31443" -}} - {{- end -}} - {{- else -}} - {{- printf "31443" -}} - {{- end -}} -{{- end -}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{{- define "common.ingressurl.ricaux" -}} - {{- if .Values.kongaux -}} - {{- if .Values.kongaux.ingressurlOverride -}} - {{- printf "%s" .Values.kongaux.ingressurlOverride -}} - {{- else -}} - {{- printf "ricaux-entry" -}} - {{- end -}} - {{- else -}} - {{- printf "ricaux-entry" -}} - {{- end -}} -{{- end -}} - - - - - -{{- define "common.ingresshttpport.ricaux" -}} - {{- if .Values.kongaux -}} - {{- if .Values.kongaux.ingresshttpportOverride -}} - {{- printf "%.0f" .Values.kongaux.ingresshttpportOverride -}} - {{- else -}} - {{- printf "32080" -}} - {{- end -}} - {{- else -}} - {{- printf "32080" -}} - {{- end -}} -{{- end -}} - - - -{{- define "common.ingresshttpsport.ricaux" -}} - {{- if .Values.kongaux -}} - {{- if .Values.kongaux.ingresshttpsportOverride -}} - {{- printf "%.0f" .Values.kongaux.ingresshttpsportOverride -}} - {{- else -}} - {{- printf "32443" -}} - {{- end -}} - {{- else -}} - {{- printf "32443" -}} - {{- end -}} -{{- end -}} - diff --git a/ric-platform/50-RIC-Platform/helm/dbaas/requirements.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-platform/50-RIC-Platform/helm/dbaas/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 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 135b2c27..d4213b2e 100644 --- a/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml @@ -44,6 +44,8 @@ spec: - image: {{ include "common.repository" . }}/{{ .Values.dbaas.backend.image.name }}:{{ .Values.dbaas.backend.image.tag }} imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - - containerPort: {{ .Values.dbaas.backend.targetPort }} + - containerPort: {{ .Values.dbaas.backend.containerPort }} + name: sql + protocol: TCP name: {{ include "common.namespace" . }}-{{ include "common.name" . }} 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 c87ddf37..d9ef65e4 100644 --- a/ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml @@ -18,7 +18,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.servicename.dbaas" . }} + name: {{ include "common.servicename.dbaas.tcp" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} @@ -31,4 +31,6 @@ spec: release: {{ .Release.Name }} ports: - port: {{ .Values.dbaas.backend.port }} - targetPort: {{ .Values.dbaas.backend.targetPort }} + targetPort: "sql" + protocol: "TCP" + name: "sql" diff --git a/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml index edf51f43..2950715d 100644 --- a/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml @@ -39,7 +39,7 @@ dbaas: terminationGracePeriodSeconds: 0 replicas: 1 port: 6379 - targetPort: 6379 + containerPort: 6379 image: name: redis-standalone tag: latest diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/Chart.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/Chart.yaml index f33294a2..36238331 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/Chart.yaml @@ -15,7 +15,7 @@ # limitations under the License. # ################################################################################ - +appVersion: "1.0" apiVersion: v1 description: Oran e2mgr Helm charts name: e2mgr diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/requirements.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.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 fcfe9a0c..690f4f83 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml @@ -24,6 +24,6 @@ metadata: data: router.txt: | newrt|start - rte|1001|{{ include "common.servicename.e2term" .}}:38000 - rte|2002|{{ include "common.servicename.e2mgr" .}}:3801 + rte|1001|{{ include "common.servicename.e2term.rmr" .}}:38000 + rte|2002|{{ include "common.servicename.e2mgr.rmr" .}}:3801 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 08360458..e62dfd4a 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml @@ -51,11 +51,13 @@ spec: env: - name: RMR_RTG_SVC value: "{{ .Values.e2mgr.env.RMR_RTG_SVC }}" + - name: RIC_ID + value: "{{ .Values.e2mgr.env.RIC_ID }}" ports: - - name: {{ .Values.e2mgr.service.http.name }} - containerPort: {{ .Values.e2mgr.service.http.port }} - - name: {{ .Values.e2mgr.service.nano.name }} - containerPort: {{ .Values.e2mgr.service.nano.port }} + - name: "http" + containerPort: {{ .Values.e2mgr.service.http.containerPort }} + - name: "rmr" + containerPort: {{ .Values.e2mgr.service.rmr.containerPort }} stdin: true tty: true securityContext: diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml index 07229283..d1c8faac 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml @@ -1,12 +1,12 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: ric-ingress-e2mgr + name: {{ include "common.ingressname.e2mgr" . }} spec: rules: - http: paths: - path: /e2mgr backend: - serviceName: {{ include "common.servicename.e2mgr" . }} - servicePort: {{ .Values.e2mgr.service.http.port }} \ No newline at end of file + serviceName: {{ include "common.servicename.e2mgr.http" . }} + servicePort: {{ .Values.e2mgr.service.http.port }} 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 new file mode 100644 index 00000000..95e05901 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-http.yaml @@ -0,0 +1,37 @@ +################################################################################ +# 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.e2mgr.http" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.e2mgr.service.http.port }} + protocol: "TCP" + name: "http" + targetPort: "http" + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + 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 new file mode 100644 index 00000000..d7d39d97 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service-rmr.yaml @@ -0,0 +1,37 @@ +################################################################################ +# 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.e2mgr.rmr" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.e2mgr.service.rmr.port }} + protocol: "TCP" + name: "rmr" + targetPort: "rmr" + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service.yaml deleted file mode 100644 index 2eb580ff..00000000 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service.yaml +++ /dev/null @@ -1,43 +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. # -################################################################################ - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "common.servicename.e2mgr" . }} - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.e2mgr.service.type }} - ports: - - port: {{ .Values.e2mgr.service.http.port }} - protocol: TCP - targetPort: {{ .Values.e2mgr.service.http.port }} - name: "{{ .Values.e2mgr.service.http.name }}" - {{ if (eq .Values.e2mgr.service.type "NodePort") }}nodePort: {{ .Values.e2mgr.service.http.extport }} {{ end }} - - port: {{ .Values.e2mgr.service.nano.port }} - protocol: TCP - targetPort: {{ .Values.e2mgr.service.nano.port }} - name: "{{ .Values.e2mgr.service.nano.name }}" - {{ if (eq .Values.e2mgr.service.type "NodePort") }}nodePort: {{ .Values.e2mgr.service.nano.extport }} {{ end }} - selector: - app: {{ include "common.namespace" . }}-{{ include "common.name" . }} - 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 a0bb1af6..9a84755f 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml @@ -39,24 +39,19 @@ repositoryCred: docker-reg-cred e2mgr: image: name: e2mgr - tag: 1.0.0 + tag: 1.6.0 replicaCount: 1 env: RMR_RTG_SVC: "ric-full-rtmgr" - + RIC_ID: "bbbccc-abcd0e/20" + service: - type: ClusterIP http: port: 3800 - target_port: 3800 - protocol: "TCP" - name: "http" - extport: 30004 - nano: + containerPort: 3800 + rmr: port: 3801 - target_port: 3801 - protocol: "TCP" - name: "nano" + containerPort: 3801 diff --git a/ric-platform/50-RIC-Platform/helm/e2term/requirements.yaml b/ric-platform/50-RIC-Platform/helm/e2term/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 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 832b2635..68faf8e7 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml @@ -24,6 +24,6 @@ metadata: data: router.txt: | newrt|start - rte|1001|{{ include "common.configmapname.e2term" . }}:38000 - rte|2002|{{ include "common.configmapname.e2mgr" . }}:3801 + rte|1001|{{ include "common.servicename.e2term.rmr" . }}:38000 + rte|2002|{{ include "common.servicename.e2mgr.rmr" . }}:3801 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 c090c364..f3b5ce2a 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml @@ -54,14 +54,14 @@ spec: - name: sctp value: "5577" - name: nano - value: "{{ .Values.e2term.service.nano.port }}" + value: "{{ .Values.e2term.service.rmr.port }}" - name: print value: "{{ .Values.e2term.env.print }}" - name: RMR_RTG_SVC value: "{{ .Values.e2term.env.RMR_RTG_SVC }}" ports: - - name: {{ .Values.e2term.service.nano.name }} - containerPort: {{ .Values.e2term.service.nano.port }} + - name: "rmr" + containerPort: {{ .Values.e2term.service.rmr.containerPort }} stdin: true tty: true securityContext: diff --git a/ric-platform/50-RIC-Platform/helm/e2term/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/service-rmr.yaml similarity index 86% rename from ric-platform/50-RIC-Platform/helm/e2term/templates/service.yaml rename to ric-platform/50-RIC-Platform/helm/e2term/templates/service-rmr.yaml index c3332f13..08a8a4c6 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/templates/service.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/service-rmr.yaml @@ -18,7 +18,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.servicename.e2term" . }} + name: {{ include "common.servicename.e2term.rmr" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} @@ -26,12 +26,12 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: - type: {{ .Values.e2term.service.type }} + type: ClusterIP ports: - - port: {{ .Values.e2term.service.nano.port }} - protocol: TCP - targetPort: {{ .Values.e2term.service.nano.target_port }} - name: {{ .Values.e2term.service.nano.name }} + - port: {{ .Values.e2term.service.rmr.port }} + protocol: "TCP" + targetPort: "rmr" + name: "rmr" selector: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} 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 e92ba786..17d2c5cf 100644 --- a/ric-platform/50-RIC-Platform/helm/e2term/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/values.yaml @@ -46,10 +46,6 @@ e2term: RMR_RTG_SVC: "ric-full-rtmgr" service: - type: ClusterIP - nano: + rmr: port: 38000 - target_port: 38000 - protocol: "TCP" - name: "nano-port" - + containerPort: 38000 diff --git a/ric-platform/50-RIC-Platform/helm/kong-platform/requirements.lock b/ric-platform/50-RIC-Platform/helm/kong-platform/requirements.lock new file mode 100644 index 00000000..925f1563 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/kong-platform/requirements.lock @@ -0,0 +1,6 @@ +dependencies: +- name: kong + repository: https://kubernetes-charts.storage.googleapis.com + version: 0.12.2 +digest: sha256:602faffeeb88bef70eccff8d135f1db6c524ca11eb90f6436a86c9866af57be9 +generated: 2019-06-27T15:22:13.009502618-04:00 diff --git a/ric-platform/50-RIC-Platform/helm/kong-xapp/requirements.lock b/ric-platform/50-RIC-Platform/helm/kong-xapp/requirements.lock new file mode 100644 index 00000000..38ebd052 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/kong-xapp/requirements.lock @@ -0,0 +1,6 @@ +dependencies: +- name: kong + repository: https://kubernetes-charts.storage.googleapis.com + version: 0.12.2 +digest: sha256:602faffeeb88bef70eccff8d135f1db6c524ca11eb90f6436a86c9866af57be9 +generated: 2019-06-27T15:22:18.891920209-04:00 diff --git a/ric-platform/50-RIC-Platform/helm/ric/.helmignore b/ric-platform/50-RIC-Platform/helm/ric/.helmignore deleted file mode 100644 index 50af0317..00000000 --- a/ric-platform/50-RIC-Platform/helm/ric/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/ric-platform/50-RIC-Platform/helm/ric/requirements.yaml b/ric-platform/50-RIC-Platform/helm/ric/requirements.yaml deleted file mode 100644 index c9f0c246..00000000 --- a/ric-platform/50-RIC-Platform/helm/ric/requirements.yaml +++ /dev/null @@ -1,33 +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. # -################################################################################ - -dependencies: - - name: e2mgr - version: 1.1.0 - condition: e2mgr.enabled - - name: rtmgr - version: 1.1.0 - condition: rtmgr.enabled - - name: e2term - version: 1.1.0 - condition: e2term.enabled - - name: appmgr - version: 1.1.0 - condition: appmgr.enabled - - name: dbaas - version: 1.1.0 - condition: dbaas.enabled diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/requirements.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-platform/50-RIC-Platform/helm/rtmgr/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 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 afeff191..d6f3259b 100644 --- a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/deployment.yaml @@ -47,7 +47,7 @@ spec: command: ["/run_rtmgr.sh"] env: - name: XMURL - value: "http://ric-full-appmgr:8080/ric/v1/xapps" + value: "http://{{ include "common.servicename.appmgr.http" . }}:8080/ric/v1/xapps" - name: SOCKET value: "tcp://0.0.0.0:4560" - name: RTFILE @@ -61,5 +61,5 @@ spec: - name: SDL value: "file" ports: - - name: {{ .Values.rtmgr.service.nano.name }} - containerPort: {{ .Values.rtmgr.service.nano.port }} + - name: "rmr" + containerPort: {{ .Values.rtmgr.service.rmr.containerPort }} diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service-rmr.yaml similarity index 87% rename from ric-platform/50-RIC-Platform/helm/rtmgr/templates/service.yaml rename to ric-platform/50-RIC-Platform/helm/rtmgr/templates/service-rmr.yaml index 3f0dc98a..0ded6afe 100644 --- a/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/service-rmr.yaml @@ -18,7 +18,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.servicename.rtmgr" . }} + name: {{ include "common.servicename.rtmgr.rmr" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} @@ -26,12 +26,12 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: - type: {{ .Values.rtmgr.service.type }} + type: ClusterIP ports: - - port: {{ .Values.rtmgr.service.nano.port }} + - port: {{ .Values.rtmgr.service.rmr.port }} protocol: TCP - targetPort: {{ .Values.rtmgr.service.nano.target_port }} - name: {{ .Values.rtmgr.service.nano.name }} + targetPort: "rmr" + name: "rmr" selector: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} 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 299863c1..74d479fd 100644 --- a/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml @@ -40,10 +40,6 @@ rtmgr: tag: 0.0.2 service: - type: ClusterIP - nano: - port: 5656 - target_port: 4560 - protocol: "TCP" - name: "nano-port" - + rmr: + port: 4560 + containerPort: 5656 diff --git a/ric-platform/55-Ext-Services/bin/install b/ric-platform/55-Ext-Services/bin/install index d4a538de..6f6f6e92 100755 --- a/ric-platform/55-Ext-Services/bin/install +++ b/ric-platform/55-Ext-Services/bin/install @@ -42,15 +42,15 @@ echo "Platform Namespace: $NAMESPACE" echo "Helm Release Name: $RELEASE_NAME" -COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}') +COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}') -helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common +helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common for component in $RICAUX_COMPONENTS; do echo "Preparing chart for comonent $component" mkdir -p $DIR/../helm/$component/charts/ - cp /tmp/common-$COMMON_CHART_VERSION.tgz $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 else diff --git a/ric-platform/55-Ext-Services/helm/ext/requirements.yaml b/ric-platform/55-Ext-Services/helm/ext/requirements.yaml index aa94575b..2ab71b4e 100644 --- a/ric-platform/55-Ext-Services/helm/ext/requirements.yaml +++ b/ric-platform/55-Ext-Services/helm/ext/requirements.yaml @@ -16,5 +16,5 @@ ################################################################################ dependencies: - - name: common - version: ~1.1.0 + - name: ric-common + version: ~2.0.0 diff --git a/ric-platform/55-Ext-Services/helm/ext/templates/services.yaml b/ric-platform/55-Ext-Services/helm/ext/templates/services.yaml index fc6029a9..ec524c17 100644 --- a/ric-platform/55-Ext-Services/helm/ext/templates/services.yaml +++ b/ric-platform/55-Ext-Services/helm/ext/templates/services.yaml @@ -42,4 +42,33 @@ subsets: - port: {{ include "common.ingresshttpport.ricaux" . }} name: {{ include "common.ingressurl.ricaux" . }}-http-ingress-port - port: {{ include "common.ingresshttpport.ricaux" . }} - name: {{ include "common.ingressurl.ricaux" . }}-https-ingress-port \ No newline at end of file + name: {{ include "common.ingressurl.ricaux" . }}-https-ingress-port +--- +kind: "Service" +apiVersion: "v1" +metadata: + name: {{ include "common.ingressurl.ricinfra" . }} + namespace: {{ include "common.namespace" . }} +spec: + ports: + - name: {{ include "common.ingressurl.ricinfra" . }}-http-ingress-port + protocol: "TCP" + port: 80 + - name: {{ include "common.ingressurl.ricinfra" . }}-https-ingress-port + protocol: "TCP" + port: 443 +--- +kind: "Endpoints" +apiVersion: "v1" +metadata: + # match with the selector-less service + name: {{ include "common.ingressurl.ricinfra" . }} + namespace: {{ include "common.namespace" . }} +subsets: + - addresses: + - ip: "{{ .Values.ext.ip }}" + ports: + - port: {{ include "common.ingresshttpport.ricinfra" . }} + name: {{ include "common.ingressurl.ricinfra" . }}-http-ingress-port + - port: {{ include "common.ingresshttpport.ricinfra" . }} + name: {{ include "common.ingressurl.ricinfra" . }}-https-ingress-port diff --git a/ric-xapps/90-xApps/helm/xapp-admin/values.yaml b/ric-xapps/90-xApps/helm/xapp-admin/values.yaml deleted file mode 100644 index f63a7a75..00000000 --- a/ric-xapps/90-xApps/helm/xapp-admin/values.yaml +++ /dev/null @@ -1,89 +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. # -################################################################################ - -# 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 - - -ricapp: - # This section is for xapp. Templates to be resolved from xApp descriptor - replicaCount: 1 - xappname: &anchor-xappname xapp-admin - - # # the name of the process that indicates the liveness of the component - livenessprocessname: adm-ctrl-xapp - - image: - name: test/xapp-admin - tag: latest - - nameOverride: "" - fullnameOverride: "" - - service: - enabled: false - - # to be provided as property file - appconfigpath: /opt/etc/xapp - appconfig: - # to be present as appconfigpath/propfile1 - propfile1: | - prop1.v1="propvalue1.1" - prop1.v2="propvalue1.2" - propfile2: "propvalue2" - - # to be provided as env variables - appenv: - NAME: *anchor-xappname - RMR_RTG_SVC: "127.0.0.2" - NAME: "ADM_CTRL_XAPP2" - THREADS: "2" - VERBOSE: "1" - PORT: "tcp:4561" - - # secret - appsecretpath: /opt/etc/kube - appsecret: - username: myusername - password: mypassword - - resources: - limits: - cpu: 100m - memory: 128Mi - requests: - cpu: 100m - memory: 128Mi - - nodeSelector: {} - - tolerations: [] - - affinity: {} - 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 e3ad5b2c..e2309bf5 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl @@ -18,7 +18,7 @@ {{/* Expand the name of the chart. */}} -{{- define "ricapp.name" -}} +{{- define "ricxapp.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -27,15 +27,15 @@ 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 "-" -}} +{{- define "ricxapp.fullname" -}} +{{- if .Values.ricxapp.fullnameOverride -}} +{{- .Values.ricxapp.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} -{{- $name := default .Chart.Name .Values.ricapp.nameOverride -}} +{{- $name := default .Chart.Name .Values.ricxapp.nameOverride -}} {{- if contains $name .Release.Name -}} {{- .Release.Name | trunc 63 | trimSuffix "-" -}} {{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} {{- end -}} @@ -43,32 +43,37 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "ricapp.chart" -}} +{{- define "ricxapp.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "repository" -}} - {{if .Values.repositoryOverride }} - {{- printf "%s" .Values.repositoryOverride -}} - {{else}} - {{- default .Values.repository .Values.global.repository -}} - {{end}} +{{- define "ricxapp.namespace" -}} + {{- default .Release.Namespace .Values.nsPrefix -}} {{- end -}} -{{/* - Resolve the image repository secret token. - The value for .Values.global.repositoryCred is used: - repositoryCred: - user: user - password: password - mail: email (optional) -*/}} -{{- define "repository.secret" -}} - {{- $repo := include "repository" . }} - {{- $repo := default "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" $repo }} - {{- $cred := .Values.global.repositoryCred }} - {{- $mail := default "@" $cred.mail }} - {{- $auth := printf "%s:%s" $cred.user $cred.password | b64enc }} - {{- printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $cred.user $cred.password $mail $auth | b64enc -}} + + +{{- define "ricxapp.servicename.rmr" -}} + {{- $name := ( include "ricxapp.fullname" . ) -}} + {{- printf "service-%s-rmr" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "ricxapp.servicename.http" -}} + {{- $name := ( include "ricxapp.fullname" . ) -}} + {{- printf "service-%s-http" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- define "ricxapp.configmapname" -}} + {{- $name := ( include "ricxapp.fullname" . ) -}} + {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "ricxapp.deploymentname" -}} + {{- $name := ( include "ricxapp.fullname" . ) -}} + {{- printf "deployment-%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/deployment.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml index 1e82e942..e6fa26d9 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml @@ -26,16 +26,18 @@ spec: app.kubernetes.io/instance: {{ .Release.Name }} spec: hostname: {{ .Values.ricapp.hostname }} + 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 }} ports: - name: http - containerPort: {{ .Values.ricapp.service.port }} + containerPort: {{ .Values.ricapp.service.http.containerPort }} protocol: TCP - name: rmr - containerPort: {{ .Values.ricapp.service.rmrPort }} + containerPort: {{ .Values.ricapp.service.rmr.containerPort }} protocol: TCP volumeMounts: - name: config-volume diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/service.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/service-http.yaml similarity index 74% rename from ric-xapps/90-xApps/helm/xapp-std/templates/service.yaml rename to ric-xapps/90-xApps/helm/xapp-std/templates/service-http.yaml index 5e8c15fb..7f994224 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/service.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/service-http.yaml @@ -15,24 +15,23 @@ # limitations under the License. # ################################################################################ -{{ if .Values.ricapp.service.enabled }} apiVersion: v1 kind: Service metadata: - name: {{ include "ricapp.name" . }} + name: {{ include "ricxapp.servicename.http" . }} + namespace: {{ include "ricxapp.namespace" . }} 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: - type: {{ .Values.ricapp.service.type }} + type: ClusterIP ports: - - port: {{ .Values.ricapp.service.port }} + - port: {{ .Values.ricxapp.service.http.port }} targetPort: http protocol: TCP name: http selector: - app.kubernetes.io/name: {{ include "ricapp.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} -{{ end }} \ No newline at end of file + app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} + release: {{ .Release.Name }} 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 new file mode 100644 index 00000000..1d9ce926 --- /dev/null +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml @@ -0,0 +1,37 @@ +################################################################################ +# 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 "ricxapp.servicename.rmr" . }} + namespace: {{ include "ricxapp.namespace" . }} + labels: + app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.ricxapp.service.rmr.port }} + targetPort: rmr + protocol: TCP + name: rmr + 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 4d95ef1a..1eaa11ae 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/values.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/values.yaml @@ -45,11 +45,12 @@ ricapp: tag: latest service: - enabled: true - type: ClusterIP - name: xapp-std-service - port: 8080 - rmrPort: 4560 + http: + port: 8080 + containerPort: 8080 + rmr: + port: 4560 + containerPort: 4560 probes: healthAliveCheckEndpoint: ric/v1/health/alive