From: Zhe Huang Date: Mon, 20 May 2019 19:45:42 +0000 (-0400) Subject: This patch introduces a new structure of the it/dep repo. X-Git-Tag: 0.0.2~104 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=033ab424056c2de6bdbc22479e961aeebbaddd37;p=it%2Fdep.git This patch introduces a new structure of the it/dep repo. Components are restructured into a tree. Helm charts are designed with common templates so that parameters can be standardized. This patches introduced installation scripts that take override value.yaml files for all the helm charts. Signed-off-by: Zhe Huang Change-Id: I44f043f8c7a93fa7f50ac31c37f9cb5e0efbfb53 --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..43126d91 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "infra/10-Nexus/docker/nexus-repository-helm"] + path = infra/10-Nexus/docker/nexus-repository-helm + url = https://github.com/sonatype-nexus-community/nexus-repository-helm.git diff --git a/LICENSES.txt b/LICENSES.txt deleted file mode 100644 index 2a3dd5c9..00000000 --- a/LICENSES.txt +++ /dev/null @@ -1,32 +0,0 @@ -LICENSES.txt - - -Unless otherwise specified, all software contained herein is licensed -under the Apache License, Version 2.0 (the "Software License"); -you may not use this software except in compliance with the Software -License. You may obtain a copy of the Software License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the Software License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the Software License for the specific language governing permissions -and limitations under the Software License. - - - -Unless otherwise specified, all documentation contained herein is licensed -under the Creative Commons License, Attribution 4.0 Intl. (the -"Documentation License"); you may not use this documentation except in -compliance with the Documentation License. You may obtain a copy of the -Documentation License at - -https://creativecommons.org/licenses/by/4.0/ - -Unless required by applicable law or agreed to in writing, documentation -distributed under the Documentation License is distributed on an "AS IS" -BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the Documentation License for the specific language governing -permissions and limitations under the Documentation License. - diff --git a/README.md b/README.md deleted file mode 100644 index 13eeaaa0..00000000 --- a/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# RIC Integration - -This repo contains RAN Intelligent Controller (RIC) deployments related files. - - -### Directory Structure -- kubernetes: scripts for kubernetes related tasks -- LICENSES.txt: -- localize.sh: a script for inserting localized infrastructure parameters (docker registry host, port, etc) into helm charts and scripts in this repo -- ricplt: RIC Platform Helm charts and related scripts -- runric_env.sh: the env variables for local infrastructure -- xapps: xapps Helm charts and chart templates - -### To Generate Localized Charts and Scripts - -First we will need to edit the ./runric_env.sh and fill values with local infrastructure parameters. - -```sh -$ then run: -$ ./localize.sh -$ cd generated -``` - -Now the localized scripts and charts are ready to use. diff --git a/aux/80-Auxiliary-Functions/bin/install b/aux/80-Auxiliary-Functions/bin/install new file mode 100755 index 00000000..8e8170d7 --- /dev/null +++ b/aux/80-Auxiliary-Functions/bin/install @@ -0,0 +1,59 @@ +#!/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. # +################################################################################ + + +OVERRIDEYAML=$1 + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/dashboard.conf + +if [ -z "$RICAUX_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICAUX_RELEASE_NAME +fi +if [ -z "$RICAUX_NAMESPACE" ];then + NAMESPACE=$namespace +else + NAMESPACE=$RICAUX_NAMESPACE +fi + +RICAUX_COMPONENTS="dashboard" + +echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]" +echo "Platform Namespace: $NAMESPACE" +echo "Helm Release Name: $RELEASE_NAME" + + +COMMON_CHART_VERSION=$(cat $DIR/../../50-RIC-Platform/charts/common/Chart.yaml | grep version | awk '{print $2}') + +helm package -d /tmp $DIR/../../50-RIC-Platform/charts/common + + +for component in $RICAUX_COMPONENTS; do + echo "Preparing chart for comonent $component" + cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../charts/$component/charts/ + if [ -z $OVERRIDEYAML ]; then + helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + else + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + fi +done diff --git a/ricplt/appmgr/charts/appmgr/templates/appconfig.yaml b/aux/80-Auxiliary-Functions/etc/dashboard.conf similarity index 82% rename from ricplt/appmgr/charts/appmgr/templates/appconfig.yaml rename to aux/80-Auxiliary-Functions/etc/dashboard.conf index 6cc1fda9..0ee625be 100644 --- a/ricplt/appmgr/charts/appmgr/templates/appconfig.yaml +++ b/aux/80-Auxiliary-Functions/etc/dashboard.conf @@ -15,12 +15,11 @@ # limitations under the License. # ################################################################################ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "appmgr.fullname" . }}-appconfig -data: - {{- with .Values.appconfig }} - {{- toYaml . | nindent 2 }} - {{- end }} +# helm_release_name defines the release name helm will use to deploy RIC +# It will be overrided by RICAUX_RELEASE_NAME +helm_release_name=r0 + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICAUX_NAMESPACE +namespace=ricaux diff --git a/aux/portal-ric-dashboard/Chart.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml similarity index 97% rename from aux/portal-ric-dashboard/Chart.yaml rename to aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml index 17a28b14..f142b0ac 100644 --- a/aux/portal-ric-dashboard/Chart.yaml +++ b/aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml @@ -18,5 +18,5 @@ apiVersion: v1 appVersion: "1.0" description: Helm chart for the RIC Dashboard web app -name: ric-dashboard -version: 1.0.0 +name: dashboard +version: 1.1.0 diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/charts/common-1.1.0.tgz b/aux/80-Auxiliary-Functions/helm/dashboard/charts/common-1.1.0.tgz new file mode 100644 index 00000000..ccccfe63 Binary files /dev/null and b/aux/80-Auxiliary-Functions/helm/dashboard/charts/common-1.1.0.tgz differ diff --git a/ricplt/appmgr/requirements.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml similarity index 96% rename from ricplt/appmgr/requirements.yaml rename to aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml index f18ffcaa..aa94575b 100644 --- a/ricplt/appmgr/requirements.yaml +++ b/aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml @@ -17,5 +17,4 @@ dependencies: - name: common - version: ~1.0.0 - repository: '@local' + version: ~1.1.0 diff --git a/aux/portal-ric-dashboard/templates/_helpers.tpl b/aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl similarity index 100% rename from aux/portal-ric-dashboard/templates/_helpers.tpl rename to aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl diff --git a/aux/portal-ric-dashboard/templates/configmap.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/templates/configmap.yaml similarity index 100% rename from aux/portal-ric-dashboard/templates/configmap.yaml rename to aux/80-Auxiliary-Functions/helm/dashboard/templates/configmap.yaml diff --git a/aux/portal-ric-dashboard/templates/deployment.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml similarity index 66% rename from aux/portal-ric-dashboard/templates/deployment.yaml rename to aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml index dbd0191c..efabecb9 100644 --- a/aux/portal-ric-dashboard/templates/deployment.yaml +++ b/aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml @@ -19,27 +19,31 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "dashboard.fullname" . }} + namespace: {{ include "common.namespace" . }} labels: - app.kubernetes.io/name: {{ include "dashboard.name" . }} - helm.sh/chart: {{ include "dashboard.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - app.kubernetes.io/name: {{ include "dashboard.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} template: metadata: labels: - app.kubernetes.io/name: {{ include "dashboard.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} spec: + hostname: {{ .Chart.Name }} + imagePullSecrets: + - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + image: {{ include "common.repository" . }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - name: http containerPort: 8080 @@ -58,17 +62,3 @@ spec: httpGet: path: / port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml new file mode 100644 index 00000000..8ed2a966 --- /dev/null +++ b/aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml @@ -0,0 +1,36 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "dashboard.fullname" . }} + 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.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/ricplt/rtmgr/charts/rtmgr/values.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/values.yaml similarity index 82% rename from ricplt/rtmgr/charts/rtmgr/values.yaml rename to aux/80-Auxiliary-Functions/helm/dashboard/values.yaml index 8ce64ea7..13bc5cfc 100644 --- a/ricplt/rtmgr/charts/rtmgr/values.yaml +++ b/aux/80-Auxiliary-Functions/helm/dashboard/values.yaml @@ -15,22 +15,22 @@ # limitations under the License. # ################################################################################ -# Default values for rtmgr. +# Default values for dashboard. # This is a YAML-formatted file. # Declare variables to be passed into your templates. +replicaCount: 1 +repository: "nexus3.o-ran-sc.org:10004" +imagePullPolicy: IfNotPresent +repositoryCred: docker-reg-cred + + image: - repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" - repositoryCred: docker-reg-cred - name: rtmgr - tag: 0.0.2 - pullPolicy: IfNotPresent + repository: ric-dash-be + tag: 1.0.0-SNAPSHOT + service: - type: ClusterIP - nano: - port: 5656 - target_port: 4560 - protocol: "TCP" - name: "nano-port" + type: NodePort + port: 80 diff --git a/aux/portal-ric-dashboard/templates/NOTES.txt b/aux/portal-ric-dashboard/templates/NOTES.txt deleted file mode 100644 index 4f651a7a..00000000 --- a/aux/portal-ric-dashboard/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -# O-RAN SC Apache 2.0 -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range $.Values.ingress.paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "dashboard.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ include "dashboard.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "dashboard.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "dashboard.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/aux/portal-ric-dashboard/templates/ingress.yaml b/aux/portal-ric-dashboard/templates/ingress.yaml deleted file mode 100644 index bbdbe5bb..00000000 --- a/aux/portal-ric-dashboard/templates/ingress.yaml +++ /dev/null @@ -1,57 +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. # -################################################################################ - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "dashboard.fullname" . -}} -{{- $ingressPaths := .Values.ingress.paths -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - app.kubernetes.io/name: {{ include "dashboard.name" . }} - helm.sh/chart: {{ include "dashboard.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . | quote }} - http: - paths: - {{- range $ingressPaths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} - {{- end }} -{{- end }} diff --git a/aux/portal-ric-dashboard/templates/service.yaml b/aux/portal-ric-dashboard/templates/service.yaml deleted file mode 100644 index 6623a7a9..00000000 --- a/aux/portal-ric-dashboard/templates/service.yaml +++ /dev/null @@ -1,35 +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 "dashboard.fullname" . }} - labels: - app.kubernetes.io/name: {{ include "dashboard.name" . }} - helm.sh/chart: {{ include "dashboard.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - selector: - app.kubernetes.io/name: {{ include "dashboard.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/aux/portal-ric-dashboard/templates/tests/test-connection.yaml b/aux/portal-ric-dashboard/templates/tests/test-connection.yaml deleted file mode 100644 index 80491fd9..00000000 --- a/aux/portal-ric-dashboard/templates/tests/test-connection.yaml +++ /dev/null @@ -1,35 +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: Pod -metadata: - name: "{{ include "dashboard.fullname" . }}-test-connection" - labels: - app.kubernetes.io/name: {{ include "dashboard.name" . }} - helm.sh/chart: {{ include "dashboard.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "dashboard.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/aux/portal-ric-dashboard/values.yaml b/aux/portal-ric-dashboard/values.yaml deleted file mode 100644 index a1b74c2f..00000000 --- a/aux/portal-ric-dashboard/values.yaml +++ /dev/null @@ -1,66 +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. # -################################################################################ - -# Default values for dashboard. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nexus3.o-ran-sc.org:10004/ric-dash-be - tag: 1.0.1 - pullPolicy: IfNotPresent - -nameOverride: "" -fullnameOverride: "" - -service: - type: NodePort - port: 80 - -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - paths: [] - hosts: - - chart-example.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} - diff --git a/dep b/dep deleted file mode 160000 index 1a8a09de..00000000 --- a/dep +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1a8a09deaeded3c6a50fa7c13594e46301375874 diff --git a/ricplt/appmgr/charts/appmgr/Chart.yaml b/infra/00-Kubernetes/bin/install old mode 100644 new mode 100755 similarity index 92% rename from ricplt/appmgr/charts/appmgr/Chart.yaml rename to infra/00-Kubernetes/bin/install index f3e28a14..d351e927 --- a/ricplt/appmgr/charts/appmgr/Chart.yaml +++ b/infra/00-Kubernetes/bin/install @@ -1,3 +1,5 @@ +#!/bin/bash + ################################################################################ # Copyright (c) 2019 AT&T Intellectual Property. # # Copyright (c) 2019 Nokia. # @@ -15,8 +17,6 @@ # limitations under the License. # ################################################################################ -apiVersion: v1 -appVersion: "1.0" -description: Helm Chart for xAppManager -name: appmgr -version: 0.0.1 +# This is a temporary script that today deploy one node K8S cluster + +./install-1node-k8s diff --git a/setup-1node-k8s.sh b/infra/00-Kubernetes/bin/install-1node-k8s similarity index 90% rename from setup-1node-k8s.sh rename to infra/00-Kubernetes/bin/install-1node-k8s index aa5a8c64..8733c144 100755 --- a/setup-1node-k8s.sh +++ b/infra/00-Kubernetes/bin/install-1node-k8s @@ -34,6 +34,50 @@ set -x +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +source $DIR/../etc/k8s-1node + + +if [ -z "$__RUNRICENV_GERRIT_HOST__" ]; then + export __RUNRICENV_GERRIT_HOST__=$gerrithost +fi +if [ -z "$__RUNRICENV_GERRIT_IP__" ]; then + export __RUNRICENV_GERRIT_IP__=$gerritip +fi +if [ -z "$__RUNRICENV_DOCKER_HOST__" ]; then + export __RUNRICENV_DOCKER_HOST__=$dockerregistry +fi +if [ -z "$__RUNRICENV_DOCKER_IP__" ]; then + export __RUNRICENV_DOCKER_IP__=$dockerip +fi +if [ -z "$__RUNRICENV_DOCKER_PORT__" ]; then + export __RUNRICENV_DOCKER_PORT__=$dockerport +fi +if [ -z "$__RUNRICENV_DOCKER_USER__" ]; then + export __RUNRICENV_DOCKER_USER__=$dockeruser +fi +if [ -z "$__RUNRICENV_DOCKER_PASS__" ]; then + export __RUNRICENV_DOCKER_PASS__=$dockerpassword +fi +if [ -z "$__RUNRICENV_HELMREPO_HOST__" ]; then + export __RUNRICENV_HELMREPO_HOST__=$helmrepo +fi +if [ -z "$__RUNRICENV_HELMREPO_PORT__" ]; then + export __RUNRICENV_HELMREPO_PORT__=$helmport +fi +if [ -z "$__RUNRICENV_HELMREPO_IP__" ]; then + export __RUNRICENV_HELMREPO_IP__=$helmip +fi +if [ -z "$__RUNRICENV_HELMREPO_USER__" ]; then + export __RUNRICENV_HELMREPO_USER__=$helmuser +fi +if [ -z "$__RUNRICENV_HELMREPO_PASS__" ]; then + export __RUNRICENV_HELMREPO_PASS__=$helmpassword +fi + + + + # for RIC R0 we keep 1.13 export KUBEV="1.13.3" export KUBECNIV="0.6.0" diff --git a/ricplt/dbaas/charts/dbaas/values.yaml b/infra/00-Kubernetes/etc/k8s-1node similarity index 80% rename from ricplt/dbaas/charts/dbaas/values.yaml rename to infra/00-Kubernetes/etc/k8s-1node index b322d49a..716cb5bf 100644 --- a/ricplt/dbaas/charts/dbaas/values.yaml +++ b/infra/00-Kubernetes/etc/k8s-1node @@ -15,18 +15,20 @@ # limitations under the License. # ################################################################################ -image: - repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" - repositoryCred: docker-reg-cred +# customize the following repo info to local infrastructure +gerrithost=gerrit.o-ran-sc.org +gerritip=35.165.179.212 + +dockerregistry=nexus3.o-ran-sc.org +dockerip=38.108.68.158 +dockerport=10004 +dockeruser=docker +dockerpassword=docker + +helmrepo=helm.ricinfra.local +helmport=30000 +helmip='' +helmuser=helm +helmpassword=helm -backend: - terminationGracePeriodSeconds: 0 - replicas: 1 - name: "redis-standalone" - port: 6379 - targetPort: 6379 - image: - name: redis-standalone - tag: latest - imagePullPolicy: IfNotPresent diff --git a/infra/10-Nexus/bin/install b/infra/10-Nexus/bin/install new file mode 100755 index 00000000..18102f80 --- /dev/null +++ b/infra/10-Nexus/bin/install @@ -0,0 +1,122 @@ +#!/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. # +################################################################################ + +OVERRIDEYAML=$1 + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +source $DIR/../etc/nexus.conf + +if [ -z "$RICINFRA_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICINFRA_RELEASE_NAME +fi +if [ -z "$RICINFRA_NAMESPACE" ];then + NAMESPACE=$namespace +else + NAMESPACE=$RICINFRA_NAMESPACE +fi +if [ -z "$INGRESS_PORT" ];then + INGRESS_PORT_NEXUS=$ingress_port +else + INGRESS_PORT_NEXUS=$INGRESS_PORT +fi + + + +echo "Deploying nexus repo managers for local docker registry and helm repo." +echo "Name Space: $NAMESPACE" +echo "Helm Release: $RELEASE_NAME" + +HOSTPOSTFIX=$(cat $DIR/../charts/values.yaml | grep hostpostfix | awk '{print $2}') + + +echo "****************************************************************************************************************" +echo " WARNING " +echo "****************************************************************************************************************" + +echo "Nexus is deployed using default admin password. It is not for production deployment." +echo "If you want to secure the repositories, you should change the admin password immediately." +echo "You can access this nexus here: http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS" +echo "If nexus.$HOSTPOSTFIX is not resolved by your DNS server, please add an entry in your /etc/hosts file." +echo "****************************************************************************************************************" + +COMMON_CHART_VERSION=$(cat $DIR/../../50-RIC-Platform/charts/common/Chart.yaml | grep version | awk '{print $2}') +helm package -d /tmp $DIR/../../50-RIC-Platform/charts/common + +cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../charts/charts/ + +if [ -z $OVERRIDEYAML ]; then +helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../charts +else +helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../charts +fi + +NEXUS_POD_NAME=$(kubectl get pod -n $NAMESPACE | grep nexus | grep ContainerCreating | awk '{print $1}') + + + +echo "Waiting Nexus to be ready." +echo " " + +sleep 10 + +IS_NEXUS_READY=$(kubectl logs -n $NAMESPACE $NEXUS_POD_NAME | grep "Started Sonatype Nexus OSS") + +COUNTER=1 +while [[ -z $IS_NEXUS_READY ]]; do + echo -e "\033[2AWaiting Nexus to be ready." + echo -e "\033[2K" + PROGRESS=$(printf "%0.s-" $(seq 1 $COUNTER)) + echo -e "\033[1A$PROGRESS" + + + COUNTER=$((COUNTER+1)) + if [ $COUNTER -gt 5 ]; then + COUNTER=1 + fi + + IS_NEXUS_READY=$(kubectl logs -n $NAMESPACE $NEXUS_POD_NAME | grep "Started Sonatype Nexus OSS") + + sleep 5 +done + +echo $IS_NEXUS_READY + + +DOCKERPORT=$(cat $DIR/../charts/templates/deployment.yaml | awk '/.*- name: docker.*/{getline; print $2}') + + +DOCKERREPOSCRIPT="{\"name\":\"create_docker_repo\",\ + \"type\":\"groovy\",\ + \"content\":\"repository.createDockerHosted('docker.snapshot',\ + $DOCKERPORT, null, 'default', false, true)\"}" + +echo $DOCKERREPOSCRIPT + +# This line uses the default admin password +curl -u admin:admin123 -X POST -H "Content-Type: application/json" --data "$DOCKERREPOSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script + +curl -u admin:admin123 -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/create_docker_repo/run + + + + + + diff --git a/infra/10-Nexus/docker/Dockerfile b/infra/10-Nexus/docker/Dockerfile new file mode 100644 index 00000000..f61b21c0 --- /dev/null +++ b/infra/10-Nexus/docker/Dockerfile @@ -0,0 +1,45 @@ +ARG NEXUS_VERSION=3.15.2 +ARG NEXUS_BUILD=01 + +FROM maven:3-jdk-8-alpine AS aptbuild +#ARG NEXUS_VERSION=3.14.0 +#ARG NEXUS_BUILD=04 + +COPY ./nexus-repository-apt /nexus-repository-apt/ +#RUN cd /nexus-repository-apt/; sed -i "s/3.15.2-01/${NEXUS_VERSION}-${NEXUS_BUILD}/g" pom.xml; \ +# mvn; +RUN cd /nexus-repository-apt/; mvn; + + +FROM maven:3-jdk-8-alpine AS helmbuild +ARG NEXUS_VERSION=3.15.2 +ARG NEXUS_BUILD=01 + +COPY ./nexus-repository-helm /nexus-repository-helm/ +RUN cd /nexus-repository-helm/; sed -i "s/3.14.0-04/${NEXUS_VERSION}-${NEXUS_BUILD}/g" pom.xml; \ + mvn clean package; + + + + +FROM sonatype/nexus3:$NEXUS_VERSION +ARG NEXUS_VERSION=3.15.2 +ARG NEXUS_BUILD=01 +# Will not seem to work in sed without some magick +ARG APT_VERSION=1.0.10 +ARG COMP_VERSION=1.18 +#ARG COMP_VERSION=1.16.1 +ARG XZ_VERSION=1.8 +ARG APT_TARGET=/opt/sonatype/nexus/system/net/staticsnow/nexus-repository-apt/${APT_VERSION}/ +ARG HELM_VERSION=0.0.7 +ARG TARGET_DIR=/opt/sonatype/nexus/system/org/sonatype/nexus/plugins/nexus-repository-helm/${HELM_VERSION}/ +USER root +RUN mkdir -p ${APT_TARGET}; \ + sed -i "s@nexus-repository-maven@nexus-repository-maven\n nexus-repository-apt@g" /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml; \ + sed -i "s@\n
net.staticsnow:nexus-repository-apt
\n mvn:net.staticsnow/nexus-repository-apt/${APT_VERSION}\n mvn:org.apache.commons/commons-compress/${COMP_VERSION}\n mvn:org.tukaani/xz/${XZ_VERSION}\n
\n @nexus-repository-maven\n nexus-repository-helm@g' /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml; \ + sed -i 's@\n
org.sonatype.nexus.plugins:nexus-repository-helm
\n mvn:org.sonatype.nexus.plugins/nexus-repository-helm/0.0.7\n mvn:org.apache.commons/commons-compress/1.18\n
\n /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 +if [ -z "$RICPLT_NAMESPACE" ];then + NAMESPACE=$namespace +else + NAMESPACE=$RICPLT_NAMESPACE +fi + +if [ -z $OVERRIDEYAML ]; then + helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../charts +else + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../charts +fi diff --git a/ric-platform/20-Credential/etc/credential.conf b/ric-platform/20-Credential/etc/credential.conf new file mode 100644 index 00000000..fc9b7372 --- /dev/null +++ b/ric-platform/20-Credential/etc/credential.conf @@ -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. # +################################################################################ + + +# 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 + +# namespace defines the namespace that helm will use to deploy the credential +# It will be overrided by RICPLT_NAMESPACE +namespace=ricplt + diff --git a/ricplt/preric/Chart.yaml b/ric-platform/20-Credential/helm/Chart.yaml similarity index 97% rename from ricplt/preric/Chart.yaml rename to ric-platform/20-Credential/helm/Chart.yaml index 82c59cc3..69bdcc4c 100644 --- a/ricplt/preric/Chart.yaml +++ b/ric-platform/20-Credential/helm/Chart.yaml @@ -18,5 +18,5 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for setting up k8s resources for accessing external and infrastructure resources before RIC deployment" -name: preric -version: 0.1.0 +name: credential +version: 1.1.0 diff --git a/ric-platform/20-Credential/helm/resources/tls.crt b/ric-platform/20-Credential/helm/resources/tls.crt new file mode 100644 index 00000000..3060f345 --- /dev/null +++ b/ric-platform/20-Credential/helm/resources/tls.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDCTCCAfGgAwIBAgIBATANBgkqhkiG9w0BAQsFADAdMRswGQYDVQQDExJkb2Nr +ZXItcmVnaXN0cnktY2EwHhcNMTkwNTE1MTQ1NzQzWhcNMjAwNTE0MTQ1NzQzWjAQ +MQ4wDAYDVQQDEwVuZXh1czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AKNNbC8/cil64YXmPYpN7mRaT5biVsZrOrFkXfX2AXcJAsLUL7E4t7keK4Ba/VwO +pJKmgdjI4NxlTxe+zoOJVVz3+sMYz77UZTd1h/KDn1eBfozbqHcQ5lQksNDsL46d +yG/JfYpEEzRha/QxEEdaaQLWMyOcf/SjWnscqMQ2cGvTaEiO8F1re2qrwfnrbqQm +JYkIrmBbcGKMdg33edZpl3xbFc9eMfJGWuhaoC+Tk7Hj1EtV/O9KdPrvDYzO+h7P +HVExKXU04h1f9ThAoeU9/o7EN266iuUiCVE6M0zekYSV4BuAkXqbUtmpbnYziAYo +Cq2puiNUSirqXc6Bno12QykCAwEAAaNhMF8wDgYDVR0PAQH/BAQDAgWgMB0GA1Ud +JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMCAGA1UdEQQZ +MBeCFWRvY2tlci5yaWNpbmZyYS5sb2NhbDANBgkqhkiG9w0BAQsFAAOCAQEAg5aE +yicj1VnG4G3JeCszj2hFFmg2eTnwkPsIlpeIMJY8zI/IZ2aQP5e0KPAM8IaKMnqq +RPPusL2DF7Dl4A+ZBTkvfKtxIzwc7wnQGCfonMyM/MxyoBxXIJw+Qek42CpVbYYt +qVZ3fz6VpCvF/QL6eGmVpMlvLIu15C9pxzEHPcUKpkM1mvKLRcxn2tt5daqjh9ao +EvZHJt8kOh53c/FZHgA2+73I8Gx6BLUZPO0E+E1vC5K1FwtCl+Cmt6nX5jZEw1LK +eNcb3oZhXrVnUoQ72HTJEWuPjydB7w1hxnzB5RYGZalM7XwDmOHwdGHlNxpmMbJa +UZ4yL0N+nAUbLeUS2w== +-----END CERTIFICATE----- diff --git a/ricplt/preric/templates/_helper.tpl b/ric-platform/20-Credential/helm/templates/_helper.tpl similarity index 81% rename from ricplt/preric/templates/_helper.tpl rename to ric-platform/20-Credential/helm/templates/_helper.tpl index cba7024f..d009278a 100644 --- a/ricplt/preric/templates/_helper.tpl +++ b/ric-platform/20-Credential/helm/templates/_helper.tpl @@ -49,11 +49,7 @@ Create chart name and version as used by the chart label. {{- end -}} {{- define "repository" -}} - {{if .Values.repositoryOverride }} - {{- printf "%s" .Values.repositoryOverride -}} - {{else}} - {{- default .Values.repository .Values.global.repository -}} - {{end}} + {{- default "docker.ricinfra.local:80" .Values.repository -}} {{- end -}} {{/* @@ -66,21 +62,22 @@ Create chart name and version as used by the chart label. */}} {{- define "repository.secret" -}} {{- $repo := include "repository" . }} - {{- $repo := default "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" $repo }} - {{- $cred := .Values.global.repositoryCred }} + {{- $cred := .Values.repositoryCred }} + {{- $user := default "docker" $cred.user }} + {{- $password := default "docker" $cred.password }} {{- $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 -}} + {{- $auth := printf "%s:%s" $user $password | b64enc }} + {{- printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $user $password $mail $auth | b64enc -}} {{- end -}} {{- define "helmrepo.secret.user" -}} - {{- $user := default "${__RUNRICENV_HELMREPO_USER__}" .Values.global.helmrepoCred.user -}} + {{- $user := default "helm" .Values.helmrepoCred.user -}} {{- printf "%s" $user |b64enc }} {{- end -}} {{- define "helmrepo.secret.password" -}} - {{- $pass := default "${__RUNRICENV_HELMREPO_PASS__}" .Values.global.helmrepoCred.password -}} + {{- $pass := default "helm" .Values.helmrepoCred.password -}} {{- printf "%s" $pass |b64enc }} {{- end -}} diff --git a/ricplt/preric/templates/config-helm-cert.yaml b/ric-platform/20-Credential/helm/templates/config-helm-cert.yaml similarity index 95% rename from ricplt/preric/templates/config-helm-cert.yaml rename to ric-platform/20-Credential/helm/templates/config-helm-cert.yaml index e293cd6a..7140d6bf 100644 --- a/ricplt/preric/templates/config-helm-cert.yaml +++ b/ric-platform/20-Credential/helm/templates/config-helm-cert.yaml @@ -20,4 +20,5 @@ kind: ConfigMap metadata: name: xapp-mgr-certs data: - {{ (.Files.Glob "resources/helmrepo.crt").AsConfig | nindent 2 }} + {{ (.Files.Glob "resources/tls.crt").AsConfig | nindent 2 }} + diff --git a/ricplt/preric/templates/secrets-docker-reg.yaml b/ric-platform/20-Credential/helm/templates/secrets-docker-reg.yaml similarity index 100% rename from ricplt/preric/templates/secrets-docker-reg.yaml rename to ric-platform/20-Credential/helm/templates/secrets-docker-reg.yaml diff --git a/ricplt/preric/templates/secrets-helm-xapp.yaml b/ric-platform/20-Credential/helm/templates/secrets-helm-xapp.yaml similarity index 100% rename from ricplt/preric/templates/secrets-helm-xapp.yaml rename to ric-platform/20-Credential/helm/templates/secrets-helm-xapp.yaml diff --git a/ric-platform/20-Credential/helm/values.yaml b/ric-platform/20-Credential/helm/values.yaml new file mode 100644 index 00000000..16b9b57b --- /dev/null +++ b/ric-platform/20-Credential/helm/values.yaml @@ -0,0 +1,31 @@ +################################################################################ +# 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" +repositoryCred: + user: "docker" + password: "docker" + + +helmrepo: "https://helm.ricinfra.local" +helmrepoCred: + user: "helm" + password: "helm" diff --git a/localize.sh b/ric-platform/50-RIC-Platform/bin/install similarity index 54% rename from localize.sh rename to ric-platform/50-RIC-Platform/bin/install index 41b783a1..87040d79 100755 --- a/localize.sh +++ b/ric-platform/50-RIC-Platform/bin/install @@ -16,36 +16,45 @@ # limitations under the License. # ################################################################################ -source ./runric_env.sh -if [ -z $__RICENV_SET__ ]; then - echo "Edit your ric_env.sh for local infrastyructure values first" - exit + +OVERRIDEYAML=$1 + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/ric.conf + +if [ -z "$RICPLT_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICPLT_RELEASE_NAME +fi +if [ -z "$RICPLT_NAMESPACE" ];then + NAMESPACE=$namespace +else + NAMESPACE=$RICPLT_NAMESPACE fi -echo "Copy files to generated fir" -DIRS='kubernetes ricplt xapps' -rm -rf ./generated -mkdir -p generated -for d in $DIRS; do - cp -rf $d ./generated/ -done -echo "env substitude vars in .yaml and .sh files" -FILELIST=$(find . \( -name "*.sh" -o -name "*.yaml" \)) -for f in $FILELIST; do - echo "$f to ./generated/$f": - envsubst '${__RUNRICENV_GERRIT_HOST__} -${__RUNRICENV_GERRIT_IP__} -${__RUNRICENV_DOCKER_HOST__} -${__RUNRICENV_DOCKER_IP__} -${__RUNRICENV_DOCKER_PORT__} -${__RUNRICENV_DOCKER_USER__} -${__RUNRICENV_DOCKER_PASS__} -${__RUNRICENV_HELMREPO_HOST__} -${__RUNRICENV_HELMREPO_PORT__} -${__RUNRICENV_HELMREPO_IP__} -${__RUNRICENV_HELMREPO_USER__} -${__RUNRICENV_HELMREPO_PASS__} '< $f > "./generated/$f"; -done +RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term" + +echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]" +echo "Platform Namespace: $NAMESPACE" +echo "Helm Release Name: $RELEASE_NAME" + +COMMON_CHART_VERSION=$(cat $DIR/../charts/common/Chart.yaml | grep version | awk '{print $2}') +helm package -d /tmp $DIR/../charts/common + + +for component in $RICPLT_COMPONENTS; do + echo "Preparing chart for comonent $component" + cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../charts/$component/charts/ + if [ -z $OVERRIDEYAML ]; then + helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + else + helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component + fi +done diff --git a/ricplt/prepull.sh b/ric-platform/50-RIC-Platform/bin/uninstall similarity index 68% rename from ricplt/prepull.sh rename to ric-platform/50-RIC-Platform/bin/uninstall index 0f3c7d0b..b5937b1d 100755 --- a/ricplt/prepull.sh +++ b/ric-platform/50-RIC-Platform/bin/uninstall @@ -16,14 +16,35 @@ # limitations under the License. # ################################################################################ -# usage: echo "{{YOUR_DOCKER_PASSWORD}}" | sh ./prepull.sh -DOCKER_REGISTRY="${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" -IMAGE_LIST="xapp-manager:latest rtmgr:0.0.2 redis-standalone:latest e2mgr:1.0.0 e2:1.0.0" -docker login -u ${__RUNRICENV_DOCKER_USER__} --password-stdin ${DOCKER_REGISTRY} -for IMAGE in ${IMAGE_LIST}; do - docker pull ${DOCKER_REGISTRY}/${IMAGE} -done -docker logout ${DOCKER_REGISTRY} +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + + +source $DIR/../etc/ric.conf + +if [ -z "$RICPLT_RELEASE_NAME" ];then + RELEASE_NAME=$helm_release_name +else + RELEASE_NAME=$RICPLT_RELEASE_NAME +fi +if [ -z "$RICPLT_NAMESPACE" ];then + NAMESPACE=$namespace +else + NAMESPACE=$RICPLT_NAMESPACE +fi + + +RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term" + +echo "Undeploying RIC Platform components [$RICPLT_COMPONENTS]" +echo "Platform Namespace: $NAMESPACE" +echo "Helm Release Name: $RELEASE_NAME" + + + + +for component in $RICPLT_COMPONENTS; do + helm delete --purge "${RELEASE_NAME}-$component" +done diff --git a/ricplt/helm_reset.sh b/ric-platform/50-RIC-Platform/etc/ric.conf old mode 100755 new mode 100644 similarity index 82% rename from ricplt/helm_reset.sh rename to ric-platform/50-RIC-Platform/etc/ric.conf index c604c07f..29339d8b --- a/ricplt/helm_reset.sh +++ b/ric-platform/50-RIC-Platform/etc/ric.conf @@ -1,5 +1,3 @@ -#!/bin/bash - ################################################################################ # Copyright (c) 2019 AT&T Intellectual Property. # # Copyright (c) 2019 Nokia. # @@ -18,12 +16,12 @@ ################################################################################ -SERVEPID=$(ps aux |grep "helm[ +]serve" | sed 's/\s\s*/ /g' | cut -f2 -d ' ') -if [ ! -z $SERVEPID ]; then - echo "Stopping running helm serve process $SERVEPID" - kill -9 $SERVEPID -fi +# helm_release_name defines the release name helm will use to deploy RIC +# It will be overrided by RICPLT_RELEASE_NAME +helm_release_name=r0 + +# namespace defines the namespace that helm will use to deploy RIC +# It will be overrided by RICPLT_NAMESPACE +namespace=ricplt + -rm -rf ~/.helm -find . -name "common-*" | xargs rm -helm init --client-only diff --git a/aux/portal-ric-dashboard/.helmignore b/ric-platform/50-RIC-Platform/helm/appmgr/.helmignore similarity index 100% rename from aux/portal-ric-dashboard/.helmignore rename to ric-platform/50-RIC-Platform/helm/appmgr/.helmignore diff --git a/ricplt/appmgr/Chart.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/Chart.yaml similarity index 98% rename from ricplt/appmgr/Chart.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/Chart.yaml index f3e28a14..11c2f520 100644 --- a/ricplt/appmgr/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/Chart.yaml @@ -19,4 +19,4 @@ apiVersion: v1 appVersion: "1.0" description: Helm Chart for xAppManager name: appmgr -version: 0.0.1 +version: 1.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/charts/common-1.1.0.tgz b/ric-platform/50-RIC-Platform/helm/appmgr/charts/common-1.1.0.tgz new file mode 100644 index 00000000..994e516f Binary files /dev/null and b/ric-platform/50-RIC-Platform/helm/appmgr/charts/common-1.1.0.tgz differ diff --git a/ricplt/e2mgr/requirements.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/requirements.yaml similarity index 96% rename from ricplt/e2mgr/requirements.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/requirements.yaml index f18ffcaa..aa94575b 100644 --- a/ricplt/e2mgr/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/requirements.yaml @@ -17,5 +17,4 @@ dependencies: - name: common - version: ~1.0.0 - repository: '@local' + version: ~1.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/resources/xapp-manager.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/resources/xapp-manager.yaml new file mode 100644 index 00000000..179bb756 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/appmgr/resources/xapp-manager.yaml @@ -0,0 +1,14 @@ +"local": + # Port on which the xapp-manager REST services are provided + "host": __REST_PORT__ +"helm": + # Remote helm repo URL. UPDATE this as required. + "repo": __HELM_REPO__ + + # Repo name referred within the xapp-manager + "repo-name": __REPO_NAME__ + + # Tiller service details in the cluster. UPDATE this as required. + "tiller-service": __TILLER_SERVICE__ + "tiller-namespace": __TILLER_SERVICE__ + "tiller-port": __TILLER_PORT__ diff --git a/ricplt/appmgr/charts/appmgr/templates/_helpers.tpl b/ric-platform/50-RIC-Platform/helm/appmgr/templates/_helpers.tpl similarity index 100% rename from ricplt/appmgr/charts/appmgr/templates/_helpers.tpl rename to ric-platform/50-RIC-Platform/helm/appmgr/templates/_helpers.tpl diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml new file mode 100644 index 00000000..0985e505 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml @@ -0,0 +1,29 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "appmgr.fullname" . }}-appconfig +data: + {{- $restport := default ":8080" (printf ":%.0f" .Values.containerPort) | quote -}} + {{- $helmrepo := include "common.helmrepository" . | quote -}} + {{- $reponame := default "helm-repo" .Values.reponame | quote -}} + {{- $tiller := include "common.helmrepositorytiller" . | quote -}} + {{- $tillernamespace := include "common.helmrepositorytillernamespace" . | quote -}} + {{- $tillerport := include "common.helmrepositorytillerport" . | quote -}} + {{- (.Files.Glob "resources/xapp-manager.yaml").AsConfig | replace "__HELM_REPO__" $helmrepo | replace "__REST_PORT__" $restport | replace "__REPO_NAME__" $reponame | replace "__TILLER_SERVICE__" $tiller | replace "__TILLER_NAMESPACE__" $tillernamespace | replace "__TILLER_PORT__" $tillerport | nindent 2 }} diff --git a/ricplt/appmgr/charts/appmgr/templates/appenv.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml similarity index 100% rename from ricplt/appmgr/charts/appmgr/templates/appenv.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml diff --git a/ricplt/appmgr/charts/appmgr/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml similarity index 85% rename from ricplt/appmgr/charts/appmgr/templates/deployment.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml index ea189e68..52e53398 100644 --- a/ricplt/appmgr/charts/appmgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml @@ -39,21 +39,13 @@ spec: app: {{ include "common.namespace" . }}-{{ include "common.name" . }} release: {{ .Release.Name }} spec: - hostname: {{ include "common.namespace" . }}-{{ include "common.name" . }} + hostname: {{ .Chart.Name }} imagePullSecrets: - name: {{ .Values.image.repositoryCred }} - hostAliases: - # create a DNS name entry in container's /etc/hosts for resolving helm chart repo hostnaem - - ip: "${__RUNRICENV_DOCKER_IP__}" - hostnames: - - "${__RUNRICENV_DOCKER_HOST__}" - - ip: "${__RUNRICENV_HELMREPO_IP__}" - hostnames: - - "${__RUNRICENV_HELMREPO_HOST__}" containers: - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} - image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: {{ include "common.repository" . }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - name: http containerPort: {{ .Values.containerPort }} @@ -106,7 +98,7 @@ spec: name: {{ include "appmgr.fullname" . }}-appconfig - name: secret-volume secret: - secretName: {{ .Values.appsecretobject }} + secretName: {{ include "common.helmrepositorycred" . }} - name: cert-volume configMap: - name: {{ .Values.appcertobject }} + name: {{ include "common.helmrepositorycert" . }} diff --git a/ricplt/appmgr/charts/appmgr/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/service.yaml similarity index 100% rename from ricplt/appmgr/charts/appmgr/templates/service.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/templates/service.yaml diff --git a/ricplt/appmgr/charts/appmgr/values.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml similarity index 57% rename from ricplt/appmgr/charts/appmgr/values.yaml rename to ric-platform/50-RIC-Platform/helm/appmgr/values.yaml index 4428ef92..b3f0f57b 100644 --- a/ricplt/appmgr/charts/appmgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/values.yaml @@ -15,15 +15,24 @@ # limitations under the License. # ################################################################################ -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +repository: "nexus3.o-ran-sc.org:10004" +imagePullPolicy: IfNotPresent +repositoryCred: docker-reg-cred + + +# Uncomment the following line to override the docker registry +#repositoryOverride: "" + + +# Uncomment the following line to override the docker registry credential +#repositoryCredOverride: "" + +# Uncomment the following line to override the image pull policy +#imagePullPolicyOverride: "" + + -# Modify this section to point to Docker image repository image: - repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" - repositoryCred: "docker-reg-cred" - pullPolicy: IfNotPresent - # xAppmanager Docker image name and tag name: xapp-manager tag: latest @@ -32,6 +41,7 @@ image: replicaCount: 1 containerPort: 8080 +reponame: "helm-repo" service: type: NodePort @@ -45,24 +55,6 @@ service: # config # Path referred in xapp-manager for retrieving configuration details appconfigpath: /opt/ric/config -appconfig: - # To be present as files under appconfigpath - # Use your own environment addresses - xapp-manager.yaml: | - "local": - # Port on which the xapp-manager REST services are provided - "host": ":8080" - "helm": - # Remote helm repo URL. UPDATE this as required. - "repo": "https://${__RUNRICENV_HELMREPO_HOST__}:${__RUNRICENV_HELMREPO_PORT__}" - - # Repo name referred within the xapp-manager - "repo-name": "helm-repo" - - # Tiller service details in the cluster. UPDATE this as required. - "tiller-service": "tiller-deploy" - "tiller-namespace": "kube-system" - "tiller-port": "44134" # To be provided as env variables appenv: @@ -74,19 +66,45 @@ appenv: # Path referred in xapp-manager for retrieving helm repo secrets appsecretpath: /opt/ric/secret -# Secret object with credentials that should be created in K8S cluster. -# Parameters in this object are currently referred by xapp-manager to connect to helm repo and these are: -# helm_repo_username -# helm_repo_password -appsecretobject: xapp-mgr-creds # certificates # Path referred in xapp-manager for retrieving helm repo client certificates appcertpath: /opt/ric/certificates -# configMap object in K8S cluster that holds the client side certificates to connect to helm repo. -# Currently all certificates mounted by this object are copied to /etc/ssl/certs -appcertobject: xapp-mgr-certs + +# Helm Repo for xApp +# By default a local helm repo is used. The global setting will override +# the default value. You can further override using +#helmRepositoryOverride: "" +helmRepository: "snapshot.helm.local.ric.org" + +# Default secret name for Helm Repo credential. .Value.golbal.helmRepositoryCred will +# override the default value. You can further override uing +#helmRepositoryCredOverride:"" +helmRepositoryCred: xapp-mgr-creds + +# Default configmap name for Helm Repo cert. .Value.golbal.helmRepositoryCert will +# override the default value. You can further override uing +#helmRepositoryCertOverride:"" +helmRepositoryCert: xapp-mgr-cert + +# Helm Tiller for xApp +# The global setting will override this default value +# You can further override using helmRepositoryTillerOverride: "" +helmRepositoryTiller: "tiller-deploy" + +# Helm Tiller Namespace for xApp +# The global setting will override this default value +# You can further override using helmRepositoryTillerNamespaceOverride: "" +helmRepositoryTillerNamespace: "kube-system" + + +# Helm Tiller port for xApp +# The global setting will override this default value +# You can further override using helmRepositoryTillerPortOverride: "" +helmRepositoryTillerPort: "44134" + + resources: {} # limits: @@ -101,4 +119,3 @@ nodeSelector: {} tolerations: [] affinity: {} - diff --git a/ricplt/common/Chart.yaml b/ric-platform/50-RIC-Platform/helm/common/Chart.yaml similarity index 98% rename from ricplt/common/Chart.yaml rename to ric-platform/50-RIC-Platform/helm/common/Chart.yaml index 9963c884..b137e27a 100644 --- a/ricplt/common/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/common/Chart.yaml @@ -18,4 +18,4 @@ apiVersion: v1 description: Common templates for inclusion in other charts name: common -version: 1.0.0 +version: 1.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_helmrepo.tpl b/ric-platform/50-RIC-Platform/helm/common/templates/_helmrepo.tpl new file mode 100644 index 00000000..30846dc4 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/common/templates/_helmrepo.tpl @@ -0,0 +1,169 @@ +################################################################################ +# 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 the common helm repository. + The value for .Values.helmRepository is used by default, + unless either override mechanism is used. + + - .Values.global.helmRepository : override default helm repository for all components that use helm + - .Values.helmRepositoryOverride : override global and default helm repository on a per component base +*/}} +{{- define "common.helmrepository" -}} + {{- if .Values.helmRepositoryOverride -}} + {{- printf "%s" .Values.helmRepositoryOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.helmRepository -}} + {{- printf "%s" .Values.global.helmRepository -}} + {{- else -}} + {{- printf "%s" .Values.helmRepository -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.helmRepository -}} + {{- end -}} + {{- end -}} +{{- end -}} + + +{{/* + Resolve the helm repository secret token. + The secret token should be installed by K8S system admin. + The value for .Values.helmRepositoryCred is used by default, + unless either override mechanism is used. + + - .Values.global.helmRepositoryCred : override default helm repository credential + - .Values.helmRepositoryCredOverride : override global and default helm repository credential +*/}} +{{- define "common.helmrepositorycred" -}} + {{- if .Values.helmRepositoryCredOverride -}} + {{- printf "%s" .Values.helmRepositoryCredOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.helmRepositoryCred -}} + {{- printf "%s" .Values.global.helmRepositoryCred -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryCred -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryCred -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{/* + Resolve the helm repository certificate. + The certificate should be installed by K8S system admin. + The value for .Values.helmRepositoryCert is used by default, + unless either override mechanism is used. + + - .Values.global.helmrepositoryCert : override default helm repository certificate + - .Values.helmRepositoryCertOverride : override global and default helm repository certificate +*/}} +{{- define "common.helmrepositorycert" -}} + {{- if .Values.helmRepositoryCertOverride -}} + {{- printf "%s" .Values.helmRepositoryCertOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.helmRepositoryCert -}} + {{- printf "%s" .Values.global.helmRepositoryCert -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryCert -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryCert -}} + {{- end -}} + {{- end -}} +{{- end -}} + + +{{/* + Resolve the helm repository tiller service name. + The tiller should be installed by K8S system admin. + The value for .Values.helmRepositoryTiller is used by default, + unless either override mechanism is used. + + - .Values.global.helmrepositoryTiller : override default helm repository tiller + - .Values.helmRepositoryTillerOverride : override global and default helm repository tiller +*/}} +{{- define "common.helmrepositorytiller" -}} + {{- if .Values.helmRepositoryTillerOverride -}} + {{- printf "%s" .Values.helmRepositoryTillerOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.helmRepositoryTiller -}} + {{- printf "%s" .Values.global.helmRepositoryTiller -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryTiller -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryTiller -}} + {{- end -}} + {{- end -}} +{{- end -}} + + +{{/* + Resolve the helm repository tiller service namespace. + The tiller should be installed by K8S system admin. + The value for .Values.helmRepositoryTillerNamespace is used by default, + unless either override mechanism is used. + + - .Values.global.helmrepositoryTillerNamespace : override default helm repository tiller namespace + - .Values.helmRepositoryTillerNamespaceOverride : override global and default helm repository tiller namespace +*/}} +{{- define "common.helmrepositorytillernamespace" -}} + {{- if .Values.helmRepositoryTillerNamespaceOverride -}} + {{- printf "%s" .Values.helmRepositoryTillerNamespaceOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.helmRepositoryTillerNamespace -}} + {{- printf "%s" .Values.global.helmRepositoryTillerNamespace -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryTillerNamespace -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryTillerNamespace -}} + {{- end -}} + {{- end -}} +{{- end -}} + + +{{/* + Resolve the helm repository tiller service port. + The tiller should be installed by K8S system admin. + The value for .Values.helmRepositoryTillerPort is used by default, + unless either override mechanism is used. + + - .Values.global.helmrepositoryTillerPort : override default helm repository tiller port + - .Values.helmRepositoryTillerPortOverride : override global and default helm repository tiller port +*/}} +{{- define "common.helmrepositorytillerport" -}} + {{- if .Values.helmRepositoryTillerPortOverride -}} + {{- printf "%s" .Values.helmRepositoryTillerPortOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.helmRepositoryTillerPort -}} + {{- printf "%s" .Values.global.helmRepositoryTillerPort -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryTillerPort -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.helmRepositoryTillerPort -}} + {{- end -}} + {{- end -}} +{{- end -}} diff --git a/ricplt/common/templates/_name.tpl b/ric-platform/50-RIC-Platform/helm/common/templates/_name.tpl similarity index 100% rename from ricplt/common/templates/_name.tpl rename to ric-platform/50-RIC-Platform/helm/common/templates/_name.tpl diff --git a/ricplt/common/templates/_namespace.tpl b/ric-platform/50-RIC-Platform/helm/common/templates/_namespace.tpl similarity index 100% rename from ricplt/common/templates/_namespace.tpl rename to ric-platform/50-RIC-Platform/helm/common/templates/_namespace.tpl diff --git a/ric-platform/50-RIC-Platform/helm/common/templates/_repository.tpl b/ric-platform/50-RIC-Platform/helm/common/templates/_repository.tpl new file mode 100644 index 00000000..6058df41 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/common/templates/_repository.tpl @@ -0,0 +1,132 @@ +################################################################################ +# 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 the common image repository. + The value for .Values.repository is used by default, + unless either override mechanism is used. + + - .Values.global.repository : override default image repository for all images + - .Values.repositoryOverride : override global and default image repository on a per image basis +*/}} +{{- define "common.repository" -}} + {{- if .Values.repositoryOverride -}} + {{- printf "%s" .Values.repositoryOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.repository -}} + {{- printf "%s" .Values.global.repository -}} + {{- else -}} + {{- printf "%s" .Values.repository -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.repository -}} + {{- end -}} + {{- end -}} +{{- end -}} + + +{{/* + Resolve the docker image repository secret token configmap. + The secret token should be installed by K8S system admin. + The value for .Values.repositoryCred is used by default, + unless either override mechanism is used. + + - .Values.global.repositoryCred : override default docker registry credential + - .Values.repositoryCredOverride : override global and default docker registry credential +*/}} +{{- define "common.repositoryCred" -}} + {{- if .Values.repositoryCredOverride -}} + {{- printf "%s" .Values.repositoryCredOverride -}} + {{- 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 -}} +{{- end -}} + + +{{/* + Define the golbal image pull policy. + The value for .Values.imagePullPolicy is used by default, + unless either override mechanism is used. + + - .Values.global.imagePullPolicy : override default pull policy + - .Values.imagePullPolicyOverride : override global and default pull policy +*/}} +{{- define "common.pullPolicy" -}} + {{- if .Values.imagePullPolicyOverride -}} + {{- printf "%s" .Values.imagePullPolicyOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.imagePullPolicy -}} + {{- printf "%s" .Values.global.imagePullPolicy -}} + {{- else -}} + {{- printf "%s" .Values.imagePullPolicy -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.imagePullPolicy -}} + {{- end -}} + {{- end -}} +{{- end -}} + + +{{/* + Resolve the docker registry certificate name. + The value for .Values.repositoryCert is used by default, + unless either override mechanism is used. + + - .Values.global.repositoryCert : override default repository certificate + - .Values.repositoryCertOverride : override global and default repository certificate +*/}} +{{- define "common.repositorycert" -}} + {{- if .Values.repositoryCertOverride -}} + {{- printf "%s" .Values.repositoryCertOverride -}} + {{- else -}} + {{- if .Values.global -}} + {{- if .Values.global.repositoryCert -}} + {{- printf "%s" .Values.global.repositoryCert -}} + {{- else -}} + {{- printf "%s" .Values.repositoryCert -}} + {{- end -}} + {{- else -}} + {{- printf "%s" .Values.repositoryCert -}} + {{- end -}} + {{- end -}} +{{- end -}} + + + + + + +{{/* +Generate certificates for the docker registry +*/}} +{{- define "common.repository.gen-certs" -}} +{{- $altNames := list ( printf "docker.%s" .Values.ingress.hostpostfix ) -}} +{{- $ca := genCA "docker-registry-ca" 365 -}} +{{- $cert := genSignedCert ( include "nexus.name" . ) nil $altNames 365 $ca -}} +tls.crt: {{ $cert.Cert | b64enc }} +tls.key: {{ $cert.Key | b64enc }} +{{- end -}} diff --git a/ricplt/common/templates/_resources.tpl b/ric-platform/50-RIC-Platform/helm/common/templates/_resources.tpl similarity index 100% rename from ricplt/common/templates/_resources.tpl rename to ric-platform/50-RIC-Platform/helm/common/templates/_resources.tpl diff --git a/ricplt/common/templates/_service.tpl b/ric-platform/50-RIC-Platform/helm/common/templates/_service.tpl similarity index 100% rename from ricplt/common/templates/_service.tpl rename to ric-platform/50-RIC-Platform/helm/common/templates/_service.tpl diff --git a/ricplt/common/values.yaml b/ric-platform/50-RIC-Platform/helm/common/values.yaml similarity index 100% rename from ricplt/common/values.yaml rename to ric-platform/50-RIC-Platform/helm/common/values.yaml diff --git a/ricplt/dbaas/Chart.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/Chart.yaml similarity index 98% rename from ricplt/dbaas/Chart.yaml rename to ric-platform/50-RIC-Platform/helm/dbaas/Chart.yaml index 228bf8f0..861406df 100644 --- a/ricplt/dbaas/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/Chart.yaml @@ -19,4 +19,4 @@ apiVersion: v1 appVersion: "1.0" description: DBaaS realized with standalone, non-persistent, non-redundant Redis name: dbaas -version: 0.1.0 +version: 1.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/dbaas/charts/common-1.1.0.tgz b/ric-platform/50-RIC-Platform/helm/dbaas/charts/common-1.1.0.tgz new file mode 100644 index 00000000..994e516f Binary files /dev/null and b/ric-platform/50-RIC-Platform/helm/dbaas/charts/common-1.1.0.tgz differ diff --git a/ricplt/e2term/requirements.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/requirements.yaml similarity index 96% rename from ricplt/e2term/requirements.yaml rename to ric-platform/50-RIC-Platform/helm/dbaas/requirements.yaml index f18ffcaa..aa94575b 100644 --- a/ricplt/e2term/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/requirements.yaml @@ -17,5 +17,4 @@ dependencies: - name: common - version: ~1.0.0 - repository: '@local' + version: ~1.1.0 diff --git a/ricplt/dbaas/charts/dbaas/templates/_helper.tpl b/ric-platform/50-RIC-Platform/helm/dbaas/templates/_helper.tpl similarity index 100% rename from ricplt/dbaas/charts/dbaas/templates/_helper.tpl rename to ric-platform/50-RIC-Platform/helm/dbaas/templates/_helper.tpl diff --git a/ricplt/dbaas/charts/dbaas/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml similarity index 87% rename from ricplt/dbaas/charts/dbaas/templates/deployment.yaml rename to ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml index 9dd88de0..1589b24b 100644 --- a/ricplt/dbaas/charts/dbaas/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/templates/deployment.yaml @@ -38,12 +38,12 @@ spec: release: {{ .Release.Name }} spec: imagePullSecrets: - - name: {{ .Values.image.repositoryCred }} + - name: {{ include "common.repositoryCred" . }} terminationGracePeriodSeconds: {{ .Values.backend.terminationGracePeriodSeconds }} containers: - - image: {{ .Values.image.repository }}/{{ .Values.backend.image.name }}:{{ .Values.backend.image.tag }} - imagePullPolicy: {{ .Values.backend.image.imagePullPolicy }} + - image: {{ include "common.repository" . }}/{{ .Values.backend.image.name }}:{{ .Values.backend.image.tag }} + imagePullPolicy: {{ include "common.pullPolicy" . }} ports: - containerPort: {{ .Values.backend.targetPort }} - name: {{ .Values.backend.name }} + name: {{ include "common.namespace" . }}-{{ include "common.name" . }} restartPolicy: Always diff --git a/ricplt/dbaas/charts/dbaas/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml similarity index 100% rename from ricplt/dbaas/charts/dbaas/templates/service.yaml rename to ric-platform/50-RIC-Platform/helm/dbaas/templates/service.yaml diff --git a/ricplt/preric/values.yaml b/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml similarity index 69% rename from ricplt/preric/values.yaml rename to ric-platform/50-RIC-Platform/helm/dbaas/values.yaml index f5b77627..59481670 100644 --- a/ricplt/preric/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/dbaas/values.yaml @@ -15,20 +15,30 @@ # 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" +imagePullPolicy: IfNotPresent +repositoryCred: docker-reg-cred -global: - repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" - repositoryCred: - user: "${__RUNRICENV_DOCKER_USER__}" - password: "${__RUNRICENV_DOCKER_PASS__}" +# Uncomment the following line to override the docker registry +#repositoryOverride: "" - helmrepo: "https://${__RUNRICENV_HELMREPO_HOST__}:${__RUNRICENV_HELMREPO_PORT__}" - helmrepoCred: - user: "${__RUNRICENV_HELMREPO_USER__}" - password: "${__RUNRICENV_HELMREPO_PASS__}" - helmrepoCert: - +# Uncomment the following line to override the docker registry credential +#repositoryCredOverride: "" + +# Uncomment the following line to override the image pull policy +#imagePullPolicyOverride: "" + + + +nameOverride: "redis-standalone" + +backend: + terminationGracePeriodSeconds: 0 + replicas: 1 + port: 6379 + targetPort: 6379 + image: + name: redis-standalone + tag: latest diff --git a/ricplt/e2mgr/charts/e2mgr/Chart.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/Chart.yaml similarity index 98% rename from ricplt/e2mgr/charts/e2mgr/Chart.yaml rename to ric-platform/50-RIC-Platform/helm/e2mgr/Chart.yaml index 30569402..f33294a2 100644 --- a/ricplt/e2mgr/charts/e2mgr/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/Chart.yaml @@ -19,4 +19,4 @@ apiVersion: v1 description: Oran e2mgr Helm charts name: e2mgr -version: 1.0.0 +version: 1.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/charts/common-1.1.0.tgz b/ric-platform/50-RIC-Platform/helm/e2mgr/charts/common-1.1.0.tgz new file mode 100644 index 00000000..994e516f Binary files /dev/null and b/ric-platform/50-RIC-Platform/helm/e2mgr/charts/common-1.1.0.tgz differ diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/requirements.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/requirements.yaml new file mode 100644 index 00000000..aa94575b --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/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: common + version: ~1.1.0 diff --git a/ricplt/e2mgr/charts/e2mgr/templates/_helpers.tpl b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/_helpers.tpl similarity index 100% rename from ricplt/e2mgr/charts/e2mgr/templates/_helpers.tpl rename to ric-platform/50-RIC-Platform/helm/e2mgr/templates/_helpers.tpl diff --git a/ricplt/e2mgr/charts/e2mgr/templates/configmap.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml similarity index 100% rename from ricplt/e2mgr/charts/e2mgr/templates/configmap.yaml rename to ric-platform/50-RIC-Platform/helm/e2mgr/templates/configmap.yaml diff --git a/ricplt/e2mgr/charts/e2mgr/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml similarity index 92% rename from ricplt/e2mgr/charts/e2mgr/templates/deployment.yaml rename to ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml index 2c07d26b..b4561e83 100644 --- a/ricplt/e2mgr/charts/e2mgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/deployment.yaml @@ -39,11 +39,11 @@ spec: spec: hostname: {{ .Chart.Name }} imagePullSecrets: - - name: {{ .Values.image.repositoryCred }} + - name: {{ include "common.repositoryCred" . }} containers: - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} - image: {{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }} - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }} + image: {{ include "common.repository" . }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ include "common.pullPolicy" . }} volumeMounts: - mountPath: /opt/E2Manager/router.txt name: local-router-file diff --git a/ricplt/e2mgr/charts/e2mgr/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/service.yaml similarity index 100% rename from ricplt/e2mgr/charts/e2mgr/templates/service.yaml rename to ric-platform/50-RIC-Platform/helm/e2mgr/templates/service.yaml diff --git a/ricplt/e2mgr/charts/e2mgr/values.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml similarity index 81% rename from ricplt/e2mgr/charts/e2mgr/values.yaml rename to ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml index 830a5db8..a62acc92 100644 --- a/ricplt/e2mgr/charts/e2mgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/values.yaml @@ -20,12 +20,26 @@ ################################################################# # application image +repository: "nexus3.o-ran-sc.org:10004" +imagePullPolicy: IfNotPresent +repositoryCred: docker-reg-cred + + +# Uncomment the following line to override the docker registry +#repositoryOverride: "" + + +# Uncomment the following line to override the docker registry credential +#repositoryCredOverride: "" + +# Uncomment the following line to override the image pull policy +#imagePullPolicyOverride: "" + + + image: - repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" - repositoryCred: docker-reg-cred name: e2mgr tag: 1.0.0 - pullPolicy: IfNotPresent replicaCount: 1 diff --git a/ricplt/appmgr/.helmignore b/ric-platform/50-RIC-Platform/helm/e2term/.helmignore similarity index 100% rename from ricplt/appmgr/.helmignore rename to ric-platform/50-RIC-Platform/helm/e2term/.helmignore diff --git a/ricplt/e2term/charts/e2term/Chart.yaml b/ric-platform/50-RIC-Platform/helm/e2term/Chart.yaml similarity index 97% rename from ricplt/e2term/charts/e2term/Chart.yaml rename to ric-platform/50-RIC-Platform/helm/e2term/Chart.yaml index 72c044fb..8029c10c 100644 --- a/ricplt/e2term/charts/e2term/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/Chart.yaml @@ -16,6 +16,7 @@ ################################################################################ apiVersion: v1 +appVersion: "1.0" description: O-RAN RIC E2 Termination Helm charts name: e2term -version: 1.0.0 +version: 1.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/e2term/charts/common-1.1.0.tgz b/ric-platform/50-RIC-Platform/helm/e2term/charts/common-1.1.0.tgz new file mode 100644 index 00000000..994e516f Binary files /dev/null and b/ric-platform/50-RIC-Platform/helm/e2term/charts/common-1.1.0.tgz differ diff --git a/ric-platform/50-RIC-Platform/helm/e2term/requirements.yaml b/ric-platform/50-RIC-Platform/helm/e2term/requirements.yaml new file mode 100644 index 00000000..aa94575b --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/e2term/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: common + version: ~1.1.0 diff --git a/ricplt/e2term/charts/e2term/templates/_helpers.tpl b/ric-platform/50-RIC-Platform/helm/e2term/templates/_helpers.tpl similarity index 100% rename from ricplt/e2term/charts/e2term/templates/_helpers.tpl rename to ric-platform/50-RIC-Platform/helm/e2term/templates/_helpers.tpl diff --git a/ricplt/e2term/charts/e2term/templates/configmap.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml similarity index 100% rename from ricplt/e2term/charts/e2term/templates/configmap.yaml rename to ric-platform/50-RIC-Platform/helm/e2term/templates/configmap.yaml diff --git a/ricplt/e2term/charts/e2term/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml similarity index 92% rename from ricplt/e2term/charts/e2term/templates/deployment.yaml rename to ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml index e86f1b7a..bf048b55 100644 --- a/ricplt/e2term/charts/e2term/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/templates/deployment.yaml @@ -39,11 +39,11 @@ spec: spec: hostname: {{ .Chart.Name }} imagePullSecrets: - - name: {{ .Values.image.repositoryCred }} + - name: {{ include "common.repositoryCred" . }} containers: - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }} + image: {{ include "common.repository" . }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ include "common.pullPolicy" . }} volumeMounts: - mountPath: /opt/e2/router.txt name: local-router-file diff --git a/ricplt/e2term/charts/e2term/templates/service.yaml b/ric-platform/50-RIC-Platform/helm/e2term/templates/service.yaml similarity index 100% rename from ricplt/e2term/charts/e2term/templates/service.yaml rename to ric-platform/50-RIC-Platform/helm/e2term/templates/service.yaml diff --git a/ricplt/e2term/charts/e2term/values.yaml b/ric-platform/50-RIC-Platform/helm/e2term/values.yaml similarity index 81% rename from ricplt/e2term/charts/e2term/values.yaml rename to ric-platform/50-RIC-Platform/helm/e2term/values.yaml index 88d33c83..fdb232c3 100644 --- a/ricplt/e2term/charts/e2term/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2term/values.yaml @@ -18,14 +18,25 @@ ################################################################# # Application configuration defaults. ################################################################# -# application image +repository: "nexus3.o-ran-sc.org:10004" +imagePullPolicy: IfNotPresent +repositoryCred: docker-reg-cred + + +# Uncomment the following line to override the docker registry +#repositoryOverride: "" + + +# Uncomment the following line to override the docker registry credential +#repositoryCredOverride: "" + +# Uncomment the following line to override the image pull policy +#imagePullPolicyOverride: "" + image: - repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" - repositoryCred: docker-reg-cred name: e2 tag: 1.0.0 - pullPolicy: IfNotPresent replicaCount: 1 diff --git a/ricplt/e2term/.helmignore b/ric-platform/50-RIC-Platform/helm/ric/.helmignore similarity index 100% rename from ricplt/e2term/.helmignore rename to ric-platform/50-RIC-Platform/helm/ric/.helmignore diff --git a/ricplt/ric/Chart.yaml b/ric-platform/50-RIC-Platform/helm/ric/Chart.yaml similarity index 98% rename from ricplt/ric/Chart.yaml rename to ric-platform/50-RIC-Platform/helm/ric/Chart.yaml index 12b7df9e..103c34f5 100644 --- a/ricplt/ric/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/ric/Chart.yaml @@ -19,4 +19,4 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for full RIC deployment name: ric -version: 0.1.0 +version: 1.1.0 diff --git a/ricplt/ric/requirements.yaml b/ric-platform/50-RIC-Platform/helm/ric/requirements.yaml similarity index 87% rename from ricplt/ric/requirements.yaml rename to ric-platform/50-RIC-Platform/helm/ric/requirements.yaml index 84ceec62..c9f0c246 100644 --- a/ricplt/ric/requirements.yaml +++ b/ric-platform/50-RIC-Platform/helm/ric/requirements.yaml @@ -17,22 +17,17 @@ dependencies: - name: e2mgr - version: 1.0.0 - repository: '@local' + version: 1.1.0 condition: e2mgr.enabled - name: rtmgr - version: 0.1.0 - repository: '@local' + version: 1.1.0 condition: rtmgr.enabled - name: e2term - version: 1.0.0 - repository: '@local' + version: 1.1.0 condition: e2term.enabled - name: appmgr - version: 0.0.1 - repository: '@local' + version: 1.1.0 condition: appmgr.enabled - name: dbaas - version: 0.1.0 - repository: '@local' + version: 1.1.0 condition: dbaas.enabled diff --git a/ricplt/ric/values.yaml b/ric-platform/50-RIC-Platform/helm/ric/values.yaml similarity index 92% rename from ricplt/ric/values.yaml rename to ric-platform/50-RIC-Platform/helm/ric/values.yaml index aefe36f6..aea172ef 100644 --- a/ricplt/ric/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/ric/values.yaml @@ -20,17 +20,9 @@ dbaas: enabled: true e2mgr: enabled: true - e2mgr: - service: - http: - extport: 30080 rtmgr: enabled: true e2term: enabled: true appmgr: enabled: true - appmgr: - service: - appmgr: - extport: 30070 diff --git a/ricplt/preric/.helmignore b/ric-platform/50-RIC-Platform/helm/rtmgr/.helmignore similarity index 100% rename from ricplt/preric/.helmignore rename to ric-platform/50-RIC-Platform/helm/rtmgr/.helmignore diff --git a/ricplt/rtmgr/Chart.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/Chart.yaml similarity index 98% rename from ricplt/rtmgr/Chart.yaml rename to ric-platform/50-RIC-Platform/helm/rtmgr/Chart.yaml index 70ed31ce..49b8e01e 100644 --- a/ricplt/rtmgr/Chart.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/Chart.yaml @@ -19,4 +19,4 @@ apiVersion: v1 appVersion: "1.0" description: Helm chart for RIC Routing Manager name: rtmgr -version: 0.1.0 +version: 1.1.0 diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/charts/common-1.1.0.tgz b/ric-platform/50-RIC-Platform/helm/rtmgr/charts/common-1.1.0.tgz new file mode 100644 index 00000000..994e516f Binary files /dev/null and b/ric-platform/50-RIC-Platform/helm/rtmgr/charts/common-1.1.0.tgz differ diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/requirements.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/requirements.yaml new file mode 100644 index 00000000..aa94575b --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/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: common + version: ~1.1.0 diff --git a/ricplt/rtmgr/charts/rtmgr/templates/_helper.tpl b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/_helper.tpl similarity index 100% rename from ricplt/rtmgr/charts/rtmgr/templates/_helper.tpl rename to ric-platform/50-RIC-Platform/helm/rtmgr/templates/_helper.tpl diff --git a/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-dep.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/rtmgr-dep.yaml similarity index 89% rename from ricplt/rtmgr/charts/rtmgr/templates/rtmgr-dep.yaml rename to ric-platform/50-RIC-Platform/helm/rtmgr/templates/rtmgr-dep.yaml index 514972a1..a55b178c 100644 --- a/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-dep.yaml +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/rtmgr-dep.yaml @@ -39,11 +39,11 @@ spec: spec: hostname: {{ .Chart.Name }} imagePullSecrets: - - name: {{ .Values.image.repositoryCred }} + - name: {{ include "common.repositoryCred" . }} containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }} + - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + image: {{ include "common.repository" . }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ include "common.pullPolicy" . }} command: ["/run_rtmgr.sh"] env: - name: XMURL diff --git a/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-svc.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/templates/rtmgr-svc.yaml similarity index 100% rename from ricplt/rtmgr/charts/rtmgr/templates/rtmgr-svc.yaml rename to ric-platform/50-RIC-Platform/helm/rtmgr/templates/rtmgr-svc.yaml diff --git a/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml b/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml new file mode 100644 index 00000000..8300f8d1 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/rtmgr/values.yaml @@ -0,0 +1,49 @@ +################################################################################ +# 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. # +################################################################################ + +# Default values for rtmgr. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +repository: "nexus3.o-ran-sc.org:10004" +imagePullPolicy: IfNotPresent +repositoryCred: docker-reg-cred + + +# Uncomment the following line to override the docker registry +#repositoryOverride: "" + + +# Uncomment the following line to override the docker registry credential +#repositoryCredOverride: "" + +# Uncomment the following line to override the image pull policy +#imagePullPolicyOverride: "" + + +image: + name: rtmgr + tag: 0.0.2 + +service: + type: ClusterIP + nano: + port: 5656 + target_port: 4560 + protocol: "TCP" + name: "nano-port" + diff --git a/ricplt/README.md b/ricplt/README.md deleted file mode 100644 index fa3f4368..00000000 --- a/ricplt/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# RIC Platform Installation -### Directory Structure -- appmgr: xApp Manager Helm Chart -- common: Common Helm Chart -- dbaas: Database as a Service Helm Chart -- dist: local helm chart repo store -- e2mgr: E2 Termination Manager Helm Chart -- e2term: E2 Termination Helm Chart -- helm\_reset.sh: script for reseting local helm repo -- prepull.sh: scriptr for pre-pulling all RIC platform component docker images -- preric: Pre-RIC Helmn Chart (for setting infrastructure resources such as docker registry credential) -- ric: RIC Helm Chart -- ric\_env.sh: script for setting up various env varibles needed for RIC -- ric\_install.sh: RIC "one-click" installation script -- ric\_uninstall.sh: RIC uninstallation -- rtmgr: Routing Manager Helm Chart - -### To Install RIC Platform Deployment -```sh -$ # set environment variables -$ . ./ric_env.sh -$ # reset helm and local chart repo -$ ./helm_reset.sh -$ # install RIC platform -$ ./ric_install.sh -``` - -### To Unnstall RIC Platform Deployment -```sh -$ # uninstall RIC platform -$ ./ric_uninstall.sh -``` - diff --git a/ricplt/appmgr/values.yaml b/ricplt/appmgr/values.yaml deleted file mode 100644 index a2b7c0ef..00000000 --- a/ricplt/appmgr/values.yaml +++ /dev/null @@ -1,17 +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. # -################################################################################ - diff --git a/ricplt/common/templates/_repository.tpl b/ricplt/common/templates/_repository.tpl deleted file mode 100644 index a2f7e905..00000000 --- a/ricplt/common/templates/_repository.tpl +++ /dev/null @@ -1,50 +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 name of the common image repository. - The value for .Values.repository is used by default, - unless either override mechanism is used. - - - .Values.global.repository : override default image repository for all images - - .Values.repositoryOverride : override global and default image repository on a per image basis -*/}} -{{- define "common.repository" -}} - {{if .Values.repositoryOverride }} - {{- printf "%s" .Values.repositoryOverride -}} - {{else}} - {{- default .Values.repository .Values.global.repository -}} - {{end}} -{{- end -}} - - -{{/* - Resolve the image repository secret token. - The value for .Values.global.repositoryCred is used: - repositoryCred: - user: user - password: password - mail: email (optional) -*/}} -{{- define "common.repository.secret" -}} - {{- $repo := include "common.repository" . }} - {{- $repo := default "nexus3.onap.org:10001" $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 -}} -{{- end -}} diff --git a/ricplt/dbaas/charts/dbaas/Chart.yaml b/ricplt/dbaas/charts/dbaas/Chart.yaml deleted file mode 100644 index 228bf8f0..00000000 --- a/ricplt/dbaas/charts/dbaas/Chart.yaml +++ /dev/null @@ -1,22 +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 -appVersion: "1.0" -description: DBaaS realized with standalone, non-persistent, non-redundant Redis -name: dbaas -version: 0.1.0 diff --git a/ricplt/dbaas/values.yaml b/ricplt/dbaas/values.yaml deleted file mode 100644 index a2b7c0ef..00000000 --- a/ricplt/dbaas/values.yaml +++ /dev/null @@ -1,17 +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. # -################################################################################ - diff --git a/ricplt/e2mgr/Chart.yaml b/ricplt/e2mgr/Chart.yaml deleted file mode 100644 index 26e79d46..00000000 --- a/ricplt/e2mgr/Chart.yaml +++ /dev/null @@ -1,21 +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 -description: O-RAN E2 Manager Helm charts -name: e2mgr -version: 1.0.0 diff --git a/ricplt/e2mgr/charts/e2mgr/.helmignore b/ricplt/e2mgr/charts/e2mgr/.helmignore deleted file mode 100644 index ec17c386..00000000 --- a/ricplt/e2mgr/charts/e2mgr/.helmignore +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################## -# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. # -# # -# 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. # -############################################################################## - -# 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 diff --git a/ricplt/e2mgr/values.yaml b/ricplt/e2mgr/values.yaml deleted file mode 100644 index 60054e76..00000000 --- a/ricplt/e2mgr/values.yaml +++ /dev/null @@ -1,16 +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. # -################################################################################ diff --git a/ricplt/e2term/charts/e2term/.helmignore b/ricplt/e2term/charts/e2term/.helmignore deleted file mode 100644 index ec17c386..00000000 --- a/ricplt/e2term/charts/e2term/.helmignore +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################## -# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. # -# # -# 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. # -############################################################################## - -# 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 diff --git a/ricplt/e2term/values.yaml b/ricplt/e2term/values.yaml deleted file mode 100644 index 60054e76..00000000 --- a/ricplt/e2term/values.yaml +++ /dev/null @@ -1,16 +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. # -################################################################################ diff --git a/ricplt/preric/resources/helmrepo.crt b/ricplt/preric/resources/helmrepo.crt deleted file mode 100644 index 4ee7d62b..00000000 --- a/ricplt/preric/resources/helmrepo.crt +++ /dev/null @@ -1,25 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIESjCCAzKgAwIBAgIJAIU+AfULkw0PMA0GCSqGSIb3DQEBCwUAMIG5MQswCQYD -VQQGEwJVUzETMBEGA1UECAwKTmV3IEplcnNleTETMBEGA1UEBwwKQmVkbWluc3Rl -cjENMAsGA1UECgwEQVQmVDERMA8GA1UECwwIUmVzZWFyY2gxOTA3BgNVBAMMMCou -aGVsbS5yYW5jby1kZXYtdG9vbHMuZWFzdHVzLmNsb3VkYXBwLmF6dXJlLmNvbTEj -MCEGCSqGSIb3DQEJARYUcmljQHJlc2VhcmNoLmF0dC5jb20wHhcNMTkwMzIxMTU1 -MzAwWhcNMjEwMzIwMTU1MzAwWjCBuTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCk5l -dyBKZXJzZXkxEzARBgNVBAcMCkJlZG1pbnN0ZXIxDTALBgNVBAoMBEFUJlQxETAP -BgNVBAsMCFJlc2VhcmNoMTkwNwYDVQQDDDAqLmhlbG0ucmFuY28tZGV2LXRvb2xz -LmVhc3R1cy5jbG91ZGFwcC5henVyZS5jb20xIzAhBgkqhkiG9w0BCQEWFHJpY0By -ZXNlYXJjaC5hdHQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -tguhSQx5Dk2w+qx2AOcFRz7IZBASEehK1Z4f5jz2KrRylGx6jjedCZASdm1b0ZEB -/ZNrKht1zsWDETa7x0DF+q0Z2blff+T+6+YrJWhNxYHgZiYVi9gTuNDzpn8VVn7f -+cQxcMguHo1JBDIotOLubJ4T3/oXMCPv9kRSLHcNjbEE2yTB3AqXu9dvrDXuUdeU -ot6RzxhKXxRCQXPS2/FDjSV9vr9h1dv5fIkFXihpYaag0XqvXcqgncvcOJ1SsLc3 -DK+tyNknqG5SL8y2a7U4F7u+qGO2/3tnCO0ggYwa73hS0pQPY51EpRSckZqlfKEu -Ut0s3wlEFP1VaU0RfU3aIwIDAQABo1MwUTAdBgNVHQ4EFgQUYTpoVXZPXSR/rhjr -pu9PPhL7f9IwHwYDVR0jBBgwFoAUYTpoVXZPXSR/rhjrpu9PPhL7f9IwDwYDVR0T -AQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAUDLbiKVIW6W9qFXLtoyO7S2e -IOUSZ1F70pkfeYUqegsfFZ9njPtPqTzDfJVxYqH2V0vxxoAxXCYCpNyR6vYlYiEL -R+oyxuvauW/yCoiwKBPYa4fD/PBajJnEO1EfIwZvjFLIfw4GjaX59+zDS3Zl0jT/ -w3uhPSsJAYXtDKLZ14btA27cM5mW4kmxVD8CRdUW0jr/cN3Hqe9uLSNWCNiDwma7 -RnpK7NnOgXHyhZD/nVC0nY7OzbK7VHFJatSOjyuMxgWsFGahwYNxf3AWfPwUai0K -ne/fVFGZ6ifR9QdD0SuKIAEuqSyyP4BsQ92uEweU/gWKsnM6iNVmNFX8UOuU9A== ------END CERTIFICATE----- diff --git a/ricplt/ric_env.sh b/ricplt/ric_env.sh deleted file mode 100644 index 9dc70aba..00000000 --- a/ricplt/ric_env.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -################################################################################ -# Copyright (c) 2019 AT&T Intellectual Property. # -# Copyright (c) 2019 Nokia. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - - -export RICPLT_RELEASE_NAME='ric-full' -export RICPLT_NAMESPACE='ricplatform' -export RICXAPP_NAMESPACE='ricxapp' -export RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term" -export RICPLT_APPMGR_EXT_PORT="30099" -export RICPLT_E2MGR_EXT_PORT="30199" diff --git a/ricplt/ric_install.sh b/ricplt/ric_install.sh deleted file mode 100755 index 863d30d7..00000000 --- a/ricplt/ric_install.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -################################################################################ -# Copyright (c) 2019 AT&T Intellectual Property. # -# Copyright (c) 2019 Nokia. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - - -if [ -z "$RICPLT_RELEASE_NAME" ] || \ - [ -z "$RICPLT_COMPONENTS" ] || \ - [ -z "$RICPLT_NAMESPACE" ] || \ - [ -z "$RICPLT_APPMGR_EXT_PORT" ] || \ - [ -z "$RICPLT_E2MGR_EXT_PORT" ]; then - echo "RICPLT_RELEASE_NAME or RICPLT_COMPONENTS or RICPLT_NAMESPACE or " - echo "RICPLT_APPMGR_EXT_PORT or RICPLT_E2MGR_EXT_PORT unset, loading " - echo "values from ric_env.sh" - . ./ric_env.sh -fi - - -RICPLT_DEPLOYMENT="$RICPLT_RELEASE_NAME" -echo "Deplot RIC Platform components [$RICPLT_COMPONENTS] to" -echo "name space: $RICPLT_NAMESPACE, Helm release: $RICPLT_DEPLOYMENT" - - -rm -rf dist -mkdir -p dist/packages - -helm serve --repo-path dist/packages & - -sleep 1 - -helm repo add local http://127.0.0.1:8879 - -helm repo update -helm package -d dist/packages common -helm repo index dist/packages - - -for c in common preric $RICPLT_COMPONENTS ric; do - echo "Preparing chart for comonent $c" - helm repo update - if [ -e "$c/requirements.yaml" ]; then - helm dep up "$c" - fi - helm package -d dist/packages "$c" - helm repo index dist/packages - echo -done - -helm repo update -helm install local/preric --namespace "${RICPLT_NAMESPACE}" --name pre-"${RICPLT_RELEASE_NAME}" - -helm repo update -helm install local/ric --namespace "${RICPLT_NAMESPACE}" --name "${RICPLT_RELEASE_NAME}" --set appmgr.appmgr.service.appmgr.extport="${RICPLT_APPMGR_EXT_PORT}" --set e2mgr.e2mgr.service.http.extport="${RICPLT_E2MGR_EXT_PORT}" - - diff --git a/ricplt/ric_uninstall.sh b/ricplt/ric_uninstall.sh deleted file mode 100755 index 4b7ac42f..00000000 --- a/ricplt/ric_uninstall.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -################################################################################ -# Copyright (c) 2019 AT&T Intellectual Property. # -# Copyright (c) 2019 Nokia. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -if [ -z "$RICPLT_RELEASE_NAME" ] || [ -z "$RICPLT_COMPONENTS" ] || [ -z "$RICPLT_NAMESPACE" ]; then - echo "RICPLT_RELEASE_NAME or RICPLT_COMPONENTS or RICPLT_NAMESPACE unset, loading from ric_env.sh" - . ./ric_env.sh -fi - -RICPLT_DEPLOYMENT="$RICPLT_RELEASE_NAME" - -echo "Uninstall RIC Platform components $RICPLT_COMPONENTS" -echo "name space: $RICPLT_NAMESPACE, Helm release: $RICPLT_DEPLOYMENT" - -echo "Removing Helm deploymentsi ..." -helm delete --purge "${RICPLT_RELEASE_NAME}" -helm delete --purge pre-"${RICPLT_RELEASE_NAME}" -find . -name "common-*" | xargs rm -rm -rf ./ric/charts/* -echo "Done" - -#echo "Removing RIC resources from Kubernetes ..." -#RES=$(kubectl get pods -n "$RICPLT_NAMESPACE" |grep -v "tiller" |grep -v "RESTARTS" |grep -v "robot") -#while [ ! -z "$RES" ]; do -# NUMPODS=$(echo "$RES" | wc -l) -# echo "$(( NUMPODS - 1 )) pod(s) left, check again in 5 seconds ..." -# sleep 5 -# RES=$(kubectl get pods -n "$RICPLT_NAMESPACE" |grep -v "tiller" |grep -v "RESTARTS" |grep -v "robot") -#done -#echo "All RIC resources are gone." -#./helm_reset.sh - -echo "It may take Kubernetes some time to release all resources created" -echo "for RIC Platform. Use \"kubectl get pods -n ricplatform\" to check." -echo "To truely clean up the helm state, run the following command:" -echo " ./helm_reset.sh" -echo "Done" diff --git a/ricplt/rtmgr/.helmignore b/ricplt/rtmgr/.helmignore deleted file mode 100644 index 50af0317..00000000 --- a/ricplt/rtmgr/.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/ricplt/rtmgr/charts/rtmgr/Chart.yaml b/ricplt/rtmgr/charts/rtmgr/Chart.yaml deleted file mode 100644 index 70ed31ce..00000000 --- a/ricplt/rtmgr/charts/rtmgr/Chart.yaml +++ /dev/null @@ -1,22 +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 -appVersion: "1.0" -description: Helm chart for RIC Routing Manager -name: rtmgr -version: 0.1.0 diff --git a/ricplt/rtmgr/requirements.yaml b/ricplt/rtmgr/requirements.yaml deleted file mode 100644 index f18ffcaa..00000000 --- a/ricplt/rtmgr/requirements.yaml +++ /dev/null @@ -1,21 +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: common - version: ~1.0.0 - repository: '@local' diff --git a/ricplt/rtmgr/values.yaml b/ricplt/rtmgr/values.yaml deleted file mode 100644 index 60054e76..00000000 --- a/ricplt/rtmgr/values.yaml +++ /dev/null @@ -1,16 +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. # -################################################################################ diff --git a/xapp-std/.helmignore b/xapp-std/.helmignore deleted file mode 100644 index 50af0317..00000000 --- a/xapp-std/.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/xapp-admin/Chart.yaml b/xapps/90-xApps/helm/xapp-admin/Chart.yaml similarity index 100% rename from xapp-admin/Chart.yaml rename to xapps/90-xApps/helm/xapp-admin/Chart.yaml diff --git a/xapp-admin/values.yaml b/xapps/90-xApps/helm/xapp-admin/values.yaml similarity index 100% rename from xapp-admin/values.yaml rename to xapps/90-xApps/helm/xapp-admin/values.yaml diff --git a/ricplt/ric/.helmignore b/xapps/90-xApps/helm/xapp-std/.helmignore similarity index 100% rename from ricplt/ric/.helmignore rename to xapps/90-xApps/helm/xapp-std/.helmignore diff --git a/xapp-std/Chart.yaml b/xapps/90-xApps/helm/xapp-std/Chart.yaml similarity index 100% rename from xapp-std/Chart.yaml rename to xapps/90-xApps/helm/xapp-std/Chart.yaml diff --git a/xapp-std/templates/_helpers.tpl b/xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl similarity index 100% rename from xapp-std/templates/_helpers.tpl rename to xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl diff --git a/xapp-std/templates/appconfig.yaml b/xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml similarity index 100% rename from xapp-std/templates/appconfig.yaml rename to xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml diff --git a/xapp-std/templates/appenv.yaml b/xapps/90-xApps/helm/xapp-std/templates/appenv.yaml similarity index 100% rename from xapp-std/templates/appenv.yaml rename to xapps/90-xApps/helm/xapp-std/templates/appenv.yaml diff --git a/xapp-std/templates/appsecret.yaml b/xapps/90-xApps/helm/xapp-std/templates/appsecret.yaml similarity index 100% rename from xapp-std/templates/appsecret.yaml rename to xapps/90-xApps/helm/xapp-std/templates/appsecret.yaml diff --git a/xapp-std/templates/deployment.yaml b/xapps/90-xApps/helm/xapp-std/templates/deployment.yaml similarity index 100% rename from xapp-std/templates/deployment.yaml rename to xapps/90-xApps/helm/xapp-std/templates/deployment.yaml diff --git a/xapp-std/templates/secret.yaml b/xapps/90-xApps/helm/xapp-std/templates/secret.yaml similarity index 100% rename from xapp-std/templates/secret.yaml rename to xapps/90-xApps/helm/xapp-std/templates/secret.yaml diff --git a/xapp-std/templates/service.yaml b/xapps/90-xApps/helm/xapp-std/templates/service.yaml similarity index 100% rename from xapp-std/templates/service.yaml rename to xapps/90-xApps/helm/xapp-std/templates/service.yaml diff --git a/xapp-std/values.yaml b/xapps/90-xApps/helm/xapp-std/values.yaml similarity index 100% rename from xapp-std/values.yaml rename to xapps/90-xApps/helm/xapp-std/values.yaml