From ca99830721cf9331b2b963030f5b4ed0e85ebe4e Mon Sep 17 00:00:00 2001 From: ecaiyanlinux Date: Tue, 15 Jun 2021 15:18:21 +0800 Subject: [PATCH] First helm chart version for o-ru app Signed-off-by: ecaiyanlinux Issue-ID: NONRTRIC-496 Change-Id: Ieda9be7fc260b2d0add87b50a66f42ce6e51fb3c --- .../scriptversion/helm/dmaap-mr/.helmignore | 23 +++++++ .../scriptversion/helm/dmaap-mr/Chart.yaml | 39 +++++++++++ .../helm/dmaap-mr/templates/_helpers.tpl | 79 ++++++++++++++++++++++ .../helm/dmaap-mr/templates/deployment.yaml | 73 ++++++++++++++++++++ .../helm/dmaap-mr/templates/service.yaml | 30 ++++++++ .../scriptversion/helm/dmaap-mr/values.yaml | 65 ++++++++++++++++++ .../helm/message-generator/.helmignore | 23 +++++++ .../helm/message-generator/Chart.yaml | 39 +++++++++++ .../helm/message-generator/templates/_helpers.tpl | 79 ++++++++++++++++++++++ .../message-generator/templates/deployment.yaml | 70 +++++++++++++++++++ .../helm/message-generator/templates/service.yaml | 30 ++++++++ .../helm/message-generator/values.yaml | 65 ++++++++++++++++++ .../scriptversion/helm/oru-app/.helmignore | 23 +++++++ .../scriptversion/helm/oru-app/Chart.yaml | 39 +++++++++++ .../helm/oru-app/templates/_helpers.tpl | 79 ++++++++++++++++++++++ .../helm/oru-app/templates/deployment.yaml | 76 +++++++++++++++++++++ .../helm/oru-app/templates/service.yaml | 30 ++++++++ .../scriptversion/helm/oru-app/values.yaml | 65 ++++++++++++++++++ .../scriptversion/helm/sdnr-simulator/.helmignore | 23 +++++++ .../scriptversion/helm/sdnr-simulator/Chart.yaml | 39 +++++++++++ .../helm/sdnr-simulator/templates/_helpers.tpl | 79 ++++++++++++++++++++++ .../helm/sdnr-simulator/templates/deployment.yaml | 78 +++++++++++++++++++++ .../helm/sdnr-simulator/templates/service.yaml | 30 ++++++++ .../scriptversion/helm/sdnr-simulator/values.yaml | 65 ++++++++++++++++++ .../scriptversion/helm/start.sh | 58 ++++++++++++++++ 25 files changed, 1299 insertions(+) create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/.helmignore create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/Chart.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/_helpers.tpl create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/deployment.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/service.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/values.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/.helmignore create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/Chart.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/_helpers.tpl create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/deployment.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/service.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/values.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/.helmignore create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/Chart.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/_helpers.tpl create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/deployment.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/service.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/values.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/.helmignore create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/Chart.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/_helpers.tpl create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/deployment.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/service.yaml create mode 100644 test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/values.yaml create mode 100755 test/usecases/oruclosedlooprecovery/scriptversion/helm/start.sh diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/.helmignore b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/.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/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/Chart.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/Chart.yaml new file mode 100644 index 00000000..82b7895a --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/Chart.yaml @@ -0,0 +1,39 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: v2 +name: dmaap-mr +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/_helpers.tpl b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/_helpers.tpl new file mode 100644 index 00000000..c5fe5565 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/_helpers.tpl @@ -0,0 +1,79 @@ +{{/* +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +*/}} + +{{/* +Expand the name of the chart. +*/}} +{{- define "dmaap-mr.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 "dmaap-mr.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 "dmaap-mr.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "dmaap-mr.labels" -}} +helm.sh/chart: {{ include "dmaap-mr.chart" . }} +{{ include "dmaap-mr.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "dmaap-mr.selectorLabels" -}} +app.kubernetes.io/name: {{ include "dmaap-mr.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "dmaap-mr.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "dmaap-mr.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/deployment.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/deployment.yaml new file mode 100644 index 00000000..700bb90f --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/deployment.yaml @@ -0,0 +1,73 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "dmaap-mr.fullname" . }} + labels: + {{- include "dmaap-mr.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "dmaap-mr.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "dmaap-mr.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 3904 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/service.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/service.yaml new file mode 100644 index 00000000..be88c956 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/templates/service.yaml @@ -0,0 +1,30 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "dmaap-mr.fullname" . }} + labels: + {{- include "dmaap-mr.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "dmaap-mr.selectorLabels" . | nindent 4 }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/values.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/values.yaml new file mode 100644 index 00000000..3fd2b096 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/dmaap-mr/values.yaml @@ -0,0 +1,65 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= + +# Default values for dmaap-mr. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: mrstub + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 3904 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/.helmignore b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/.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/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/Chart.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/Chart.yaml new file mode 100644 index 00000000..b336fd8e --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/Chart.yaml @@ -0,0 +1,39 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: v2 +name: message-generator +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/_helpers.tpl b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/_helpers.tpl new file mode 100644 index 00000000..68ed9c29 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/_helpers.tpl @@ -0,0 +1,79 @@ +{{/* +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +*/}} + +{{/* +Expand the name of the chart. +*/}} +{{- define "message-generator.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 "message-generator.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 "message-generator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "message-generator.labels" -}} +helm.sh/chart: {{ include "message-generator.chart" . }} +{{ include "message-generator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "message-generator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "message-generator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "message-generator.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "message-generator.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/deployment.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/deployment.yaml new file mode 100644 index 00000000..f5e628a4 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/deployment.yaml @@ -0,0 +1,70 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "message-generator.fullname" . }} + labels: + {{- include "message-generator.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "message-generator.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "message-generator.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: MR-HOST + value: http://dmaap-mr + - name: MR-PORT + value: "3904" + ports: + - name: http + containerPort: 80 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/service.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/service.yaml new file mode 100644 index 00000000..6770d679 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/templates/service.yaml @@ -0,0 +1,30 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "message-generator.fullname" . }} + labels: + {{- include "message-generator.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "message-generator.selectorLabels" . | nindent 4 }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/values.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/values.yaml new file mode 100644 index 00000000..e547bda9 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/values.yaml @@ -0,0 +1,65 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= + +# Default values for message-generator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: message-generator + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/.helmignore b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/.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/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/Chart.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/Chart.yaml new file mode 100644 index 00000000..42330a79 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/Chart.yaml @@ -0,0 +1,39 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: v2 +name: oru-app +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/_helpers.tpl b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/_helpers.tpl new file mode 100644 index 00000000..8824c6a2 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/_helpers.tpl @@ -0,0 +1,79 @@ +{{/* +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +*/}} + +{{/* +Expand the name of the chart. +*/}} +{{- define "oru-app.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 "oru-app.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 "oru-app.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "oru-app.labels" -}} +helm.sh/chart: {{ include "oru-app.chart" . }} +{{ include "oru-app.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "oru-app.selectorLabels" -}} +app.kubernetes.io/name: {{ include "oru-app.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "oru-app.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "oru-app.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/deployment.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/deployment.yaml new file mode 100644 index 00000000..a27d81d0 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/deployment.yaml @@ -0,0 +1,76 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "oru-app.fullname" . }} + labels: + {{- include "oru-app.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "oru-app.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "oru-app.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: MR-HOST + value: http://dmaap-mr + - name: MR-PORT + value: "3904" + - name: SDNR-HOST + value: http://sdnr-simulator + - name: SDNR-PORT + value: "9990" + - name: VERBOSE + value: "on" + ports: + - name: http + containerPort: 80 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/service.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/service.yaml new file mode 100644 index 00000000..8ead821c --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/templates/service.yaml @@ -0,0 +1,30 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "oru-app.fullname" . }} + labels: + {{- include "oru-app.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "oru-app.selectorLabels" . | nindent 4 }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/values.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/values.yaml new file mode 100644 index 00000000..e45a1f5e --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/values.yaml @@ -0,0 +1,65 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= + +# Default values for oru-app. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: oru-app + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/.helmignore b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/.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/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/Chart.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/Chart.yaml new file mode 100644 index 00000000..88907822 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/Chart.yaml @@ -0,0 +1,39 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: v2 +name: sdnr-simulator +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/_helpers.tpl b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/_helpers.tpl new file mode 100644 index 00000000..ddea543c --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/_helpers.tpl @@ -0,0 +1,79 @@ +{{/* +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +*/}} + +{{/* +Expand the name of the chart. +*/}} +{{- define "sdnr-simulator.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 "sdnr-simulator.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 "sdnr-simulator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "sdnr-simulator.labels" -}} +helm.sh/chart: {{ include "sdnr-simulator.chart" . }} +{{ include "sdnr-simulator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "sdnr-simulator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "sdnr-simulator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "sdnr-simulator.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "sdnr-simulator.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/deployment.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/deployment.yaml new file mode 100644 index 00000000..67975d6b --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/deployment.yaml @@ -0,0 +1,78 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "sdnr-simulator.fullname" . }} + labels: + {{- include "sdnr-simulator.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "sdnr-simulator.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "sdnr-simulator.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: MR-HOST + value: http://dmaap-mr + - name: MR-PORT + value: "3904" + ports: + - name: http + containerPort: 9990 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/service.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/service.yaml new file mode 100644 index 00000000..6a8a39ed --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/templates/service.yaml @@ -0,0 +1,30 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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: {{ include "sdnr-simulator.fullname" . }} + labels: + {{- include "sdnr-simulator.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "sdnr-simulator.selectorLabels" . | nindent 4 }} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/values.yaml b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/values.yaml new file mode 100644 index 00000000..01bf76c3 --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/values.yaml @@ -0,0 +1,65 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= + +# Default values for sdnr-simulator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: sdnr-simulator + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 9990 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/test/usecases/oruclosedlooprecovery/scriptversion/helm/start.sh b/test/usecases/oruclosedlooprecovery/scriptversion/helm/start.sh new file mode 100755 index 00000000..46365c6f --- /dev/null +++ b/test/usecases/oruclosedlooprecovery/scriptversion/helm/start.sh @@ -0,0 +1,58 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +# + +SHELL_FOLDER=$(cd "$(dirname "$0")";pwd) +cd ${SHELL_FOLDER} +helm uninstall dmaap-mr message-generator oru-app sdnr-simulator -n nonrtric + +# be careful if other stopped containers are on the same system +docker stop $(docker ps -aq) +docker system prune -f + +# build o-ru application image +cd ${SHELL_FOLDER}/../app/ +docker build -t oru-app . + +# build simulator image of sdnr +cd ${SHELL_FOLDER}/../simulators/ +docker build -f Dockerfile-sdnr-sim -t sdnr-simulator . + +# build message generator image +docker build -f Dockerfile-message-generator -t message-generator . + +# build dmaap-mr sim +cd ${SHELL_FOLDER}/../../../../mrstub/ +docker build -t mrstub . + +# build dmapp-mr helm chart & install chart +cd ${SHELL_FOLDER}/dmaap-mr/ +helm package . +helm install dmaap-mr dmaap-mr-0.1.0.tgz --namespace nonrtric --create-namespace --wait + +# build dmapp-mr helm chart & install chart +cd ${SHELL_FOLDER}/message-generator/ +helm package . +helm install message-generator message-generator-0.1.0.tgz --namespace nonrtric --create-namespace --wait + +# build dmapp-mr helm chart & install chart +cd ${SHELL_FOLDER}/oru-app/ +helm package . +helm install oru-app oru-app-0.1.0.tgz --namespace nonrtric --create-namespace --wait + +# build dmapp-mr helm chart & install chart +cd ${SHELL_FOLDER}/sdnr-simulator/ +helm package . +helm install sdnr-simulator sdnr-simulator-0.1.0.tgz --namespace nonrtric --create-namespace --wait \ No newline at end of file -- 2.16.6