From 99728cefa6ebe30830a5be2c367389878e8050e2 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Tue, 7 May 2024 11:25:27 +0100 Subject: [PATCH] ICS producer-consumer sample app Helm chart Issue-ID: NONRTRIC-965 Change-Id: Ic5f46d780c807028476a0733a5fce5cea6722af1 Signed-off-by: lapentafd --- .../helm-chart/ics-consumer/.helmignore | 23 +++++++++++ .../helm-chart/ics-consumer/Chart.yaml | 6 +++ .../templates/consumer-deployment.yaml | 41 +++++++++++++++++++ .../templates/consumer-service.yaml | 31 ++++++++++++++ .../helm-chart/ics-consumer/values.yaml | 32 +++++++++++++++ .../helm-chart/ics-producer/.helmignore | 23 +++++++++++ .../helm-chart/ics-producer/Chart.yaml | 6 +++ .../templates/producer-deployment.yaml | 41 +++++++++++++++++++ .../templates/producer-service.yaml | 31 ++++++++++++++ .../helm-chart/ics-producer/values.yaml | 32 +++++++++++++++ 10 files changed, 266 insertions(+) create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-consumer/.helmignore create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-consumer/Chart.yaml create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-deployment.yaml create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-service.yaml create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-consumer/values.yaml create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-producer/.helmignore create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-producer/Chart.yaml create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-deployment.yaml create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-service.yaml create mode 100644 sample-services/ics-producer-consumer/helm-chart/ics-producer/values.yaml diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/.helmignore b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/Chart.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/Chart.yaml new file mode 100644 index 000000000..8b972e823 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ics-consumer +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +appVersion: "1.16.0" diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-deployment.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-deployment.yaml new file mode 100644 index 000000000..9c107feea --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-deployment.yaml @@ -0,0 +1,41 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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. +# ========================LICENSE_END=================================== +# +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.consumer.name }} +spec: + replicas: {{ .Values.consumer.replicaCount }} + selector: + matchLabels: + app: {{ .Values.consumer.name }} + template: + metadata: + labels: + app: {{ .Values.consumer.name }} + spec: + containers: + - name: {{ .Values.consumer.name }} + image: "{{ .Values.consumer.image.repository }}:{{ .Values.consumer.image.tag }}" + ports: + - containerPort: {{ .Values.consumer.service.port }} + env: + - name: KAFKA_SERVERS + value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}" diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-service.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-service.yaml new file mode 100644 index 000000000..6b3383803 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/templates/consumer-service.yaml @@ -0,0 +1,31 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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. +# ========================LICENSE_END=================================== +# +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.consumer.name }} +spec: + type: NodePort + ports: + - port: {{ .Values.consumer.service.port }} + targetPort: {{ .Values.consumer.service.port }} + nodePort: {{ .Values.consumer.service.nodePort }} + selector: + app: {{ .Values.consumer.name }} diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-consumer/values.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/values.yaml new file mode 100644 index 000000000..5e6c5b029 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-consumer/values.yaml @@ -0,0 +1,32 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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. +# ========================LICENSE_END=================================== +# +consumer: + name: kafka-consumer + replicaCount: 1 + image: + repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-icsconsumer + tag: 0.0.1 + service: + port: 8081 + nodePort: 30081 + +kafka: + host: kafka-service + port: 9092 diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/.helmignore b/sample-services/ics-producer-consumer/helm-chart/ics-producer/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-producer/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/Chart.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/Chart.yaml new file mode 100644 index 000000000..e26165bd9 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-producer/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ics-producer +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +appVersion: "1.16.0" diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-deployment.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-deployment.yaml new file mode 100644 index 000000000..b7433fcb9 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-deployment.yaml @@ -0,0 +1,41 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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. +# ========================LICENSE_END=================================== +# +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.producer.name }} +spec: + replicas: {{ .Values.producer.replicaCount }} + selector: + matchLabels: + app: {{ .Values.producer.name }} + template: + metadata: + labels: + app: {{ .Values.producer.name }} + spec: + containers: + - name: {{ .Values.producer.name }} + image: "{{ .Values.producer.image.repository }}:{{ .Values.producer.image.tag }}" + ports: + - containerPort: {{ .Values.producer.service.port }} + env: + - name: KAFKA_SERVERS + value: "{{ .Values.kafka.host }}:{{ .Values.kafka.port }}" diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-service.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-service.yaml new file mode 100644 index 000000000..8e17906f7 --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-producer/templates/producer-service.yaml @@ -0,0 +1,31 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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. +# ========================LICENSE_END=================================== +# +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.producer.name }} +spec: + type: NodePort + ports: + - port: {{ .Values.producer.service.port }} + targetPort: {{ .Values.producer.service.port }} + nodePort: {{ .Values.producer.service.nodePort }} + selector: + app: {{ .Values.producer.name }} diff --git a/sample-services/ics-producer-consumer/helm-chart/ics-producer/values.yaml b/sample-services/ics-producer-consumer/helm-chart/ics-producer/values.yaml new file mode 100644 index 000000000..9a711980c --- /dev/null +++ b/sample-services/ics-producer-consumer/helm-chart/ics-producer/values.yaml @@ -0,0 +1,32 @@ +# +# ========================LICENSE_START================================= +# O-RAN-SC +# +# Copyright (C) 2024: OpenInfra Foundation Europe +# +# 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. +# ========================LICENSE_END=================================== +# +producer: + name: kafka-producer + replicaCount: 1 + image: + repository: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-sample-icsproducer + tag: 0.0.1 + service: + port: 8080 + nodePort: 30080 + +kafka: + host: kafka-service + port: 9092