--- /dev/null
+################################################################################
+# 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. #
+###############################################################################
+
+#-------------------------------------------------------------------------
+# Global common setting
+#-------------------------------------------------------------------------
+global:
+ # Docker registry from which RIC platform components pull the images
+ repository: nexus3.o-ran-sc.org:10004
+
+ # Name of the K8S docker credential that is onboarded by 20-credential
+ repositoryCred: docker-reg-cred
+
+ # Docker image pull policy
+ imagePullPolicy: Always
+
+ # Helm repo that will be used by xApp manager
+ helmRepository: nexus.ricinfra.local
+
+ # Certificate of the helm repo
+ helmRepositoryCert: xapp-mgr-certs
+
+ # Name of the K8S secret that contains the credential of the helm repo
+ helmRepositoryCred: xapp-mgr-creds
+
+ # The name of the tiller that xApp helm client talks to
+ helmRepositoryTiller: tiller-deploy
+
+ # The namespace of the xApp helm tiller
+ helmRepositoryTillerNamespace: kube-system
+
+ # The port the xApp helm tiller is listening to
+ helmRepositoryTillerPort: 44134
+
+
+
+
+#-------------------------------------------------------------------------
+# Auxiliary Functions
+#-------------------------------------------------------------------------
+dashboard:
+ image:
+ name:: ric-dash-be
+ tag: 1.0.0-SNAPSHOT
+
--- /dev/null
+################################################################################
+# 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. #
+###############################################################################
+
+#-------------------------------------------------------------------------
+# Global common setting
+#-------------------------------------------------------------------------
+global:
+ # Docker registry from which RIC platform components pull the images
+ repository: nexus3.o-ran-sc.org:10004
+
+ # Name of the K8S docker credential that is onboarded by 20-credential
+ repositoryCred: docker-reg-cred
+
+ # Docker image pull policy
+ imagePullPolicy: Always
+
+ # Helm repo that will be used by xApp manager
+ helmRepository: nexus.ricinfra.local
+
+ # Certificate of the helm repo
+ helmRepositoryCert: xapp-mgr-certs
+
+ # Name of the K8S secret that contains the credential of the helm repo
+ helmRepositoryCred: xapp-mgr-creds
+
+ # The name of the tiller that xApp helm client talks to
+ helmRepositoryTiller: tiller-deploy
+
+ # The namespace of the xApp helm tiller
+ helmRepositoryTillerNamespace: kube-system
+
+ # The port the xApp helm tiller is listening to
+ helmRepositoryTillerPort: 44134
+
+#-------------------------------------------------------------------------
+# Infrastructure
+#-------------------------------------------------------------------------
+
+cluster:
+ deployK8S: false
+ deployNexus: false
+ useLocalHelmRepo: false
+ useLocalDockerRegistry: false
+
+
+repositoryCredential:
+ user: "docker"
+ password: "docker"
+
+
+helmrepoCredential:
+ user: "helm"
+ password: "docker"
+
+
+adminPassword: admin123
+
+datapath: /tmp/nexus3-data/
imagePullPolicy: Always
# Helm repo that will be used by xApp manager
- helmRepository: nexus.ricinfra.local
+ helmRepository: helm.ricinfra.local
# Certificate of the helm repo
helmRepositoryCert: xapp-mgr-certs
# The port the xApp helm tiller is listening to
helmRepositoryTillerPort: 44134
-#-------------------------------------------------------------------------
-# Infrastructure
-#-------------------------------------------------------------------------
-
-
-
-
-#-------------------------------------------------------------------------
-# Auxiliary Functions
-#-------------------------------------------------------------------------
-dashboard:
- image:
- name:: ric-dash-be
- tag: 1.0.0-SNAPSHOT
#-------------------------------------------------------------------------
# Platform Components
# xApp Manager
appmgr:
image:
- name: xapp-manager
- tag: latest
+ name: ric-plt-appmgr
+ tag: 0.1.3
# DBAAS
dbaas:
backend:
image:
- name: redis-standalone
- tag: latest
+ name: ric-plt-dbaas
+ tag: 0.1.0
# E2 Manager
e2mgr:
--- /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. #
+################################################################################
+
+# This script deploys RIC auxiliary function components automatically
+
+OVERRIDEYAML=$1
+
+
+
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+source $DIR/../etc/ric-infra.conf
+
+export RICINFRA_RELEASE_NAME=$ric_infra_helm_release_name
+
+export RICINFRA_NAMESPACE=$ric_infra_namespace
+
+export DEPLOY_K8S=$deployK8S
+
+export DEPLOY_NEXUS=$deployNexus
+
+export USE_LOCAL_HELM_REPO=$useLocalHelmRepo
+
+export USE_LOCAL_DOCKER_REGISTRY=$useLocalDockerRegistry
+
+
+
+
+
+source $DIR/../etc/ric-platform.conf
+
+export RICPLT_RELEASE_NAME=$ric_platform_helm_release_name
+
+export RICPLT_NAMESPACE=$ric_platform_namespace
+
+
+
+
+if [ -z "$OVERRIDEYAML" ];then
+ echo "****************************************************************************************************************"
+ echo " WARNING "
+ echo "****************************************************************************************************************"
+ echo "Deploying RIC infrastructure components without deployment recipe. Default configurations are used."
+ echo "****************************************************************************************************************"
+
+else
+
+ export DEPLOY_K8S=$(cat $OVERRIDEYAML | grep deployK8S | awk '{print $2}')
+ export DEPLOY_NEXUS=$(cat $OVERRIDEYAML | grep deployNexus | awk '{print $2}')
+ export USE_LOCAL_HELM_REPO=$(cat $OVERRIDEYAML | grep useLocalHelmRepo | awk '{print $2}')
+ export USE_LOCAL_DOCKER_REGISTRY=$(cat $OVERRIDEYAML | grep useLocalDockerRegistry | awk '{print $2}')
+fi
+
+
+
+if $USE_LOCAL_HELM_REPO && [ "$DEPLOY_NEXUS" != "true" ];then
+ echo "****************************************************************************************************************"
+ echo " ERROR "
+ echo "****************************************************************************************************************"
+ echo "Local helm repo cannot be used if Nexus is not installed. Please change your configurations in the deployment recipe."
+ echo "****************************************************************************************************************"
+ exit 1
+fi
+
+
+if $USE_LOCAL_DOCKER_REGISTRY && [ "$DEPLOY_NEXUS" != "true" ];then
+ echo "****************************************************************************************************************"
+ echo " ERROR "
+ echo "****************************************************************************************************************"
+ echo "Local docker registry cannot be used if Nexus is not installed. Please change your configurations in the deployment recipe."
+ echo "****************************************************************************************************************"
+ exit 1
+fi
+
+
+if $DEPLOY_K8S; then
+ echo "Deploying K8S. Please make sure that you configure files in ./ric-infra/00-Kubernetes/etc correctly."
+ . ../ric-infra/00-Kubernetes/bin/install
+fi
+
+
+if $DEPLOY_NEXUS; then
+ echo "Deploying Nexus."
+ . ../ric-infra/10-Nexus/bin/install $OVERRIDEYAML
+fi
+
+
+
# limitations under the License. #
################################################################################
-{{/* vim: set filetype=mustache: */}}
-{{/*
-Expand the name of the chart.
-*/}}
-{{- define "e2mgr.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
+# ------------------- RIC AUX ---------------------------------------
-{{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "e2mgr.fullname" -}}
-{{- if .Values.fullnameOverride -}}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- $name := default .Chart.Name .Values.nameOverride -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
+# release name helm will use to deploy RIC infrastructure componenets
+ric_infra_helm_release_name=r0
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "e2mgr.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
+# namespace that helm will use to deploy RIC infrastructure componenets
+ric_infra_namespace=ricinfra
+
+# deploy the kubernete cluster
+deployK8S=false
+
+# deploy a nexus repository manager
+deployNexus=true
+
+# use the local helm repo
+useLocalHelmRepo=true
+
+# use the local docker registry
+useLocalDockerRegistry=false
sleep 15
done
- # install ingress controller db-less kong
- helm install stable/kong --set ingressController.enabled=true --set postgresql.enabled=false --set env.database=off
-
echo "Starting an NC TCP server on port 29999 to indicate we are ready"
nc -l -p 29999 &
--- /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. #
+################################################################################
+
+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
+
+if [ -z "$DEFAULT_NEXUS_ADMIN_PASSWORD" ];then
+ NEXUS_ADMIN_PASSWORD=$default_admin_password
+else
+ NEXUS_ADMIN_PASSWORD=$DEFAULT_NEXUS_ADMIN_PASSWORD
+fi
+
+
+
+HOSTPOSTFIX=$(cat $DIR/../helm/values.yaml | grep hostpostfix | awk '{print $2}')
+
+
+
+
+
+
+
+
+
+NEXUS_URL="http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS"
+
+
+
+
+
+
+if [ -z $OVERRIDEYAML ]; then
+
+ DOCKERPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*repositoryCredential:.*/{getline; getline; print substr($2, 2, length($2)-2);}')
+ HELMPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*helmrepoCredential:.*/{getline; getline; print substr($2, 2, length($2)-2);}')
+ ADMINPASSWORD=$(cat $DIR/../helm/values.yaml | awk '/^.*adminPassword:.*/{print $2}')
+
+else
+
+
+
+ DOCKERPASSWORD=$(cat $OVERRIDEYAML | awk '/^.*repositoryCredential:.*/{getline; getline; print substr($2, 2, length($2)-2);}')
+
+
+
+ if [ -z $DOCKERPASSWORD ]; then
+ DOCKERPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*repositoryCredential:.*/{getline; getline; print substr($2, 2, length($2)-2);}')
+ fi
+
+ HELMPASSWORD=$(cat $OVERRIDEYAML | awk '/^.*helmrepoCredential:.*/{getline; getline; print substr($2, 2, length($2)-2);}')
+
+ if [ -z $HELMPASSWORD ]; then
+ HELMPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*helmrepoCredential:.*/{getline; getline; print substr($2, 2, length($2)-2);}')
+ fi
+
+ ADMINPASSWORD=$(cat $OVERRIDEYAML | awk '/^.*adminPassword:.*/{print $2;}')
+ if [ -z $ADMINPASSWORD ]; then
+ ADMINPASSWORD=$(cat $DIR/../helm/values.yaml | awk '/^.*adminPassword:.*/{print $2;}')
+ fi
+
+fi
+
+
+
+
+#echo $DOCKERPASSWORD, $HELMPASSWORD, $ADMINPASSWORD
+
+
+
+
+DOCKERPORT=$(cat $DIR/../helm/templates/deployment.yaml | awk '/.*- name: docker.*/{getline; print $2}')
+
+
+DOCKERREPOSCRIPT="{\"name\":\"docker_changepassword\",\
+ \"type\":\"groovy\",\
+ \"content\":\"security.securitySystem.changePassword('docker', '$DOCKERPASSWORD')\"}"
+
+
+
+
+# This line uses the default admin password
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H "Content-Type: application/json" --data "$DOCKERREPOSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script)
+
+
+if [ "${STATUS}" != "204" ];then
+ echo "> script upload failed!"
+fi
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/docker_changepassword/run)
+
+
+if [ "${STATUS}" == "200" ];then
+ echo "> docker password change succeeded!"
+else
+ echo "> docker password change failed!"
+fi
+
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE -u admin:$NEXUS_ADMIN_PASSWORD http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/docker_changepassword)
+
+
+if [ "${STATUS}" != "204" ];then
+ echo "> script deletion failed!"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+HELMREPOSCRIPT="{\"name\":\"helm_changepassword\",\
+ \"type\":\"groovy\",\
+ \"content\":\"security.securitySystem.changePassword('helm', '$HELMPASSWORD')\"}"
+
+
+
+# This line uses the default admin password
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H "Content-Type: application/json" --data "$HELMREPOSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script)
+
+
+if [ "${STATUS}" != "204" ];then
+ echo "> script upload failed!"
+fi
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/helm_changepassword/run)
+
+
+if [ "${STATUS}" == "200" ];then
+ echo "> helm password change succeeded!"
+else
+ echo "> helm password change failed!"
+fi
+
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE -u admin:$NEXUS_ADMIN_PASSWORD http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/helm_changepassword)
+
+
+if [ "${STATUS}" != "204" ];then
+ echo "> script deletion failed!"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ADMINSCRIPT="{\"name\":\"admin_changepassword\",\
+ \"type\":\"groovy\",\
+ \"content\":\"security.securitySystem.changePassword('admin', '$ADMINPASSWORD')\"}"
+
+
+
+# This line uses the default admin password
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H "Content-Type: application/json" --data "$ADMINSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script)
+
+
+if [ "${STATUS}" != "204" ];then
+ echo "> script upload failed!"
+fi
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/admin_changepassword/run)
+
+
+if [ "${STATUS}" == "200" ];then
+ echo "> admin password change succeeded!"
+else
+ echo "> admin password change failed!"
+fi
+
+NEXUS_ADMIN_PASSWORD=$ADMINPASSWORD
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE -u admin:$NEXUS_ADMIN_PASSWORD http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/admin_changepassword)
+
+
+if [ "${STATUS}" != "204" ];then
+ echo "> script deletion failed!"
+fi
+
--- /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. #
+################################################################################
+
+OVERRIDEYAML=$1
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+
+
+
+
+
+if [ -z $OVERRIDEYAML ]; then
+
+ DATAPATH=$(cat $DIR/../helm/values.yaml | awk '/^.*datapath:.*/{ print $2;}')
+
+else
+
+ DATAPATH=$(cat $OVERRIDEYAML | awk '/^.*datapath:.*/{ print $2;}')
+
+
+ if [ -z $DATAPATH ]; then
+ DATAPATH=$(cat $DIR/../helm/values.yaml | awk '/^.*datapath:.*/{ print $2;}')
+ fi
+
+fi
+
+if [ -e $DATAPATH ]; then
+ if [ ! -w $DATAPATH ]; then
+ echo "Error: you don't have write permission to directory $DATAPATH"
+ echo "Deployment terminated."
+ exit 1
+ fi
+
+ rm -rf $DATAPATH
+
+ mkdir -p $DATAPATH
+
+ tar -xf $DIR/../etc/conf.tar -C $DATAPATH
+
+ chmod -R a+rwx $DATAPATH
+else
+ mkdir -p $DATAPATH
+ if [ $? -eq 0 ]; then
+ tar -xf $DIR/../etc/conf.tar -C $DATAPATH
+ chmod -R a+rwx $DATAPATH
+ else
+ echo "Error: you don't have write permission to directory $DATAPATH"
+ echo "Deployment terminated."
+ exit 1
+ fi
+
+
+fi
+
+
echo "If nexus.$HOSTPOSTFIX is not resolved by your DNS server, please add an entry in your /etc/hosts file."
echo "****************************************************************************************************************"
+. ./deploy_nexus_data $OVERRIDEYAML
+
+
+
+NODENAME=$(kubectl get node | awk 'NR==2{print $1}')
+kubectl label --overwrite nodes $NODENAME nexus-node=enable
+
+
+
+
+
+
COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}')
helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common
helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../helm
fi
-NEXUS_POD_NAME=$(kubectl get pod -n $NAMESPACE | grep nexus | grep ContainerCreating | awk '{print $1}')
+NEXUS_POD_NAME=$(kubectl get pod -n $NAMESPACE | grep nexus | grep -v "Terminating" | awk '{print $1}')
+
echo "Waiting Nexus to be ready."
echo " "
echo $IS_NEXUS_READY
-DOCKERPORT=$(cat $DIR/../helm/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
-
-
-
+. ./change_password $OVERRIDEYAML
# ingress port number of the K8S cluster
# It will be overrided by INGRESS_PORT
ingress_port=30000
+
+
+default_admin_password=admin123
- name: docker
containerPort: 10001
protocol: TCP
+ volumeMounts:
+ - name: nexus-config
+ mountPath: /nexus-data
+ volumes:
+ - name: nexus-config
+ persistentVolumeClaim:
+ claimName: nexus-claim
+
+
# livenessProbe:
# httpGet:
# path: /
--- /dev/null
+################################################################################
+# 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: extensions/v1beta1
+kind: Ingress
+metadata:
+ annotations:
+ nginx.ingress.kubernetes.io/rewrite-target: /repository/helm.local/
+ name: {{ include "nexus.fullname" . }}-helm
+ labels:
+ app: {{ template "nexus.name" . }}
+ chart: {{ template "nexus.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ tls:
+ - hosts:
+ - helm.{{ .Values.ingress.hostpostfix }}
+ secretName: {{ include "common.helmrepositorycert" . }}
+ rules:
+ - host: helm.{{ .Values.ingress.hostpostfix }}
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "nexus.fullname" . }}
+ servicePort: nexus
+ path: /
heritage: {{ .Release.Service }}
spec:
tls:
- - hosts:
- - docker.{{ .Values.ingress.hostpostfix }}
- secretName: {{ include "common.repositorycert" . }}
+ - hosts:
+ - docker.{{ .Values.ingress.hostpostfix }}
+ secretName: {{ include "common.repositorycert" . }}
rules:
- host: nexus.{{ .Values.ingress.hostpostfix }}
http:
--- /dev/null
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: nexus3-configuration
+spec:
+ capacity:
+ storage: {{ .Values.storagesize }}
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Retain
+ storageClassName: nexus3-storage
+ local:
+ path: {{ .Values.datapath }}
+ nodeAffinity:
+ required:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: nexus-node
+ operator: In
+ values:
+ - enable
--- /dev/null
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: nexus-claim
+spec:
+ accessModes:
+ - ReadWriteOnce
+ storageClassName: nexus3-storage
+ resources:
+ requests:
+ storage: {{ .Values.storagesize }}
containers:
- name: cert-copy
image: alpine
- command: ["cp", "-rL", "/var/run/certs/..data/tls.crt", "/var/run/certs-copy/"]
+ command: [ "/bin/sh","-c","cp -rL /var/run/dockercerts/..data/tls.crt /var/run/certs-copy/dockertls.crt && cp -rL /var/run/helmcerts/..data/tls.crt /var/run/certs-copy/helmtls.crt"]
# command: ["tail", "-f", "/dev/null"]
volumeMounts:
- - name: certs
- mountPath: /var/run/certs
+ - name: dockercerts
+ mountPath: /var/run/dockercerts
+ readOnly: true
+ - name: helmcerts
+ mountPath: /var/run/helmcerts
readOnly: true
- name: write-to-volume
mountPath: /var/run/certs-copy
volumes:
- - name: certs
+ - name: dockercerts
secret:
secretName: {{ include "common.repositorycert" . }}
+ - name: helmcerts
+ secret:
+ secretName: {{ include "common.helmrepositorycert" . }}
- name: write-to-volume
hostPath:
path: /tmp
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+
+apiVersion: v1
+kind: Secret
+type: kubernetes.io/tls
+metadata:
+ name: {{ include "common.helmrepositorycert" . }}
+ labels:
+ app: {{ template "nexus.name" . }}
+ chart: {{ template "nexus.chart" . }}
+ heritage: {{ .Release.Service }}
+ release: {{ .Release.Name }}
+ annotations:
+ "helm.sh/hook": "pre-install"
+ "helm.sh/hook-delete-policy": "before-hook-creation"
+data:
+{{ ( include "common.helmrepository.gen-certs" . ) | indent 2 }}
--- /dev/null
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+ name: nexus3-storage
+provisioner: kubernetes.io/no-provisioner
+volumeBindingMode: WaitForFirstConsumer
# repositoryCertOverride: ""
repositoryCert: docker-reg-certs
+# This is the name of K8S secret that contains the helm repository cert
+# You can override this by using
+# helmRepositoryCertOverride: ""
+helmRepositoryCert: xapp-mgr-certs
+
+
+# This is the admin password
+adminPassword: admin123
+
# This is designed to be deployed using local image
image:
repository: nexus-repository-helm-apt
ingress:
hostpostfix: ricinfra.local
+
+storagesize: 20Gi
+datapath: /tmp/nexus3-data/
if [ -z $OVERRIDEYAML ]; then
- helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../helm
+ helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-${NAMESPACE}-credential" $DIR/../helm
else
- helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../helm
+ helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-${NAMESPACE}-credential" $DIR/../helm
fi
NAMESPACE=$RICPLT_NAMESPACE
fi
- helm delete --purge "${RELEASE_NAME}-credential"
+helm delete --purge "${RELEASE_NAME}-${NAMESPACE}-credential"
-----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==
+MIIDFzCCAf+gAwIBAgIRAPqRsyJWFaoXjwzmI+uQ5GkwDQYJKoZIhvcNAQELBQAw
+HTEbMBkGA1UEAxMSaGVsbS1yZXBvc2l0b3J5LWNhMB4XDTE5MDYyMjAzMDYxNVoX
+DTIwMDYyMTAzMDYxNVowEDEOMAwGA1UEAxMFbmV4dXMwggEiMA0GCSqGSIb3DQEB
+AQUAA4IBDwAwggEKAoIBAQDBExs2W0HvXyinLL/LOkgM4Dobe1OVVntQzCGB8tqD
+xI4ZcXGh8G4b3GMLVe8vs0c0IUUbPhy23AkDxGUT7whLbo1UwGa41htxY51zok4S
+20NN706XVs6E0tKqA1L5kzyxLEAKgHE/EefWIf6MHtRt5GfwFVdjdfZP+9L/ZpUL
+u1HKmiWw7fv0m/MrcAQA7lILpB4xeaM8rYWtBj8TGeoMlWLOtOcFKGpY9Kuty1n7
+cebHcz++qY+Vsrf8RlG4lGlit2IY06FE+5ihK24Zt9Ttwf3lsTf6xDwAEGmDxOAp
+R61gY9wX8ClLO+ns+nkkEiJ90104a4U+qg115tZCGfBBAgMBAAGjXzBdMA4GA1Ud
+DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0T
+AQH/BAIwADAeBgNVHREEFzAVghNoZWxtLnJpY2luZnJhLmxvY2FsMA0GCSqGSIb3
+DQEBCwUAA4IBAQA2Mt29tQ/3ACBpmZSKLPj3jTpPulXQKgtH9of9X0XBQ0ZdfqTN
+Evyu+K5gY/FF6RhnkaCML4XoOnvJHQQBydwMrK9f6mcC26U8PWZn9+usihw5GJHp
+Hu3pc0PDHb87ha+qCeie9ssKitz8pbJarTh6z1Ht8OT9/nktXkgPnIYI9ycAsdwy
+uBww45UxDu8OD8TT0/08RzH56ruPpRSYDNRbkcT8FZV8C6KgEKG55e/xNAITQwaD
+LD4xYkAZqK7lcPzuIM1kZUQAOJyw72TicMl94r0mL7pZ2NOJUCkkVvkYXo97TUKB
+zomEUpolyZnVpdl4HG3v3Lwd2K3bCs2X+HTc
-----END CERTIFICATE-----
*/}}
{{- define "repository.secret" -}}
{{- $repo := include "common.repository" . }}
- {{- $cred := .Values.repositoryCred }}
+ {{- $cred := .Values.repositoryCredential }}
{{- $user := default "docker" $cred.user }}
{{- $password := default "docker" $cred.password }}
{{- $mail := default "@" $cred.mail }}
{{- define "helmrepo.secret.user" -}}
- {{- $user := default "helm" .Values.helmrepoCred.user -}}
+ {{- $user := default "helm" .Values.helmrepoCredential.user -}}
{{- printf "%s" $user |b64enc }}
{{- end -}}
{{- define "helmrepo.secret.password" -}}
- {{- $pass := default "helm" .Values.helmrepoCred.password -}}
+ {{- $pass := default "helm" .Values.helmrepoCredential.password -}}
{{- printf "%s" $pass |b64enc }}
{{- end -}}
# Values for setting up Kubernetes resources for accessing infrastructure such as docker registry
# helm repo, etc.
+repository: "nexus3.o-ran-sc.org:10004"
-repositoryCred:
+repositoryCredential:
user: "docker"
password: "docker"
-helmrepoCred:
+helmrepoCredential:
user: "helm"
password: "helm"
fi
-RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term"
+RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator kong-platform kong-xapp"
+#RICPLT_COMPONENTS="kong-platform kong-xapp"
echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]"
echo "Platform Namespace: $NAMESPACE"
for component in $RICPLT_COMPONENTS; do
echo "Preparing chart for comonent $component"
+
+ if [ $component = "kong-platform" ]; then
+ helm dep up $DIR/../helm/$component
+ helm install --namespace ricplt --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off
+ continue
+ fi
+
+ if [ $component = "kong-xapp" ]; then
+ helm dep up $DIR/../helm/$component
+ helm install --namespace ricxapp --name "${RELEASE_NAME}-$component" $DIR/../helm/$component --set postgresql.enabled=false --set env.database=off
+ continue
+ fi
+
+ echo "not kong component"
+
mkdir -p $DIR/../helm/$component/charts/
cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
if [ -z $OVERRIDEYAML ]; then
fi
-RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term"
+RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator kong-platform kong-xapp"
echo "Undeploying RIC Platform components [$RICPLT_COMPONENTS]"
echo "Platform Namespace: $NAMESPACE"
--- /dev/null
+# 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/
--- /dev/null
+apiVersion: v1
+description: A1 Helm chart for Kubernetes
+name: a1mediator
+version: 1.0.0
--- /dev/null
+{
+ "controls":[
+ {
+ "name":"admission_control_policy",
+ "description":"various parameters to control admission of dual connection",
+ "message_receives_rmr_type":"DC_ADMISSION_INTERVAL_CONTROL",
+ "message_receives_payload_schema":{
+ "$schema":"http://json-schema.org/draft-07/schema#",
+ "type":"object",
+ "properties":{
+ "enforce":{
+ "type":"boolean",
+ "default":true
+ },
+ "window_length":{
+ "type":"integer",
+ "default":1,
+ "minimum":1,
+ "maximum":60,
+ "description":"Sliding window length (in minutes)"
+ },
+ "blocking_rate":{
+ "type":"number",
+ "default":10,
+ "minimum":1,
+ "maximum":100,
+ "description":"% Connections to block"
+ },
+ "trigger_threshold":{
+ "type":"integer",
+ "default":10,
+ "minimum":1,
+ "description":"Minimum number of events in window to trigger blocking"
+ }
+ },
+ "required":[
+ "enforce",
+ "blocking_rate",
+ "trigger_threshold",
+ "window_length"
+ ],
+ "additionalProperties":false
+ },
+ "message_sends_rmr_type":"DC_ADMISSION_INTERVAL_CONTROL_ACK",
+ "message_sends_payload_schema":{
+ "$schema":"http://json-schema.org/draft-07/schema#",
+ "type":"object",
+ "properties":{
+ "status":{
+ "type":"string",
+ "enum":[
+ "SUCCESS",
+ "FAIL"
+ ]
+ },
+ "message":{
+ "type":"string"
+ }
+ },
+ "required":[
+ "status"
+ ],
+ "additionalProperties":false
+ }
+ }
+ ]
+}
--- /dev/null
+DC_ADMISSION_INTERVAL_CONTROL:20000
+DC_ADMISSION_INTERVAL_CONTROL_ACK:20001
--- /dev/null
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "a1mediator.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "a1mediator.fullname" -}}
+{{- if .Values.fullnameOverride -}}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- if contains $name .Release.Name -}}
+{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "a1mediator.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Common labels
+*/}}
+{{- define "a1mediator.labels" -}}
+app.kubernetes.io/name: {{ include "a1mediator.name" . }}
+helm.sh/chart: {{ include "a1mediator.chart" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
--- /dev/null
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: a1conf
+data:
+ local.rt: |
+ newrt|start
+ rte|20000|ADM_CONTROL_GOES_HERE:4563
+ rte|20001|{{ .Values.rmrservice.name }}:{{ .Values.rmrservice.port }}
+ newrt|end
+ rmr_string_int_mapping.txt: {{ tpl (.Files.Get "files/rmr_string_int_mapping.txt") . | quote }}
+ ricmanifest.json: {{ tpl (.Files.Get "files/ricmanifest.json") . | quote }}
--- /dev/null
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "a1mediator.fullname" . }}
+ labels:
+{{ include "a1mediator.labels" . | indent 4 }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app.kubernetes.io/name: {{ include "a1mediator.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/name: {{ include "a1mediator.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ spec:
+ imagePullSecrets:
+ - name: {{ include "common.repositoryCred" . }}
+ containers:
+ - name: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+ volumeMounts:
+ - name: a1conf
+ mountPath: /opt/ricmanifest.json
+ subPath: ricmanifest.json
+ - name: a1conf
+ mountPath: /opt/rmr_string_int_mapping.txt
+ subPath: rmr_string_int_mapping.txt
+ - name: a1conf
+ mountPath: /opt/route/local.rt
+ subPath: local.rt
+ env:
+ - name: PYTHONUNBUFFERED
+ value: "0"
+ - name: RMR_RCV_RETRY_INTERVAL
+ value: "{{ .Values.rmr_timeout_config.rcv_retry_interval_ms }}"
+ - name: RMR_RETRY_TIMES
+ value: "{{ .Values.rmr_timeout_config.rcv_retry_times }}"
+ image: {{ include "common.repository" . }}/{{ .Values.a1mediator.image.name }}:{{ .Values.a1mediator.image.tag }}
+ imagePullPolicy: {{ include "common.pullPolicy" . }}
+ ports:
+ - name: http
+ containerPort: {{ .Values.httpservice.port }}
+ protocol: TCP
+
+ livenessProbe:
+ httpGet:
+ path: /ui
+ port: http
+ readinessProbe:
+ httpGet:
+ path: /ui
+ port: http
+ resources:
+ {{- toYaml .Values.resources | nindent 12 }}
+ volumes:
+ - name: "a1conf"
+ configMap:
+ name: "a1conf"
--- /dev/null
+apiVersion: extensions/v1beta1
+kind: Ingress
+metadata:
+ name: ric-ingress-a1mediator
+spec:
+ rules:
+ - http:
+ paths:
+ - path: /a1mediator
+ backend:
+ serviceName: {{ include "a1mediator.fullname" . }}
+ servicePort: {{ .Values.httpservice.port }}
\ No newline at end of file
--- /dev/null
+# This is the service for A1's external facing HTTP API
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "common.servicename.a1mediator" . }}
+ labels:
+ app.kubernetes.io/name: {{ include "common.fullname.a1mediator" . }}
+ helm.sh/chart: {{ include "common.chart" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+ {{- if .Chart.AppVersion }}
+ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+ {{- end }}
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
+
+spec:
+ type: {{ .Values.httpservice.type }}
+ ports:
+ - port: {{ .Values.httpservice.port }}
+ targetPort: http
+ protocol: TCP
+ name: http
+ selector:
+ app.kubernetes.io/name: {{ include "a1mediator.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+
+---
+# This is the service for rmr between A1 and the xapps
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ .Values.rmrservice.name }}
+ labels:
+{{ include "a1mediator.labels" . | indent 4 }}
+
+spec:
+ type: {{ .Values.rmrservice.type }}
+ ports:
+ - port: {{ .Values.rmrservice.port }}
+ targetPort: {{ .Values.rmrservice.port }}
+ protocol: TCP
+ selector:
+ app.kubernetes.io/name: {{ include "a1mediator.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+
+---
+# This is the service for the "hidden" port 4561 that rmr listens on for route manager
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ .Values.rmrrtemgrservice.name }}
+ labels:
+{{ include "a1mediator.labels" . | indent 4 }}
+
+spec:
+ type: {{ .Values.rmrrtemgrservice.type }}
+ ports:
+ - port: {{ .Values.rmrrtemgrservice.port }}
+ targetPort: {{ .Values.rmrrtemgrservice.port }}
+ protocol: TCP
+ selector:
+ app.kubernetes.io/name: {{ include "a1mediator.name" . }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
--- /dev/null
+apiVersion: v1
+kind: Pod
+metadata:
+ name: "{{ include "a1mediator.fullname" . }}-test-connection"
+ labels:
+{{ include "a1mediator.labels" . | indent 4 }}
+ annotations:
+ "helm.sh/hook": test-success
+spec:
+ containers:
+ - name: wget
+ image: busybox
+ command: ['wget']
+ args: ['{{ include "a1mediator.fullname" . }}:{{ .Values.httpservice.port }}']
+ restartPolicy: Never
--- /dev/null
+a1mediator:
+ replicaCount: 1
+
+ image:
+ repository: nexus3.o-ran-sc.org:10004
+ name: ric-plt-a1
+ tag: 0.8.2
+ pullPolicy: IfNotPresent
+
+
+# This is the service for A1's external facing HTTP API
+httpservice:
+ port: 10000 # This is hardcoded in a1, probably dangerous to change
+ type: ClusterIP
+
+# This is the service for rmr between A1 and the xapps
+rmrservice:
+ name: rmrservice
+ port: 4562 # This is hardcoded in a1, probably dangerous to change
+ type: ClusterIP
+
+# This is the service for the "hidden" port 4561 that rmr listens on for route manager
+rmrrtemgrservice:
+ name: rmrrtemgrservice
+ port: 4561 # This is hardcoded in rmr, probably dangerous to change
+ type: ClusterIP
+
+# these are ENV variables that A1 takes; see docs
+rmr_timeout_config:
+ rcv_retry_interval_ms: 500
+ rcv_retry_times: 20
+
--- /dev/null
+NAME: xappmgr
+DBAAS_SERVICE_HOST: __DBAAS_SERVICE_HOST__
+DBAAS_SERVICE_PORT: "6379"
+DBAAS_PORT_6379_TCP_ADDR: __DBAAS_SERVICE_HOST__
+DBAAS_PORT_6379_TCP_PORT: "6379"
--- /dev/null
+"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_NAMESPACE__
+ "tiller-port": __TILLER_PORT__
+ # helm username and password files
+ "helm-username-file": "/opt/ric/secret/helm_repo_username"
+ "helm-password-file": "/opt/ric/secret/helm_repo_password"
+ "retry": 1
+"xapp":
+ #Namespace to install xAPPs
+ "namespace": "ricxapp"
+ "tarDir": "/tmp"
+ "schema": "descriptors/schema.json"
+ "config": "config/config-file.json"
+ "tmpConfig": "/tmp/config-file.json"
+++ /dev/null
-"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__
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ include "appmgr.fullname" . }}-appconfig
+ name: {{ include "common.configmapname.appmgr" . }}-appconfig
data:
- {{- $restport := default ":8080" (printf ":%.0f" .Values.appmgr.containerPort) | quote -}}
- {{- $helmrepo := include "common.helmrepository" . | quote -}}
- {{- $reponame := default "helm-repo" .Values.appmgr.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 }}
+ {{- $restport := default ":8080" (printf ":%.0f" .Values.appmgr.containerPort) | quote -}}
+ {{- $helmrepo := include "common.helmrepository" . | quote -}}
+ {{- $reponame := default "helm-repo" .Values.appmgr.reponame | quote -}}
+ {{- $tiller := include "common.helmrepositorytiller" . | quote -}}
+ {{- $tillernamespace := include "common.helmrepositorytillernamespace" . | quote -}}
+ {{- $tillerport := include "common.helmrepositorytillerport" . | quote -}}
+ {{- (.Files.Glob "resources/appmgr.yaml").AsConfig | replace "__HELM_REPO__" $helmrepo | replace "__REST_PORT__" $restport | replace "__REPO_NAME__" $reponame | replace "__TILLER_SERVICE__" $tiller | replace "__TILLER_NAMESPACE__" $tillernamespace | replace "__TILLER_PORT__" $tillerport | nindent 2 }}
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ include "appmgr.fullname" . }}-appenv
+ name: {{ include "common.configmapname.appmgr" . }}-appenv
data:
- {{- with .Values.appmgr.appenv }}
- {{- toYaml . | nindent 2 }}
- {{- end }}
+ {{- $dbaasservicehost := include "common.servicename.dbaas" . | quote -}}
+ {{- (.Files.Get "resources/appenv.yaml") | replace "__DBAAS_SERVICE_HOST__" $dbaasservicehost | nindent 2 }}
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "appmgr.fullname" . }}
+ name: {{ include "common.deploymentname.appmgr" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
matchLabels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
release: {{ .Release.Name }}
- #app.kubernetes.io/name: {{ include "appmgr.name" . }}
- #app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
protocol: TCP
volumeMounts:
- name: config-volume
- mountPath: {{ .Values.appmgr.appconfigpath }}
+ mountPath: {{ .Values.appmgr.appconfigpath }}/appmgr.yaml
+ subPath: appmgr.yaml
- name: secret-volume
mountPath: {{ .Values.appmgr.appsecretpath }}
- name: cert-volume
mountPath: {{ .Values.appmgr.appcertpath }}
envFrom:
- configMapRef:
- name: {{ include "appmgr.fullname" . }}-appenv
+ name: {{ include "common.configmapname.appmgr" . }}-appenv
livenessProbe:
#exec:
# command:
volumes:
- name: config-volume
configMap:
- name: {{ include "appmgr.fullname" . }}-appconfig
+ name: {{ include "common.configmapname.appmgr" . }}-appconfig
- name: secret-volume
secret:
secretName: {{ include "common.helmrepositorycred" . }}
--- /dev/null
+apiVersion: extensions/v1beta1
+kind: Ingress
+metadata:
+ name: ric-ingress-appmgr
+spec:
+ rules:
+ - http:
+ paths:
+ - path: /appmgr
+ backend:
+ serviceName: {{ include "appmgr.fullname" . }}
+ servicePort: {{ .Values.appmgr.service.port }}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
- name: {{ include "appmgr.fullname" . }}
+ name: {{ include "common.servicename.appmgr" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
################################################################################
repository: "nexus3.o-ran-sc.org:10004"
+#repositoryOverride: "nexus3.o-ran-sc.org:10004"
imagePullPolicy: IfNotPresent
repositoryCred: docker-reg-cred
-
# 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"
+helmRepository: "https://helm.ricinfra.local:31000"
# Default secret name for Helm Repo credential. .Value.golbal.helmRepositoryCred will
# override the default value. You can further override uing
# Helm Tiller port for xApp
# The global setting will override this default value
# You can further override using helmRepositoryTillerPortOverride: ""
-helmRepositoryTillerPort: "44134"
+helmRepositoryTillerPort: 44134
# Uncomment the following line to override the docker registry
#repositoryOverride: ""
appmgr:
image:
# xAppmanager Docker image name and tag
- name: xapp-manager
- tag: latest
+ name: ric-plt-appmgr
+ tag: 0.1.3
# This section describes xAppManager
replicaCount: 1
reponame: "helm-repo"
service:
- type: NodePort
+ type: ClusterIP
port: 8080
name: appmgr-service
protocol: "TCP"
- export: 30020
+ extport: 30020
# config
# Path referred in xapp-manager for retrieving configuration details
appconfigpath: /opt/ric/config
- # To be provided as env variables
- appenv:
- NAME: xappmgr
- #ENV1: "envvalue1"
- #ENV2: "envvalue2"
# secret
# Path referred in xapp-manager for retrieving helm repo secrets
# limitations under the License. #
################################################################################
-{{/*
- Resolve the name of a chart's service.
- The default will be the chart name (or .Values.nameOverride if set).
- And the use of .Values.service.name overrides all.
-
- - .Values.service.name : override default service (ie. chart) name
-*/}}
-{{/*
- Expand the service name for a chart.
-*/}}
-{{- define "common.servicename" -}}
- {{- $name := default .Chart.Name .Values.nameOverride -}}
- {{- default $name .Values.service.name | trunc 63 | trimSuffix "-" -}}
+{{- define "common.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
# limitations under the License. #
################################################################################
-{{/* vim: set filetype=mustache: */}}
{{/*
-Expand the name of the chart.
+ Resolve the name of a chart's configmap.
+
*/}}
-{{- define "appmgr.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+
+
+{{- define "common.configmapname.appmgr" -}}
+ {{- $name := ( include "common.fullname.appmgr" . ) -}}
+ {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
-{{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "appmgr.fullname" -}}
-{{- if .Values.fullnameOverride -}}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- $name := default .Chart.Name .Values.nameOverride -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- define "common.configmapname.dbaas" -}}
+ {{- $name := ( include "common.fullname.dbaas" . ) -}}
+ {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}:
+
+{{- define "common.configmapname.e2mgr" -}}
+ {{- $name := ( include "common.fullname.e2mgr" . ) -}}
+ {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+{{- define "common.configmapname.e2term" -}}
+ {{- $name := ( include "common.fullname.e2term" . ) -}}
+ {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+{{- define "common.configmapname.rtmgr" -}}
+ {{- $name := ( include "common.fullname.rtmgr" . ) -}}
+ {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "appmgr.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- define "common.configmapname.a1mediator" -}}
+ {{- $name := ( include "common.fullname.a1mediator" . ) -}}
+ {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
# limitations under the License. #
################################################################################
-{{/* vim: set filetype=mustache: */}}
{{/*
-Expand the name of the chart.
+ Resolve the name of a chart's deployment.
*/}}
-{{- define "rtmgr.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+
+
+{{- define "common.deploymentname.appmgr" -}}
+ {{- $name := ( include "common.fullname.appmgr" . ) -}}
+ {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
-{{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "rtmgr.fullname" -}}
-{{- if .Values.fullnameOverride -}}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- $name := default .Chart.Name .Values.nameOverride -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- define "common.deploymentname.dbaas" -}}
+ {{- $name := ( include "common.fullname.dbaas" . ) -}}
+ {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "common.deploymentname.e2mgr" -}}
+ {{- $name := ( include "common.fullname.e2mgr" . ) -}}
+ {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+{{- define "common.deploymentname.e2term" -}}
+ {{- $name := ( include "common.fullname.e2term" . ) -}}
+ {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+{{- define "common.deploymentname.rtmgr" -}}
+ {{- $name := ( include "common.fullname.rtmgr" . ) -}}
+ {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "rtmgr.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- define "common.deploymentname.a1mediator" -}}
+ {{- $name := ( include "common.fullname.a1mediator" . ) -}}
+ {{- printf "deployment-%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+
*/}}
{{- define "common.helmrepositorytillerport" -}}
{{- if .Values.helmRepositoryTillerPortOverride -}}
- {{- printf "%s" .Values.helmRepositoryTillerPortOverride -}}
+ {{- printf "%.0f" .Values.helmRepositoryTillerPortOverride -}}
{{- else -}}
{{- if .Values.global -}}
{{- if .Values.global.helmRepositoryTillerPort -}}
- {{- printf "%s" .Values.global.helmRepositoryTillerPort -}}
+ {{- printf "%.0f" .Values.global.helmRepositoryTillerPort -}}
{{- else -}}
- {{- printf "%s" .Values.helmRepositoryTillerPort -}}
+ {{- printf "%.0f" .Values.helmRepositoryTillerPort -}}
{{- end -}}
{{- else -}}
- {{- printf "%s" .Values.helmRepositoryTillerPort -}}
+ {{- printf "%.0f" .Values.helmRepositoryTillerPort -}}
{{- end -}}
{{- end -}}
{{- end -}}
+
+{{/*
+Generate certificates for the helm repo
+*/}}
+{{- define "common.helmrepository.gen-certs" -}}
+{{- $altNames := list ( printf "helm.%s" .Values.ingress.hostpostfix ) -}}
+{{- $ca := genCA "helm-repository-ca" 365 -}}
+{{- $cert := genSignedCert ( include "nexus.name" . ) nil $altNames 365 $ca -}}
+tls.crt: {{ $cert.Cert | b64enc }}
+tls.key: {{ $cert.Key | b64enc }}
+{{- end -}}
+
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+
+{{/*
+ Resolve the ingress controller addresses.
+*/}}
+{{- define "common.ingressurl.ricplt" -}}
+ {{- if .Values.kongplatform -}}
+ {{- if .Values.kongplatform.ingressurlOverride -}}
+ {{- printf "%s" .Values.kongplatform.ingressurlOverride -}}
+ {{- else -}}
+ {{- printf "ricplt-entry" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "ricplt-entry" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+{{- define "common.ingresshttpport.ricplt" -}}
+ {{- if .Values.kongplatform -}}
+ {{- if .Values.kongplatform.ingresshttpportOverride -}}
+ {{- printf "%.0f" .Values.kongplatform.ingresshttpportOverride -}}
+ {{- else -}}
+ {{- printf "30080" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "30080" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+{{- define "common.ingresshttpsport.ricplt" -}}
+ {{- if .Values.kongplatform -}}
+ {{- if .Values.kongplatform.ingresshttpsportOverride -}}
+ {{- printf "%.0f" .Values.kongplatform.ingresshttpsportOverride -}}
+ {{- else -}}
+ {{- printf "30443" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "30443" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{{- define "common.ingressurl.ricxapp" -}}
+ {{- if .Values.kongxapp -}}
+ {{- if .Values.kongxapp.ingressurlOverride -}}
+ {{- printf "%s" .Values.kongxapp.ingressurlOverride -}}
+ {{- else -}}
+ {{- printf "ricxapp-entry" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "ricxapp-entry" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+{{- define "common.ingresshttpport.ricxapp" -}}
+ {{- if .Values.kongxapp -}}
+ {{- if .Values.kongxapp.ingresshttpportOverride -}}
+ {{- printf "%.0f" .Values.kongxapp.ingresshttpportOverride -}}
+ {{- else -}}
+ {{- printf "31080" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "31080" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+{{- define "common.ingresshttpsport.ricxapp" -}}
+ {{- if .Values.kongxapp -}}
+ {{- if .Values.kongxapp.ingresshttpsportOverride -}}
+ {{- printf "%.0f" .Values.kongxapp.ingresshttpsportOverride -}}
+ {{- else -}}
+ {{- printf "31443" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "31443" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{{- define "common.ingressurl.ricaux" -}}
+ {{- if .Values.kongaux -}}
+ {{- if .Values.kongaux.ingressurlOverride -}}
+ {{- printf "%s" .Values.kongaux.ingressurlOverride -}}
+ {{- else -}}
+ {{- printf "ricaux-entry" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "ricaux-entry" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+
+
+{{- define "common.ingresshttpport.ricaux" -}}
+ {{- if .Values.kongaux -}}
+ {{- if .Values.kongaux.ingresshttpportOverride -}}
+ {{- printf "%.0f" .Values.kongaux.ingresshttpportOverride -}}
+ {{- else -}}
+ {{- printf "32080" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "32080" -}}
+ {{- end -}}
+{{- end -}}
+
+
+
+{{- define "common.ingresshttpsport.ricaux" -}}
+ {{- if .Values.kongaux -}}
+ {{- if .Values.kongaux.ingresshttpsportOverride -}}
+ {{- printf "%.0f" .Values.kongaux.ingresshttpsportOverride -}}
+ {{- else -}}
+ {{- printf "32443" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "32443" -}}
+ {{- end -}}
+{{- end -}}
+
################################################################################
{{/*
- Expand the name of a chart.
+ This is the root file that define the name of each component. Value here will be used to define other K8S resource name.
*/}}
+
+
+
+{{- define "common.name.appmgr" -}}
+ {{- if .Values.appmgr -}}
+ {{- if .Values.appmgr.nameOverride -}}
+ {{- printf "%s" .Values.appmgr.nameOverride -}}
+ {{- else -}}
+ {{- printf "appmgr" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "appmgr" -}}
+ {{- end -}}
+{{- end -}}
+
+{{- define "common.fullname.appmgr" -}}
+ {{- $name := ( include "common.name.appmgr" . ) -}}
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+{{- define "common.name.dbaas" -}}
+ {{- if .Values.dbaas -}}
+ {{- if .Values.dbaas.nameOverride -}}
+ {{- printf "%s" .Values.dbaas.nameOverride -}}
+ {{- else -}}
+ {{- printf "dbaas" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "dbaas" -}}
+ {{- end -}}
+{{- end -}}
+
+{{- define "common.fullname.dbaas" -}}
+ {{- $name := ( include "common.name.dbaas" . ) -}}
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+
+
+
+
+
+
+
+
+
+{{- define "common.name.e2mgr" -}}
+ {{- if .Values.e2mgr -}}
+ {{- if .Values.e2mgr.nameOverride -}}
+ {{- printf "%s" .Values.e2mgr.nameOverride -}}
+ {{- else -}}
+ {{- printf "e2mgr" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "e2mgr" -}}
+ {{- end -}}
+{{- end -}}
+
+
+{{- define "common.fullname.e2mgr" -}}
+ {{- $name := ( include "common.name.e2mgr" . ) -}}
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "common.name.e2term" -}}
+ {{- if .Values.e2term -}}
+ {{- if .Values.e2term.nameOverride -}}
+ {{- printf "%s" .Values.e2term.nameOverride -}}
+ {{- else -}}
+ {{- printf "e2term" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "e2term" -}}
+ {{- end -}}
+{{- end -}}
+
+
+{{- define "common.fullname.e2term" -}}
+ {{- $name := ( include "common.name.e2term" . ) -}}
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+
+
+
+
+
+
+
+{{- define "common.name.rtmgr" -}}
+ {{- if .Values.rtmgr -}}
+ {{- if .Values.rtmgr.nameOverride -}}
+ {{- printf "%s" .Values.rtmgr.nameOverride -}}
+ {{- else -}}
+ {{- printf "rtmgr" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "rtmgr" -}}
+ {{- end -}}
+{{- end -}}
+
+
+{{- define "common.fullname.rtmgr" -}}
+ {{- $name := ( include "common.name.rtmgr" . ) -}}
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+
+
+
+
+{{- define "common.name.a1mediator" -}}
+ {{- if .Values.a1mediator -}}
+ {{- if .Values.a1mediator.nameOverride -}}
+ {{- printf "%s" .Values.a1mediator.nameOverride -}}
+ {{- else -}}
+ {{- printf "a1mediator" -}}
+ {{- end -}}
+ {{- else -}}
+ {{- printf "a1mediator" -}}
+ {{- end -}}
+{{- end -}}
+
+
+{{- define "common.fullname.a1mediator" -}}
+ {{- $name := ( include "common.name.a1mediator" . ) -}}
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+
+
+
+
+
+
{{- define "common.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
- .Values.repositoryOverride : override global and default image repository on a per image basis
*/}}
{{- define "common.repository" -}}
- {{- if .Values.repositoryOverride -}}
- {{- printf "%s" .Values.repositoryOverride -}}
+ {{- $componentname := .Chart.Name -}}
+ {{- $firsttier := (index .Values (printf "%s" $componentname)) -}}
+ {{- if $firsttier -}}
+ {{- $secondtier := (index .Values (printf "%s" $componentname) (printf "%s" "repositoryOverride")) -}}
+ {{- if $secondtier -}}
+ {{- printf "%s" $secondtier -}}
+ {{- 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 -}}
{{- else -}}
{{- if .Values.global -}}
{{- if .Values.global.repository -}}
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+
+{{/*
+ Resolve the name of a chart's service.
+
+ The default will be the chart name (or .Values.nameOverride if set).
+ And the use of .Values.service.name overrides all.
+
+ - .Values.service.name : override default service (ie. chart) name
+*/}}
+{{/*
+ Expand the service name for a chart.
+*/}}
+
+
+{{- define "common.servicename.appmgr" -}}
+ {{- $name := ( include "common.fullname.appmgr" . ) -}}
+ {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "common.servicename.dbaas" -}}
+ {{- $name := ( include "common.fullname.dbaas" . ) -}}
+ {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "common.servicename.e2mgr" -}}
+ {{- $name := ( include "common.fullname.e2mgr" . ) -}}
+ {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "common.servicename.e2term" -}}
+ {{- $name := ( include "common.fullname.e2term" . ) -}}
+ {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "common.servicename.rtmgr" -}}
+ {{- $name := ( include "common.fullname.rtmgr" . ) -}}
+ {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "common.servicename.a1mediator" -}}
+ {{- $name := ( include "common.fullname.a1mediator" . ) -}}
+ {{- printf "service-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "dbaas.fullname" . }}
+ name: {{ include "common.deploymentname.dbaas" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
apiVersion: v1
kind: Service
metadata:
- name: {{ include "dbaas.fullname" . }}
+ name: {{ include "common.servicename.dbaas" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ include "e2mgr.fullname" . }}-router-configmap
+ name: {{ include "common.configmapname.e2mgr" . }}-router-configmap
namespace: {{ include "common.namespace" . }}
data:
router.txt: |
newrt|start
- rte|1001|ric-full-e2term:38000
- rte|2002|{{ include "e2mgr.fullname" .}}:3801
+ rte|1001|{{ include "common.servicename.e2term" .}}:38000
+ rte|2002|{{ include "common.servicename.e2mgr" .}}:3801
newrt|end
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "e2mgr.fullname" .}}
+ name: {{ include "common.deploymentname.e2mgr" .}}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
volumes:
- name: local-router-file
configMap:
- name: {{ include "e2mgr.fullname" . }}-router-configmap
+ name: {{ include "common.configmapname.e2mgr" . }}-router-configmap
--- /dev/null
+apiVersion: extensions/v1beta1
+kind: Ingress
+metadata:
+ name: ric-ingress-e2mgr
+spec:
+ rules:
+ - http:
+ paths:
+ - path: /e2mgr
+ backend:
+ serviceName: {{ include "common.servicename.e2mgr" . }}
+ servicePort: {{ .Values.e2mgr.service.http.port }}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
- name: {{ include "e2mgr.fullname" . }}
+ name: {{ include "common.servicename.e2mgr" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
RMR_RTG_SVC: "ric-full-rtmgr"
service:
- type: NodePort
+ type: ClusterIP
http:
port: 3800
target_port: 3800
+++ /dev/null
-################################################################################
-# Copyright (c) 2019 AT&T Intellectual Property. #
-# Copyright (c) 2019 Nokia. #
-# #
-# Licensed under the Apache License, Version 2.0 (the "License"); #
-# you may not use this file except in compliance with the License. #
-# You may obtain a copy of the License at #
-# #
-# http://www.apache.org/licenses/LICENSE-2.0 #
-# #
-# Unless required by applicable law or agreed to in writing, software #
-# distributed under the License is distributed on an "AS IS" BASIS, #
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
-# See the License for the specific language governing permissions and #
-# limitations under the License. #
-################################################################################
-{{/* vim: set filetype=mustache: */}}
-{{/*
-Expand the name of the chart.
-*/}}
-{{- define "e2term.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-
-{{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "e2term.fullname" -}}
-{{- if .Values.fullnameOverride -}}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- $name := default .Chart.Name .Values.nameOverride -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "e2term.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ include "e2term.fullname" . }}-router-configmap
+ name: {{ include "common.configmapname.e2term" . }}-router-configmap
namespace: {{ include "common.namespace" . }}
data:
router.txt: |
newrt|start
- rte|1001|{{ include "e2term.fullname" . }}:38000
- rte|2002|ric-full-e2mgr:3801
+ rte|1001|{{ include "common.configmapname.e2term" . }}:38000
+ rte|2002|{{ include "common.configmapname.e2mgr" . }}:3801
newrt|end
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "e2term.fullname" . }}
+ name: {{ include "common.deploymentname.e2term" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
volumes:
- name: local-router-file
configMap:
- name: {{ include "e2term.fullname" . }}-router-configmap
+ name: {{ include "common.configmapname.e2term" . }}-router-configmap
apiVersion: v1
kind: Service
metadata:
- name: {{ include "e2term.fullname" . }}
+ name: {{ include "common.servicename.e2term" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
--- /dev/null
+# 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/
--- /dev/null
+apiVersion: v1
+appVersion: "1.0"
+description: A Helm chart for Kubernetes
+name: kong_platform
+version: 1.0.0
--- /dev/null
+################################################################################
+# 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: kong
+ repository: '@stable'
+ version: ~0.12.2
\ No newline at end of file
--- /dev/null
+# Default values for kong_platform.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+kong:
+ ingressController:
+ enabled: true
+
+ postgresql:
+ enabled: false
+
+ env:
+ database: "off"
+
+ proxy:
+ http:
+ nodePort: 30080
+ tls:
+ nodePort: 30443
\ No newline at end of file
--- /dev/null
+# 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/
--- /dev/null
+apiVersion: v1
+appVersion: "1.0"
+description: A Helm chart for Kubernetes
+name: kong_xapp
+version: 1.0.0
--- /dev/null
+################################################################################
+# 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: kong
+ repository: '@stable'
+ version: ~0.12.2
\ No newline at end of file
--- /dev/null
+apiVersion: extensions/v1beta1
+kind: Ingress
+metadata:
+ name: ric-ingress-xapp
+spec:
+ rules:
+ - http:
+ paths:
+ - path: /anr
+ backend:
+ serviceName: r0-xapp-anr
+ servicePort: 9999
\ No newline at end of file
--- /dev/null
+# Default values for kong_platform.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+kong:
+ ingressController:
+ enabled: true
+ installCRDs: false
+
+ postgresql:
+ enabled: false
+
+ env:
+ database: "off"
+
+ proxy:
+ http:
+ nodePort: 31080
+ tls:
+ nodePort: 31443
+
+
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "rtmgr.fullname" . }}
+ name: {{ include "common.deploymentname.rtmgr" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
apiVersion: v1
kind: Service
metadata:
- name: {{ include "rtmgr.fullname" . }}
+ name: {{ include "common.servicename.rtmgr" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
--- /dev/null
+{
+ "local": {
+ "host": ":8080"
+ },
+ "logger": {
+ "level": 3
+ },
+ "rmr": {
+ "protPort": "tcp:4560",
+ "maxSize": 2072,
+ "numWorkers": 1,
+ "txMessages": ["RIC_X2_LOAD_INFORMATION"],
+ "rxMessages": ["RIC_X2_LOAD_INFORMATION"]
+ },
+ "db": {
+ "namespace": "ricxapp",
+ "host": "dbaas",
+ "port": 6379
+ }
+}
--- /dev/null
+{
+ "definitions": {},
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$id": "http://example.com/root.json",
+ "type": "object",
+ "title": "The Root Schema",
+ "required": [
+ "local",
+ "logger",
+ "rmr",
+ "db"
+ ],
+ "properties": {
+ "local": {
+ "$id": "#/properties/local",
+ "type": "object",
+ "title": "The Local Schema",
+ "required": [
+ "host"
+ ],
+ "properties": {
+ "host": {
+ "$id": "#/properties/local/properties/host",
+ "type": "string",
+ "title": "The Host Schema",
+ "default": "",
+ "examples": [
+ ":8080"
+ ],
+ "pattern": "^(.*)$"
+ }
+ }
+ },
+ "logger": {
+ "$id": "#/properties/logger",
+ "type": "object",
+ "title": "The Logger Schema",
+ "required": [
+ "level"
+ ],
+ "properties": {
+ "level": {
+ "$id": "#/properties/logger/properties/level",
+ "type": "integer",
+ "title": "The Level Schema",
+ "default": 0,
+ "examples": [
+ 3
+ ]
+ }
+ }
+ },
+ "rmr": {
+ "$id": "#/properties/rmr",
+ "type": "object",
+ "title": "The Rmr Schema",
+ "required": [
+ "protPort",
+ "maxSize",
+ "numWorkers",
+ "txMessages",
+ "rxMessages"
+ ],
+ "properties": {
+ "protPort": {
+ "$id": "#/properties/rmr/properties/protPort",
+ "type": "string",
+ "title": "The Protport Schema",
+ "default": "",
+ "examples": [
+ "tcp:4560"
+ ],
+ "pattern": "^(.*)$"
+ },
+ "maxSize": {
+ "$id": "#/properties/rmr/properties/maxSize",
+ "type": "integer",
+ "title": "The Maxsize Schema",
+ "default": 0,
+ "examples": [
+ 2072
+ ]
+ },
+ "numWorkers": {
+ "$id": "#/properties/rmr/properties/numWorkers",
+ "type": "integer",
+ "title": "The Numworkers Schema",
+ "default": 0,
+ "examples": [
+ 1
+ ]
+ },
+ "txMessages": {
+ "$id": "#/properties/rmr/properties/txMessages",
+ "type": "array",
+ "title": "The Txmessages Schema"
+ },
+ "rxMessages": {
+ "$id": "#/properties/rmr/properties/rxMessages",
+ "type": "array",
+ "title": "The Rxmessages Schema"
+ }
+ }
+ },
+ "db": {
+ "$id": "#/properties/db",
+ "type": "object",
+ "title": "The Db Schema",
+ "required": [
+ "host",
+ "namespace",
+ "port"
+ ],
+ "properties": {
+ "host": {
+ "$id": "#/properties/db/properties/host",
+ "type": "string",
+ "title": "The Host Schema",
+ "default": "",
+ "examples": [
+ "dbaas"
+ ],
+ "pattern": "^(.*)$"
+ },
+ "namespace": {
+ "$id": "#/properties/db/properties/namespace",
+ "type": "string",
+ "title": "The Namespace Schema",
+ "default": "",
+ "examples": [
+ "ricxapp"
+ ],
+ "pattern": "^(.*)$"
+ },
+ "port": {
+ "$id": "#/properties/db/properties/port",
+ "type": "integer",
+ "title": "The Port Schema",
+ "default": 0,
+ "examples": [
+ 6379
+ ]
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
-################################################################################
-# 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. #
-################################################################################
+#
+# ==================================================================================
+# Copyright (c) 2019 Nokia
+# ==================================================================================
+#
+
+{{ if (eq .Values.ricapp.appconfig.override "") }}
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ .Release.Name }}-appconfig
+ name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }}
data:
- {{- with .Values.ricapp.appconfig }}
- {{- toYaml . | nindent 2 }}
- {{- end }}
-
+{{ (.Files.Glob "config/*").AsConfig | indent 2 }}
+{{ end }}
-################################################################################
-# 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. #
-################################################################################
+#
+# ==================================================================================
+# Copyright (c) 2019 Nokia
+# ==================================================================================
+#
+
apiVersion: apps/v1
kind: Deployment
metadata:
app.kubernetes.io/name: {{ include "ricapp.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
- imagePullSecrets:
- - name: {{ .Release.Name }}-docker-registry-key
+ hostname: {{ .Values.ricapp.hostname }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.global.repository }}/{{ .Values.ricapp.image.name }}:{{ .Values.ricapp.image.tag }}"
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
- # enable the next two elements if wanting to test pod bypassing its own entrypoint
- #command: ["sh"]
- #args:
- # - -c
- # - "while sleep 2; do echo thinking; done"
ports:
- name: http
- containerPort: 8080
+ containerPort: {{ .Values.ricapp.service.port }}
+ protocol: TCP
+ - name: rmr
+ containerPort: {{ .Values.ricapp.service.rmrPort }}
protocol: TCP
volumeMounts:
- name: config-volume
- mountPath: {{ .Values.ricapp.appconfigpath }}
- - name: secret-volume
- mountPath: {{ .Values.ricapp.appsecretpath }}
- envFrom:
- - configMapRef:
- name: {{ .Release.Name }}-appenv
+ mountPath: {{ .Values.ricapp.appconfig.path }}
+ - name: cert-volume
+ mountPath: {{ .Values.ricapp.cert.path }}
livenessProbe:
- exec:
- command:
- - /bin/bash
- - -c
- - ps -ef | grep {{ .Values.ricapp.livenessprocessname }}| grep -v "grep"
- initialDelaySeconds: 120
- periodSeconds: 30
+ httpGet:
+ path: {{ .Values.ricapp.probes.healthAliveCheckEndpoint }}
+ port: 8080
+ initialDelaySeconds: 5
+ periodSeconds: 15
readinessProbe:
httpGet:
- path: /
- port: http
+ path: {{ .Values.ricapp.probes.healthReadyCheckEndpoint }}
+ port: 8080
+ initialDelaySeconds: 5
+ periodSeconds: 15
restartPolicy: Always
resources:
- {{- toYaml .Values.resources | nindent 12 }}
+ {{- toYaml .Values.ricapp.resources | nindent 12 }}
securityContext:
# ubuntu
- runAsUser: 1000
- allowPrivilegeEscalation: false
- {{- with .Values.nodeSelector }}
+ #runAsUser: 1000
+ #allowPrivilegeEscalation: false
+ {{- with .Values.ricapp.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
- {{- with .Values.affinity }}
+ {{- with .Values.ricapp.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
- {{- with .Values.tolerations }}
+ {{- with .Values.ricapp.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config-volume
configMap:
- name: {{ .Release.Name }}-appconfig
- - name: secret-volume
- secret:
- secretName: {{ .Release.Name }}-appsecret
+ name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }}
+ - name: cert-volume
+ emptyDir: {}
# limitations under the License. #
################################################################################
-{{- if .Values.ricapp.enabled }}
+{{ if .Values.ricapp.service.enabled }}
apiVersion: v1
kind: Service
metadata:
- name: {{ include "ricapp.fullname" . }}
+ name: {{ include "ricapp.name" . }}
labels:
app.kubernetes.io/name: {{ include "ricapp.name" . }}
helm.sh/chart: {{ include "ricapp.chart" . }}
selector:
app.kubernetes.io/name: {{ include "ricapp.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
-{{ end }}
+{{ end }}
\ No newline at end of file
global:
# modify this section to point to your local testing settings
- repository: "snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001"
+ repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}"
repositoryCred:
- user: docker
- password: docker
+ user: "${__RUNRICENV_DOCKER_USER__}"
+ password: "${__RUNRICENV_DOCKER_PASS__}"
image:
pullPolicy: IfNotPresent
ricplt:
# This section is reserved for values imported from RIC Platform charts
-
ricapp:
- # This section is for xapp. Templates to be resolved from xApp descriptor
+ # This section is for xapp. Templates to be resolved from xApp descriptor
replicaCount: 1
- xappname: &anchor-xappname xapp-std
+ name: xapp-std
+ fullname: xapp-std
+ nameOverride: ""
+ fullnameOverride: ""
- # the name of the process that indicates the liveness of the component
- liveness-process-name: xapp-std
+ # The name of the process that indicates the liveness of the component
+ livenessprocessname: xapp-std
image:
- name: whoami
- tag: 0.0.1
-
- nameOverride: ""
- fullnameOverride: ""
+ name: xapp-std
+ tag: latest
service:
- enabled: false
+ enabled: true
+ type: ClusterIP
+ name: xapp-std-service
+ port: 8080
+ rmrPort: 4560
+ probes:
+ healthAliveCheckEndpoint: ric/v1/health/alive
+ healthReadyCheckEndpoint: ric/v1/health/ready
- # to be provided as property file
- appconfigpath: /opt/etc/xapp
appconfig:
- # to be present as file propfile1 under appconfigpath
- propfile1: |
- prop1.v1="propvalue1.1"
- prop1.v2="propvalue1.2"
- # to be present as file propfile2 under appconfigpath
- propfile2: "prop2"
+ path: /opt/ric/config
+ override: ""
- # to be provided as env variables
- appenv:
- NAME: *anchor-xappname
- ENV1: "envvalue1"
- ENV2: "envvalue2"
+ cert:
+ path: /opt/ric/certificates
+ object: {}
- # secret
- appsecretpath: /opt/etc/kube
- appsecret:
- # to be present as files under path appsecretpath
- username: myusername
- password: mypassword
-
+ hostname: xapp-std
resources: {}
- # limits:
- # cpu: 100m
- # memory: 128Mi
- # requests:
- # cpu: 100m
- # memory: 128Mi
nodeSelector: {}
--- /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. #
+################################################################################
+
+if (( $# != 1 )); then
+ echo "Missing parameters: <xapp-name>"
+ exit
+fi
+
+source ./scripts/ric_env.sh
+if [ -z $__RICENV_SET__ ]; then
+ echo "Edit your ric_env.sh for first!"
+ exit
+fi
+
+# Update the local values
+RESULT_DIR=./generated
+rm -rf $RESULT_DIR && mkdir -p $RESULT_DIR && cp -rf ./helm $RESULT_DIR
+
+FILELIST=$(find ./helm \( -name "*.tpl" -o -name "*.yaml" \))
+for f in $FILELIST; do
+ envsubst '${__RUNRICENV_DOCKER_HOST__} ${__RUNRICENV_DOCKER_PORT__}' < $f > "$RESULT_DIR/$f";
+done
+
+# Rename the helm chart folder
+mv $RESULT_DIR/helm/xapp-std $RESULT_DIR/helm/$1
+find $RESULT_DIR/helm/$1 -type f | xargs sed -i -e "s/xapp-std/$1/g"
+
+# Push to helm chart repo
+helm package generated/helm/$1 | awk '{ print $NF }' | xargs mv -t $__RUNRICENV_HELMREPO_DIR__
+helm repo index $__RUNRICENV_HELMREPO_DIR__
+helm repo update
--- /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. #
+################################################################################
+
+
+# customize the following repo info to local environment
+export __RICENV_SET__='true'
+export __RUNRICENV_DOCKER_HOST__='192.168.0.6'
+export __RUNRICENV_DOCKER_PORT__='5000'
+export __RUNRICENV_HELMREPO_DIR__='/var/www/html/charts/'
\ No newline at end of file