From f38d71d35163d6b9c36f5b028324d152ccce5eb7 Mon Sep 17 00:00:00 2001 From: elinuxhenrik Date: Tue, 1 Dec 2020 13:08:14 +0100 Subject: [PATCH] Add helm chart for NONRTRIC rAPP Catalogue Change-Id: I86432dbfa27084bf6c72f575c811eddaa559ed07 Issue-ID: NONRTRIC-342 Signed-off-by: elinuxhenrik --- bin/deploy-nonrtric | 2 +- nonrtric/RECIPE_EXAMPLE/example_recipe.yaml | 25 ++++++++- nonrtric/bin/install | 2 +- nonrtric/bin/uninstall | 2 +- nonrtric/helm/nonrtric/requirements.yaml | 6 ++- nonrtric/helm/rappcatalogueservice/Chart.yaml | 21 ++++++++ .../helm/rappcatalogueservice/requirements.yaml | 20 +++++++ .../rappcatalogueservice/templates/deployment.yaml | 61 ++++++++++++++++++++++ .../rappcatalogueservice/templates/service.yaml | 44 ++++++++++++++++ nonrtric/helm/rappcatalogueservice/values.yaml | 42 +++++++++++++++ .../templates/_rappcatalogueservice.tpl | 24 +++++++++ 11 files changed, 244 insertions(+), 5 deletions(-) create mode 100644 nonrtric/helm/rappcatalogueservice/Chart.yaml create mode 100644 nonrtric/helm/rappcatalogueservice/requirements.yaml create mode 100644 nonrtric/helm/rappcatalogueservice/templates/deployment.yaml create mode 100644 nonrtric/helm/rappcatalogueservice/templates/service.yaml create mode 100644 nonrtric/helm/rappcatalogueservice/values.yaml create mode 100644 ric-common/Common-Template/helm/nonrtric-common/templates/_rappcatalogueservice.tpl diff --git a/bin/deploy-nonrtric b/bin/deploy-nonrtric index c05bc72c..e1c739d3 100755 --- a/bin/deploy-nonrtric +++ b/bin/deploy-nonrtric @@ -58,7 +58,7 @@ fi $ROOT_DIR/prepare-common-templates -COMPONENTS=${LIST_OF_COMPONENTS:-"controlpanel a1controller a1simulator policymanagementservice enrichmentservice"} +COMPONENTS=${LIST_OF_COMPONENTS:-"controlpanel a1controller a1simulator policymanagementservice enrichmentservice rappcatalogueservice"} echo "Packaging NONRTRIC components [$COMPONENTS]" for component in $COMPONENTS; do diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index b759e11a..ca51b595 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -216,4 +216,27 @@ enrichmentservice: accessMode: ReadWriteOnce size: 2Gi mountPath: /dockerdata-nfs - mountSubPath: nonrtric/enrichmentservice \ No newline at end of file + mountSubPath: nonrtric/enrichmentservice +rappcatalogueservice: + rappcatalogueservice: + imagePullPolicy: IfNotPresent + image: + registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' + name: nonrtric-r-app-catalogue + tag: 1.0.0 + service: + allowHttp: true + httpName: http + internalPort1: 9085 + targetPort1: 8080 + externalPort1: 30097 + httpsName: https + internalPort2: 9086 + targetPort2: 8433 + externalPort2: 30098 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 \ No newline at end of file diff --git a/nonrtric/bin/install b/nonrtric/bin/install index af4b0662..cec12dab 100755 --- a/nonrtric/bin/install +++ b/nonrtric/bin/install @@ -52,7 +52,7 @@ NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^ namespace:/{getline; while ($0 ~ NONRTRIC_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *nonrtric:/{print $2}') RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}') PARENT_CHART=$(cat $OVERRIDEYAML | awk '/^ *component:/{print $2}') -COMPONENTS=${LIST_OF_COMPONENTS:-"controlpanel a1controller a1simulator policymanagementservice enrichmentservice nonrtric"} +COMPONENTS=${LIST_OF_COMPONENTS:-"controlpanel a1controller a1simulator policymanagementservice enrichmentservice nonrtric rappcatalogueservice"} echo "Chart name- $PARENT_CHART" if ! kubectl get ns ${NONRTRIC_NAMESPACE:-nonrtric}> /dev/null 2>&1; then diff --git a/nonrtric/bin/uninstall b/nonrtric/bin/uninstall index 584a7b4b..7225f07f 100755 --- a/nonrtric/bin/uninstall +++ b/nonrtric/bin/uninstall @@ -16,7 +16,7 @@ ################################################################################ -COMPONENTS="controlpanel a1controller a1simulator policymanagementservice enrichmentservice" +COMPONENTS="controlpanel a1controller a1simulator policymanagementservice enrichmentservice rappcatalogueservice" RECIPE_NAMESPACE=$(kubectl get cm --all-namespaces | grep nonrtric-recipe | awk '{print $1}') kubectl get configmap -n $RECIPE_NAMESPACE nonrtric-recipe -o jsonpath='{.data.recipe}' > /tmp/recipe.yaml diff --git a/nonrtric/helm/nonrtric/requirements.yaml b/nonrtric/helm/nonrtric/requirements.yaml index e49a947f..6f2be91c 100644 --- a/nonrtric/helm/nonrtric/requirements.yaml +++ b/nonrtric/helm/nonrtric/requirements.yaml @@ -16,7 +16,7 @@ dependencies: - name: a1controller - version: ~2.0.0 + version: ~2.0.1 repository: "@local" - name: a1simulator version: ~2.0.0 @@ -33,3 +33,7 @@ dependencies: - name: nonrtric-common version: ^2.0.0 repository: "@local" + - name: rappcatalogueservice + version: ~1.0.0 + repository: "@local" + diff --git a/nonrtric/helm/rappcatalogueservice/Chart.yaml b/nonrtric/helm/rappcatalogueservice/Chart.yaml new file mode 100644 index 00000000..4482422d --- /dev/null +++ b/nonrtric/helm/rappcatalogueservice/Chart.yaml @@ -0,0 +1,21 @@ +################################################################################ +# Copyright (c) 2020 Nordix Foundation. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +apiVersion: v1 +appVersion: "2.0.0" +description: A Helm chart for rAPP Catalogue Service +name: rappcatalogueservice +version: 1.0.0 diff --git a/nonrtric/helm/rappcatalogueservice/requirements.yaml b/nonrtric/helm/rappcatalogueservice/requirements.yaml new file mode 100644 index 00000000..f3b3ecd4 --- /dev/null +++ b/nonrtric/helm/rappcatalogueservice/requirements.yaml @@ -0,0 +1,20 @@ +################################################################################ +# Copyright (c) 2020 Nordix Foundation. # +# # +# 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: nonrtric-common + version: ^2.0.0 + repository: "@local" diff --git a/nonrtric/helm/rappcatalogueservice/templates/deployment.yaml b/nonrtric/helm/rappcatalogueservice/templates/deployment.yaml new file mode 100644 index 00000000..95304c5d --- /dev/null +++ b/nonrtric/helm/rappcatalogueservice/templates/deployment.yaml @@ -0,0 +1,61 @@ +################################################################################ +# Copyright (c) 2020 Nordix Foundation. # +# # +# 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. # +################################################################################ + +kind: Deployment +apiVersion: apps/v1 +metadata: + name: {{ include "common.name.rappcatalogueservice" . }} + namespace: {{ include "common.namespace.nonrtric" . }} + generation: 1 + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + deployment.kubernetes.io/revision: '1' +spec: + replicas: 1 + selector: + matchLabels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ include "common.name.rappcatalogueservice" . }} + containers: + - name: {{ include "common.container.rappcatalogueservice" . }} + image: {{ .Values.rappcatalogueservice.image.registry }}/{{ .Values.rappcatalogueservice.image.name }}:{{ .Values.rappcatalogueservice.image.tag }} + imagePullPolicy: {{ .Values.rappcatalogueservice.imagePullPolicy }} + ports: + - containerPort: {{ .Values.rappcatalogueservice.service.targetPort1 }} + protocol: TCP + - containerPort: {{ .Values.rappcatalogueservice.service.targetPort2 }} + protocol: TCP + readinessProbe: + tcpSocket: + port: {{ .Values.rappcatalogueservice.service.targetPort1 }} + initialDelaySeconds: {{ .Values.rappcatalogueservice.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.rappcatalogueservice.liveness.periodSeconds }} + livenessProbe: + tcpSocket: + port: {{ .Values.rappcatalogueservice.service.targetPort1 }} + initialDelaySeconds: {{ .Values.rappcatalogueservice.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.rappcatalogueservice.liveness.periodSeconds }} diff --git a/nonrtric/helm/rappcatalogueservice/templates/service.yaml b/nonrtric/helm/rappcatalogueservice/templates/service.yaml new file mode 100644 index 00000000..2aae7d64 --- /dev/null +++ b/nonrtric/helm/rappcatalogueservice/templates/service.yaml @@ -0,0 +1,44 @@ +################################################################################ +# Copyright (c) 2020 Nordix Foundation. # +# # +# 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. # +################################################################################ + +kind: Service +apiVersion: v1 +metadata: + name: {{ include "common.name.rappcatalogueservice" . }} + namespace: {{ include "common.namespace.nonrtric" . }} + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + ports: + {{if eq .Values.rappcatalogueservice.service.allowHttp true -}} + - name: {{ index .Values.rappcatalogueservice.service.httpName }} + port: {{ .Values.rappcatalogueservice.service.internalPort1 }} + targetPort: {{ .Values.rappcatalogueservice.service.targetPort1 }} + nodePort: {{ .Values.rappcatalogueservice.service.externalPort1 }} + protocol: TCP + {{- end }} + - name: {{ index .Values.rappcatalogueservice.service.httpsName }} + port: {{ .Values.rappcatalogueservice.service.internalPort2 }} + targetPort: {{ .Values.rappcatalogueservice.service.targetPort2 }} + nodePort: {{ .Values.rappcatalogueservice.service.externalPort2 }} + protocol: TCP + selector: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappcatalogueservice" . }} + release: {{ .Release.Name }} + type: NodePort diff --git a/nonrtric/helm/rappcatalogueservice/values.yaml b/nonrtric/helm/rappcatalogueservice/values.yaml new file mode 100644 index 00000000..e21d2c54 --- /dev/null +++ b/nonrtric/helm/rappcatalogueservice/values.yaml @@ -0,0 +1,42 @@ +################################################################################ +# Copyright (c) 2020 Nordix Foundation. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +# Default values for rAPP Catalogue Service. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +rappcatalogueservice: + imagePullPolicy: IfNotPresent + image: + registry: 'nexus3.o-ran-sc.org:10002/o-ran-sc' + name: nonrtric-r-app-catalogue + tag: 1.0.0 + service: + allowHttp: true + httpName: http + internalPort1: 9080 + targetPort1: 8080 + externalPort1: 30093 + httpsName: https + internalPort2: 9081 + targetPort2: 8433 + externalPort2: 30094 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 diff --git a/ric-common/Common-Template/helm/nonrtric-common/templates/_rappcatalogueservice.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/_rappcatalogueservice.tpl new file mode 100644 index 00000000..230c807b --- /dev/null +++ b/ric-common/Common-Template/helm/nonrtric-common/templates/_rappcatalogueservice.tpl @@ -0,0 +1,24 @@ +################################################################################ +# Copyright (c) 2020 Nordix Foundation. # +# # +# 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. # +################################################################################ + +{{- define "common.name.rappcatalogueservice" -}} + {{- printf "rappcatalogueservice" -}} +{{- end -}} + +{{- define "common.container.rappcatalogueservice" -}} + {{- $name := ( include "common.name.rappcatalogueservice" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} -- 2.16.6