From 7d4bbf1f806604b6c83142d5b14a271a19a93841 Mon Sep 17 00:00:00 2001 From: wrider Date: Fri, 21 Feb 2020 16:20:14 -0500 Subject: [PATCH] Add chart for o1 mediator Change-Id: I44f549ddd208d1124556237fc792b3a3b2239b75 Signed-off-by: wrider Issue-ID: RIC-186 --- RECIPE_EXAMPLE/example_recipe.yaml | 6 +++ bin/install | 4 +- bin/uninstall | 2 +- helm/o1mediator/.gitignore | 1 + helm/o1mediator/.helmignore | 22 ++++++++++ helm/o1mediator/Chart.yaml | 5 +++ helm/o1mediator/requirements.yaml | 21 +++++++++ helm/o1mediator/templates/deployment.yaml | 66 +++++++++++++++++++++++++++++ helm/o1mediator/templates/env.yaml | 25 +++++++++++ helm/o1mediator/templates/service-http.yaml | 46 ++++++++++++++++++++ helm/o1mediator/values.yaml | 35 +++++++++++++++ 11 files changed, 230 insertions(+), 3 deletions(-) create mode 100644 helm/o1mediator/.gitignore create mode 100644 helm/o1mediator/.helmignore create mode 100644 helm/o1mediator/Chart.yaml create mode 100644 helm/o1mediator/requirements.yaml create mode 100644 helm/o1mediator/templates/deployment.yaml create mode 100644 helm/o1mediator/templates/env.yaml create mode 100644 helm/o1mediator/templates/service-http.yaml create mode 100644 helm/o1mediator/values.yaml diff --git a/RECIPE_EXAMPLE/example_recipe.yaml b/RECIPE_EXAMPLE/example_recipe.yaml index 4cdd4f3..54613fc 100644 --- a/RECIPE_EXAMPLE/example_recipe.yaml +++ b/RECIPE_EXAMPLE/example_recipe.yaml @@ -165,3 +165,9 @@ vespamgr: name: ric-plt-vespamgr tag: 0.0.8 prometheusurl: "http://rec-prometheus-server.default" + +o1mediator: + image: + registry: "nexus3.o-ran-sc.org:10004/o-ran-sc" + name: ric-plt-o1 + tag: 0.3.2 diff --git a/bin/install b/bin/install index e4e526b..621a883 100755 --- a/bin/install +++ b/bin/install @@ -71,7 +71,7 @@ INFRANAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *infra:/{print $2}') XAPPNAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *xapp:/{print $2}') RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}') # replace the dbaasha with dbaas1 if deploying non HA DBaaS -COMPONENTS=${LIST_OF_COMPONENTS:-"infrastructure appmgr rtmgr dbaasha e2mgr e2term a1mediator submgr vespamgr rsm jaegeradapter"} +COMPONENTS=${LIST_OF_COMPONENTS:-"infrastructure appmgr rtmgr dbaasha e2mgr e2term a1mediator submgr vespamgr rsm jaegeradapter o1mediator"} echo "Deploying RIC infra components [$COMPONENTS]" @@ -92,4 +92,4 @@ for component in $COMPONENTS; do helm dep up $DIR/../helm/$component helm install -f $OVERRIDEYAML --namespace "${PLTNAMESPACE:-ricplt}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component sleep 3 -done \ No newline at end of file +done diff --git a/bin/uninstall b/bin/uninstall index 0d304f1..7d9de8e 100755 --- a/bin/uninstall +++ b/bin/uninstall @@ -16,7 +16,7 @@ # limitations under the License. # ################################################################################ -COMPONENTS="appmgr rtmgr dbaas1 dbaasha e2mgr e2term a1mediator submgr vespamgr rsm jaegeradapter infrastructure" +COMPONENTS="appmgr rtmgr dbaas1 dbaasha e2mgr e2term a1mediator submgr vespamgr rsm jaegeradapter infrastructure o1mediator" RECIPE_NAMESPACE=$(kubectl get cm --all-namespaces | grep ricplt-recipe | awk '{print $1}') kubectl get configmap -n $RECIPE_NAMESPACE ricplt-recipe -o jsonpath='{.data.recipe}' > /tmp/recipe.yaml diff --git a/helm/o1mediator/.gitignore b/helm/o1mediator/.gitignore new file mode 100644 index 0000000..d8651e0 --- /dev/null +++ b/helm/o1mediator/.gitignore @@ -0,0 +1 @@ +NOTES.txt diff --git a/helm/o1mediator/.helmignore b/helm/o1mediator/.helmignore new file mode 100644 index 0000000..50af031 --- /dev/null +++ b/helm/o1mediator/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/o1mediator/Chart.yaml b/helm/o1mediator/Chart.yaml new file mode 100644 index 0000000..15a50b0 --- /dev/null +++ b/helm/o1mediator/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: O1 Mediator Helm chart for Kubernetes +name: o1mediator +version: 3.0.0 diff --git a/helm/o1mediator/requirements.yaml b/helm/o1mediator/requirements.yaml new file mode 100644 index 0000000..db3a74b --- /dev/null +++ b/helm/o1mediator/requirements.yaml @@ -0,0 +1,21 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +dependencies: + - name: ric-common + version: ~3.0.0 + repository: "@local" diff --git a/helm/o1mediator/templates/deployment.yaml b/helm/o1mediator/templates/deployment.yaml new file mode 100644 index 0000000..3e38828 --- /dev/null +++ b/helm/o1mediator/templates/deployment.yaml @@ -0,0 +1,66 @@ +################################################################################ +# 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. # +################################################################################ + +{{- $imagectx := dict "ctx" . "defaultregistry" .Values.o1mediator.image.registry }} +{{- $pullpolicyctx := dict "ctx" . "defaultpullpolicy" .Values.o1mediator.imagePullPolicy }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "common.deploymentname.o1mediator" . }} + namespace: {{ include "common.namespace.platform" . }} + labels: + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.o1mediator.replicaCount }} + selector: + matchLabels: + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }} + release: {{ .Release.Name }} + template: + metadata: + {{- if .Values.o1mediator.annotations }} + annotations: + {{- .Values.o1mediator.annotations | nindent 8 -}} + {{ end }} + labels: + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ include "common.name.o1mediator" . }} + imagePullSecrets: + - name: {{ include "common.dockerregistry.credential" $imagectx }} + containers: + - name: {{ include "common.containername.o1mediator" . }} + image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.o1mediator.image.name }}:{{ .Values.o1mediator.image.tag }} + imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }} + envFrom: + - configMapRef: + name: {{ include "common.configmapname.o1mediator" . }}-env + ports: + - name: http-supervise + containerPort: {{ include "common.serviceport.o1mediator.http.supervise" . }} + protocol: TCP + - name: http-mediation + containerPort: {{ include "common.serviceport.o1mediator.http.mediation" . }} + protocol: TCP + - name: http-event + containerPort: {{ include "common.serviceport.o1mediator.http.event" . }} + protocol: TCP diff --git a/helm/o1mediator/templates/env.yaml b/helm/o1mediator/templates/env.yaml new file mode 100644 index 0000000..70f3065 --- /dev/null +++ b/helm/o1mediator/templates/env.yaml @@ -0,0 +1,25 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.configmapname.o1mediator" . }}-env +data: + DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_SERVICE_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }} + DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} + DBAAS_PORT_6379_TCP_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }} diff --git a/helm/o1mediator/templates/service-http.yaml b/helm/o1mediator/templates/service-http.yaml new file mode 100644 index 0000000..5a1aaf2 --- /dev/null +++ b/helm/o1mediator/templates/service-http.yaml @@ -0,0 +1,46 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.servicename.o1mediator.http" . }} + namespace: {{ include "common.namespace.platform" . }} + labels: + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - port: {{ include "common.serviceport.o1mediator.http.supervise" . }} + protocol: "TCP" + name: "http-supervise" + targetPort: {{ include "common.serviceport.o1mediator.http.supervise" . }} + - port: {{ include "common.serviceport.o1mediator.http.mediation" . }} + protocol: "TCP" + name: "http-mediation" + targetPort: {{ include "common.serviceport.o1mediator.http.mediation" . }} + - port: {{ include "common.serviceport.o1mediator.http.event" . }} + protocol: "TCP" + name: "http-event" + targetPort: {{ include "common.serviceport.o1mediator.http.event" . }} + selector: + app: {{ include "common.namespace.platform" . }}-{{ include "common.name.o1mediator" . }} + release: {{ .Release.Name }} + diff --git a/helm/o1mediator/values.yaml b/helm/o1mediator/values.yaml new file mode 100644 index 0000000..94b7b59 --- /dev/null +++ b/helm/o1mediator/values.yaml @@ -0,0 +1,35 @@ +################################################################################ +# Copyright (c) 2019-2020 AT&T Intellectual Property. # +# Copyright (c) 2019-2020 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. # +################################################################################ + +################################################################# +# Application configuration defaults. +################################################################# +# application image + +o1mediator: + replicaCount: 1 + imagePullPolicy: IfNotPresent + image: + name: ric-plt-o1 + tag: 0.3.1 + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + + # Service ports are now defined in + # ric-common/Common-Template/helm/ric-common/templates/_ports.tpl file. + # If need to change a service port, make the code change necessary, then + # update the _ports.tpl file with the new port number. + -- 2.16.6