nohup helm serve >& /dev/null &
fi
-# Package nonrtric-common and serve it using Helm local repo
-HELM_HOME=$(helm home)
-COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common/Chart.yaml | grep version | awk '{print $2}')
-helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common
-cp /tmp/nonrtric-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
+$ROOT_DIR/prepare-common-templates
COMPONENTS=${LIST_OF_COMPONENTS:-"controlpanel a1controller a1simulator policymanagementservice"}
echo "Packaging NONRTRIC components [$COMPONENTS]"
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-# Start Helm local repo if there isn't one
-HELM_REPO_PID=$(ps -x | grep "helm serve" | grep -v "grep" | awk '{print $1}')
-if [ -z "$HELM_REPO_PID" ]; then
- nohup helm serve >& /dev/null &
-fi
-
-# Package ric-common and serve it using Helm local repo
-HELM_HOME=$(helm home)
-COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
-helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/ric-common
-cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
-
-AUX_COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/aux-common/Chart.yaml | grep version | awk '{print $2}')
-helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/aux-common
-cp /tmp/aux-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
-
-helm repo index $HELM_HOME/repository/local/
-
-
-# Make sure that helm local repo is added
-helm repo remove local
-helm repo add local http://127.0.0.1:8879/charts
-
+$ROOT_DIR/prepare-common-templates
$ROOT_DIR/../ric-aux/bin/install -f $OVERRIDEYAML
nohup helm serve >& /dev/null &
fi
-# Package ric-common and serve it using Helm local repo
-HELM_HOME=$(helm home)
-COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
-helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/ric-common
-cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
-helm repo index $HELM_HOME/repository/local/
-
-
-# Make sure that helm local repo is added
-helm repo remove local
-helm repo add local http://127.0.0.1:8879/charts
-
-
+$ROOT_DIR/prepare-common-templates
$ROOT_DIR/../ric-dep/bin/install -f $OVERRIDEYAML
+++ /dev/null
-#!/bin/bash
-##############################################################################
-#
-# Copyright (c) 2019 AT&T Intellectual Property.
-#
-# 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.
-#
-##############################################################################
-
-# Installs well-known RIC charts then verifies specified helm chart
-# Requires chart tgz archives in /tmp
-
-
-while [ -n "$1" ]; do # while loop starts
-
- case "$1" in
-
- -f) OVERRIDEYAML=$2
- shift
- ;;
- *) echo "Option $1 not recognized. Please use -f to specify the recipe path." ;; # In case you typed a different option other than a,b,c
-
- esac
-
- shift
-
-done
-
-if [ -z $OVERRIDEYAML ]; then
- echo "Deploy recipe is missing. Please use -f to specify the recipe path."
- exit 1
-fi
-
-
-ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-
-# Start Helm local repo if there isn't one
-HELM_REPO_PID=$(ps -x | grep "helm serve" | grep -v "grep" | awk '{print $1}')
-if [ -z "$HELM_REPO_PID" ]; then
- nohup helm serve >& /dev/null &
-fi
-
-# Package ric-common and serve it using Helm local repo
-HELM_HOME=$(helm home)
-COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
-helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/ric-common
-cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
-helm repo index $HELM_HOME/repository/local/
-
-
-# Make sure that helm local repo is added
-helm repo remove local
-helm repo add local http://127.0.0.1:8879/charts
-
-
-
-
-TEMP_DIR=/tmp
-rm -rf $TEMP_DIR/imagelist
-touch $TEMP_DIR/imagelist
-CHART_ARRAY=()
-while IFS= read -r -d $'\0'; do
- CHART_ARRAY+=("$REPLY")
-done < <(find $ROOT_DIR/../ -name Chart.yaml -printf '%h\0')
-
-
-echo "***************************************"
-
-
-
-for dir in "${CHART_ARRAY[@]}"
-do
-
- echo "Analyzing Chart $(echo $dir | awk '{n=split($0, a, "/"); print a[n]}')"
- echo $dir
-
- #helm dep up $dir > /dev/null 2>&1
- helm dep up $dir
-
- IMAGE_ARRAY=$(helm template -f $OVERRIDEYAML $dir | grep "image:" | awk '{ gsub(/.*image: /, "", $0); gsub(/"/, "", $0); print $0}' )
-
-
- for f in $IMAGE_ARRAY; do
- if [ ! -z $f ]; then
- FOUND=$(grep $f $TEMP_DIR/imagelist)
- if [ -z $FOUND ]; then
- echo "Found unique docker image $f."
- echo $f >> $TEMP_DIR/imagelist
- fi
- fi
- done
-
- echo "***************************************"
-done
-
-
-
-echo "Your image list is available here: $TEMP_DIR/imagelist"
+++ /dev/null
-#!/bin/bash
-##############################################################################
-#
-# Copyright (c) 2019 AT&T Intellectual Property.
-#
-# 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.
-#
-##############################################################################
-
-# Installs well-known RIC charts then verifies specified helm chart
-# Requires chart tgz archives in /tmp
-
-
-while [ -n "$1" ]; do # while loop starts
-
- case "$1" in
-
- -d) DOCKER_REGISTRY=$2
- shift
- ;;
-
- -p) IMAGE_DIRECTORY_PATH=$2
- shift
- ;;
-
- *) echo "Option $1 not recognized. Please specify the docker registry path with the -d option and specify the directory path of the images with the -p option."
- ;; # In case you typed a different option other than -d or -p
-
- esac
-
- shift
-
-done
-
-if [ -z $DOCKER_REGISTRY ]; then
- echo "Please specify the docker registry path with the -d option."
- exit 1
-fi
-
-if [ -z $IMAGE_DIRECTORY_PATH ]; then
- echo "Please specify the directory path of the images with the -p option."
- exit 1
-fi
-
-
-
-
-for image in $IMAGE_DIRECTORY_PATH/*; do
- OUTPUT=$(docker load -i $image)
- IMAGE_PATH_ORIGINAL=$(echo $OUTPUT | grep image: | awk '{print $3}' )
- IMAGENAME=$(echo $IMAGE_PATH_ORIGINAL | awk '{ n=split($0, a, "/"); print a[n] }')
- echo "************************************************************"
- echo "Loading image $IMAGENAME"
- docker tag $IMAGE_PATH_ORIGINAL $DOCKER_REGISTRY/$IMAGENAME
- RESULT=$(docker push $DOCKER_REGISTRY/$IMAGENAME 2>&1)
- LOGIN_ERROR=$(echo $RESULT |& grep "no basic auth credentials" )
- if [ ! -z "$LOGIN_ERROR" ]; then
- echo "You are not logined to $DOCKER_REGISTRY. Please login by running \"docker login $DOCKER_REGISTRY\""
- exit 1
- fi
- ACCESS_ERROR=$(echo $RESULT |& grep "denied: requested access to the resource is denied" )
- if [ ! -z "$ACCESS_ERROR" ]; then
- echo "Failed to push image to docker registry: <$DOCKER_REGISTRY>. Please check if it is a typo."
- exit 1
- fi
-done
--- /dev/null
+#!/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. #
+################################################################################
+
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+# Start Helm local repo if there isn't one
+HELM_REPO_PID=$(ps -x | grep "helm serve" | grep -v "grep" | awk '{print $1}')
+if [ -z "$HELM_REPO_PID" ]; then
+ nohup helm serve >& /dev/null &
+fi
+
+
+
+# Package common templates and serve it using Helm local repo
+HELM_HOME=$(helm home)
+COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
+helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/ric-common
+cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
+
+AUX_COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/aux-common/Chart.yaml | grep version | awk '{print $2}')
+helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/aux-common
+cp /tmp/aux-common-$AUX_COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
+
+NONRTRIC_COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common/Chart.yaml | grep version | awk '{print $2}')
+helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common
+cp /tmp/nonrtric-common-$NONRTRIC_COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
+
+helm repo index $HELM_HOME/repository/local/
+
+
+# Make sure that helm local repo is added
+helm repo remove local
+helm repo add local http://127.0.0.1:8879/charts
+
+
+
+++ /dev/null
-#!/bin/bash
-##############################################################################
-#
-# Copyright (c) 2019 AT&T Intellectual Property.
-#
-# 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.
-#
-##############################################################################
-
-# Installs well-known RIC charts then verifies specified helm chart
-# Requires chart tgz archives in /tmp
-
-
-while [ -n "$1" ]; do # while loop starts
-
- case "$1" in
-
- -f) IMAGELISTFILE=$2
- shift
- ;;
-
-
- -d) IMAGE_DIRECTORY_PATH=$2
- shift
- ;;
-
-
- *) echo "Option $1 not recognized. Please use -f to specify the recipe path." ;; # In case you typed a different option other than a,b,c
-
- esac
-
- shift
-
-done
-
-if [ -z "$IMAGELISTFILE" ]; then
- echo "Image list file is missing. Please use -f to specify the path."
- exit 1
-fi
-
-if [ -z "$IMAGE_DIRECTORY_PATH" ]; then
- IMAGE_DIRECTORY_PATH=/tmp/ric_image
-fi
-
-
-rm -rf $IMAGE_DIRECTORY_PATH
-mkdir -p $IMAGE_DIRECTORY_PATH
-
-
-while IFS= read -r image
-do
- if [[ $image == "#"* ]]; then
- # supporting comment lines
- continue
- fi
-
- IMAGENAME=$(echo $image | awk '{ n=split($0, a, "/"); print a[n] }')
-
- echo "Pulling image $image"
- RESULT=$(docker pull $image |& grep "no basic auth credentials" )
- if [ ! -z "$RESULT" ]; then
- echo "You are not logined to docker registry. Please login by running \"docker login DOCKER_REGISTRY\""
- exit 1
- fi
-
- echo "Saving image $image"
- docker save $image -o $IMAGE_DIRECTORY_PATH/$IMAGENAME
-
- echo "************************************************************"
-
-
-done < "$IMAGELISTFILE"
-
-
-echo "RIC Images are downloaded to: $IMAGE_DIRECTORY_PATH"
#-------------------------------------------------------------------------
common:
- releasePrefix: r3
+ releasePrefix: r4
# If a local docker registry is used, please specify it using the following option
# localregistry: nexus3.o-ran-sc.org:10004
image:
registry: nexus3.o-ran-sc.org:10004/o-ran-sc
name: ric-dashboard
- tag: 2.0.0
+ tag: 2.0.1
cipher:
enc:
key: AGLDdG4D04BKm2IxIWEr8o==
fi
+LABELFOUND=false
+for f in $NODENAME; do
+ LABEL=$(kubectl describe node $f | grep "portal-storage=enable")
+ if [ ! -z "$LABEL" ]; then
+ LABELFOUND=true
+ fi
+done
+
+if ! $LABELFOUND; then
+ echo "***********************************************************************************************"
+ echo "* ERROR!!!!!!!!!!!!! *"
+ echo "***********************************************************************************************"
+ echo "* Nodes label \"portal-storage=enable\" is not found in any of the cluster node. *"
+ echo "* Please pick a node and label it using the following command. i *"
+ echo "* kubectl label --overwrite nodes <YOUR_NODE_NAME> portal-storage=enable *"
+ echo "***********************************************************************************************"
+
+ exit 1
+fi
+
+
+
if ! kubectl get ns ${AUXNAMESPACE:-ricaux}> /dev/null 2>&1; then
kubectl create ns ${AUXNAMESPACE:-ricaux}
fi
kubectl create ns onap
fi
+
+
+echo Add cluster roles
+ cat >ricaux-role.yaml <<EOF
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: ricaux-system-default
+rules:
+ - apiGroups: [""]
+ resources: ["pods"]
+ verbs: ["list"]
+ - apiGroups: ["batch"]
+ resources: ["jobs/status"]
+ verbs: ["get"]
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: ricaux-system-default
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: ricaux-system-default
+subjects:
+ - kind: ServiceAccount
+ name: default
+ namespace: ${AUXNAMESPACE:-ricaux}
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: onap-system-default
+rules:
+ - apiGroups: [""]
+ resources: ["pods"]
+ verbs: ["list"]
+ - apiGroups: ["apps"]
+ resources: ["replicasets/status"]
+ verbs: ["get"]
+ - apiGroups: ["batch"]
+ resources: ["jobs/status"]
+ verbs: ["get"]
+ - apiGroups: ["apps"]
+ resources: ["deployments", "statefulsets"]
+ verbs: ["get"]
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: onap-system-default
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: onap-system-default
+subjects:
+ - kind: ServiceAccount
+ name: default
+ namespace: onap
+EOF
+kubectl apply -f ricaux-role.yaml
+rm ricaux-role.yaml
+
kubectl create configmap -n ${AUXNAMESPACE:-ricaux} aux-recipe --from-file=recipe=$OVERRIDEYAML
+
+echo "Clean up dockerdata-nfs directory"
+rm -rf /dockerdata-nfs
+
+
echo "Deploying AUX components [$COMPONENTS]"
path: /etc/localtime
- name: {{ include "common.fullname" . }}-data
persistentVolumeClaim:
- claimName: {{ include "common.namespace" . }}-aaf-sshsm-data
+ claimName: {{ .Release.Name }}-aaf-sshsm-data
imagePullSecrets:
- name: "{{ include "common.namespace" . }}-docker-registry-key"
- /root/job_complete.py
args:
- -j
- - "{{ include "common.namespace" . }}-aaf-sshsm-distcenter"
+ - "{{ .Release.Name }}-aaf-sshsm-distcenter"
env:
- name: NAMESPACE
valueFrom:
path: /etc/localtime
- name: {{ include "common.fullname" . }}-data
persistentVolumeClaim:
- claimName: {{ include "common.namespace" . }}-aaf-sshsm-data
+ claimName: {{ .Release.Name }}-aaf-sshsm-data
- name: {{ include "common.fullname" . }}-dbus
persistentVolumeClaim:
- claimName: {{ include "common.namespace" . }}-aaf-sshsm-dbus
+ claimName: {{ .Release.Name }}-aaf-sshsm-dbus
- name: {{ include "common.fullname" . }}-secrets
secret:
- secretName: {{ include "common.namespace" . }}-aaf-sshsm
+ secretName: {{ .Release.Name }}-aaf-sshsm
imagePullSecrets:
- name: "{{ include "common.namespace" . }}-docker-registry-key"
version: 0.1.0
repository: "file://./subcharts/certificate-manager"
condition: certificate-manager.enabled
+ - name: danm-networks
+ version: 1.0.0
+ repository: "file://./subcharts/danm-networks"
+ condition: danm-networks.enabled
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
+ {{- if $.Values.global }}
+ {{- if $.Values.global.danm_networks }}
+ {{- $networklist := list }}
+ {{- range $network := $.Values.global.danm_networks }}
+ {{- if $network.tenants }}
+ {{- if $network.tenants.kong }}
+ {{- $networklist = append $networklist $network }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
+ {{- if $networklist }}
+ danm.k8s.io/interfaces: |
+ [
+ {{- range $network := $networklist }}
+ {{- printf "\n {\"clusterNetwork\": \"%s\"" $network.name }}
+ {{- if $network.tenants.kong.ip }}
+ {{- printf ", \"ip\": \"%s\"" $network.tenants.kong.ip }}
+ {{- else }}
+ {{- printf ", \"ip\": \"dynamic\"" }}
+ {{- end }}
+ {{- if $network.tenants.kong.ip6 }}
+ {{- printf ", \"ip6\": \"%s\"" $network.tenants.kong.ip6 }}
+ {{- end }}
+ {{- if $network.tenants.kong.proutes }}
+ {{- printf ", \"proutes\": {" }}
+ {{- range $subnet, $gw := $network.tenants.kong.proutes }}
+ {{- if eq $subnet ( first ( keys $network.tenants.kong.proutes ))}}
+ {{- printf "\"%s\": \"%s\"" $subnet $gw }}
+ {{- else }}
+ {{- printf ", \"%s\": \"%s\"" $subnet $gw }}
+ {{- end }}
+ {{- end }}
+ {{- printf "}" }}
+ {{- end }}
+ {{- printf "}" }}
+ {{- end }}
+ ]
+ {{- end }}
+ {{- end }}
+ {{- end }}
labels:
{{- include "kong.metaLabels" . | nindent 8 }}
app.kubernetes.io/component: app
- /root/job_complete.py
args:
- --job-name
- - {{ include "common.namespace" . }}-portal-db-config
+ - {{ .Release.Name }}-portal-db-config
env:
- name: NAMESPACE
valueFrom:
-/* Create RIC Dashboard app */
-
INSERT IGNORE INTO `fn_app` (`app_id`, `app_name`, `app_image_url`, `app_description`, `app_notes`, `app_url`, `app_alternate_url`, `app_rest_endpoint`, `ml_app_name`, `ml_app_admin_id`, `mots_id`, `app_password`, `open`, `enabled`, `thumbnail`, `app_username`, `ueb_key`, `ueb_secret`, `ueb_topic_name`, `app_type`,`auth_central`,`auth_namespace`) VALUES
(12, 'RIC-Dashboard', '', NULL, NULL, '{{.Values.config.ricdashboardProtocol}}://{{.Values.config.ricdashboardHostName}}:{{.Values.config.ricdashboardPort}}', '','http://service-ricaux-dashboard-http:8080/api/v3', '', '', NULL, 'password', 'N', 'Y', NULL, 'Default', 'ueb_key', 'ueb_secret', 'ECOMP-PORTAL-OUTBOX', 1,'N',NULL);
-Subproject commit 91184df84b97b4d867f3324c5dc3e6a6a734134a
+Subproject commit 98d784eba3506478481d5a22edbee6ca0bdb68da