# See the License for the specific language governing permissions and
# limitations under the License.
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ric-robot.fullname" . }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ include "ric-robot.name" . }}
+ release: {{ .Release.Name }}
template:
metadata:
+ {{- if .Values.rtmgr.annotations }}
+ annotations:
+ {{- .Values.rtmgr.annotations | nindent 8 -}}
+ {{ end }}
labels:
- app.kubernetes.io/instance: {{ .Release.Name }}
- app.kubernetes.io/managed-by: {{ .Release.Service }}
+ app: {{ include "ric-robot.name" . }}
+ release: {{ .Release.Name }}
+ robotImplementation: {{ .Values.robotImplementation }}
spec:
containers:
- name: {{ include "ric-robot.name" . }}
- name: RICPLT_NAMESPACE
value: {{ .Release.Namespace }}
- name: RICPLT_RELEASE_NAME
- value: {{ .Values.Release.HelmReleaseName }}
+ value: {{ .Release.Name }}
- name: RICPLT_COMPONENTS
value: {{ keys .Values.ric.platform.components | join " " }}
ports:
-opyright (c) 2019 AT&T Intellectual Property. #
+#!/bin/bash
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
# Copyright (c) 2019 Nokia. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# See the License for the specific language governing permissions and #
# limitations under the License. #
################################################################################
+while [ -n "$1" ]; do # while loop starts
+ case "$1" in
-OVERRIDEYAML=$1
-
-
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-#/root/test/ric_robot_suite/helm
-# extract the base to find root to dep
-
-BASE=${DIR%/test*}
-
-# /data/ORAN-OSC/it/dep/ric-platform/50-RIC-Platform/bin/install
-BASEDIR50=$BASE/dep/ric-platform/50-RIC-Platform/
-BASEDIRCOMMON=$BASE/dep/ric-common/Common-Template/helm/ric-common
+ -f) OVERRIDEYAML=$2
+ shift
+ ;;
+ *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
-echo "Using etc/ric.conf from $BASEDIR50"
+ esac
-source $BASEDIR50/etc/ric.conf
+ shift
+done
-if [ -z "$RICPLT_RELEASE_NAME" ];then
- RELEASE_NAME=$helm_release_name
-else
- RELEASE_NAME=$RICPLT_RELEASE_NAME
-fi
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
- PLT_NAMESPACE=$plt_namespace
-else
- PLT_NAMESPACE=$RICPLT_NAMESPACE
+if [ -z "$OVERRIDEYAML" ];then
+ echo "****************************************************************************************************************"
+ echo " ERROR "
+ echo "****************************************************************************************************************"
+ echo "RIC robot deployment without deployment recipe/override is currently disabled. Please specify an recipe/ovrride with the -f option."
+ echo " the deployment recipe/override should be the same file as is used for RIC platform deplpoyment "
+ echo "****************************************************************************************************************"
+ exit 1
fi
-RICPLT_COMPONENTS="ric-robot"
-
-echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]"
-echo "Platform Namespace: $PLT_NAMESPACE"
-echo "Helm Release Name: $RELEASE_NAME"
-
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^ namespace:/{getline; while ($0 ~ /^ .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *platform:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=ric-robot
-#COMMON_CHART_VERSION=$(cat $BASEDIR50/helm/common/Chart.yaml | grep version | awk '{print $2}')
-COMMON_CHART_VERSION=$(cat $BASEDIRCOMMON/Chart.yaml | grep version | awk '{print $2}')
+echo "Deploying RIC [$COMPONENTS]"
+COMMON_CHART_VERSION=$(cat $DIR/../../../dep/ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
+helm package -d /tmp $DIR/../../../dep/ric-common/Common-Template/helm/ric-common
-helm package -d /tmp $BASEDIRCOMMON
+for component in $COMPONENTS; do
-for component in $RICPLT_COMPONENTS; do
- echo "Preparing chart for comonent $component"
mkdir -p $DIR/$component/charts/
cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/$component/charts/
- if [ -z $OVERRIDEYAML ]; then
- echo "helm install --namespace \"${PLT_NAMESPACE}\" --set \"Release.HelmReleaseName=${RELEASE_NAME}\" --name \"${RELEASE_NAME}-$component\" $DIR/../helm/$component"
- helm install --namespace "${PLT_NAMESPACE}" --set "Release.HelmReleaseName=${RELEASE_NAME}" --name "${RELEASE_NAME}-$component" $DIR/$component
- else
- echo "helm install -f $OVERRIDEYAML --namespace \"${PLT_NAMESPACE}\" --set \"Release.HelmReleaseName=${RELEASE_NAME}\" --name \"${RELEASE_NAME}-$component\" $DIR/../helm/$component"
- helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --set "Release.HelmReleaseName=${RELEASE_NAME}" --name "${RELEASE_NAME}-$component" $DIR/$component
- fi
+ helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
done
+echo "RELEASE_NAMESPACE=${NAMESPACE}" > /tmp/ric-robot.conf
+echo "RELEASE_NAME=${RELEASE_PREFIX}" >> /tmp/ric-robot.conf
+echo "OVERRIDEYAML=${OVERRIDEYAML}" >> /tmp/ric-robot.conf
+