Add helm chart for NONRTRIC rAPP Catalogue 08/5208/10
authorelinuxhenrik <henrik.b.andersson@est.tech>
Tue, 1 Dec 2020 12:08:14 +0000 (13:08 +0100)
committerHenrik Andersson <henrik.b.andersson@est.tech>
Tue, 8 Dec 2020 18:11:25 +0000 (18:11 +0000)
Change-Id: I86432dbfa27084bf6c72f575c811eddaa559ed07
Issue-ID: NONRTRIC-342
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
bin/deploy-nonrtric
nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
nonrtric/bin/install
nonrtric/bin/uninstall
nonrtric/helm/nonrtric/requirements.yaml
nonrtric/helm/rappcatalogueservice/Chart.yaml [new file with mode: 0644]
nonrtric/helm/rappcatalogueservice/requirements.yaml [new file with mode: 0644]
nonrtric/helm/rappcatalogueservice/templates/deployment.yaml [new file with mode: 0644]
nonrtric/helm/rappcatalogueservice/templates/service.yaml [new file with mode: 0644]
nonrtric/helm/rappcatalogueservice/values.yaml [new file with mode: 0644]
ric-common/Common-Template/helm/nonrtric-common/templates/_rappcatalogueservice.tpl [new file with mode: 0644]

index c05bc72..e1c739d 100755 (executable)
@@ -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
index b759e11..ca51b59 100644 (file)
@@ -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
index af4b066..cec12da 100755 (executable)
@@ -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
index 584a7b4..7225f07 100755 (executable)
@@ -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
 
index e49a947..6f2be91 100644 (file)
@@ -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 (file)
index 0000000..4482422
--- /dev/null
@@ -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 (file)
index 0000000..f3b3ecd
--- /dev/null
@@ -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 (file)
index 0000000..95304c5
--- /dev/null
@@ -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 (file)
index 0000000..2aae7d6
--- /dev/null
@@ -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 (file)
index 0000000..e21d2c5
--- /dev/null
@@ -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 (file)
index 0000000..230c807
--- /dev/null
@@ -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 -}}