From: RehanRaza Date: Wed, 25 Mar 2020 12:50:22 +0000 (+0100) Subject: Add helm chart for A1 simulator X-Git-Tag: f-release~129 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=5e10316729da47c17161788a7185a70438506742;p=it%2Fdep.git Add helm chart for A1 simulator This is work in progress. This commit contains the first version of helm chart for nonrtric A1 simulator, more helm charts for other components of nonrtric and install/uninstall scripts to be added. Change-Id: If7164f5a83b8ac7242b1fd1bd97170a2c6331113 Issue-ID: NONRTRIC-171 Signed-off-by: RehanRaza --- diff --git a/nonrtric/.gitignore b/nonrtric/.gitignore new file mode 100644 index 00000000..5b7129cf --- /dev/null +++ b/nonrtric/.gitignore @@ -0,0 +1,9 @@ +# ignore all logs +*.log +*.tar +*.tgz +*.swp +*.lock +.tox +docs/_build/ +.DS_STORE diff --git a/nonrtric/helm/a1simulator/.helmignore b/nonrtric/helm/a1simulator/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/nonrtric/helm/a1simulator/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/nonrtric/helm/a1simulator/Chart.yaml b/nonrtric/helm/a1simulator/Chart.yaml new file mode 100644 index 00000000..d0bdfa0b --- /dev/null +++ b/nonrtric/helm/a1simulator/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: "1.0" +description: A Helm chart for A1 simulator +name: a1simulator +version: 1.0.1 diff --git a/nonrtric/helm/a1simulator/templates/_a1simulator.tpl b/nonrtric/helm/a1simulator/templates/_a1simulator.tpl new file mode 100644 index 00000000..ad1ee975 --- /dev/null +++ b/nonrtric/helm/a1simulator/templates/_a1simulator.tpl @@ -0,0 +1,32 @@ +################################################################################ +# 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.a1simulator" -}} + {{- printf "a1simulator" -}} +{{- end -}} + +{{- define "common.fullname.a1simulator" -}} + {{- $name := ( include "common.name.a1simulator" . ) -}} + {{- $namespace := "nonrtric" -}} + {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.containername.a1simulator" -}} + {{- $name := ( include "common.fullname.a1simulator" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.serviceport.a1simulator.http" -}}8085{{- end -}} diff --git a/nonrtric/helm/a1simulator/templates/deployment.yaml b/nonrtric/helm/a1simulator/templates/deployment.yaml new file mode 100644 index 00000000..998d6bf6 --- /dev/null +++ b/nonrtric/helm/a1simulator/templates/deployment.yaml @@ -0,0 +1,54 @@ +################################################################################ +# 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: deployment-{{ .Values.a1simulator.instanceName }} + namespace: nonrtric + generation: 1 + labels: + app: nonrtric-{{ include "common.name.a1simulator" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + deployment.kubernetes.io/revision: '1' +spec: + replicas: 1 + selector: + matchLabels: + app: nonrtric-{{ include "common.name.a1simulator" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: nonrtric-{{ include "common.name.a1simulator" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ include "common.name.a1simulator" . }} + containers: + - name: {{ include "common.containername.a1simulator" . }} + image: {{ .Values.a1simulator.image.registry }}/{{ .Values.a1simulator.image.name }}:{{ .Values.a1simulator.image.tag }} + imagePullPolicy: {{ .Values.a1simulator.imagePullPolicy }} + ports: + - containerPort: {{ include "common.serviceport.a1simulator.http" . }} + protocol: TCP + readinessProbe: + tcpSocket: + port: {{ include "common.serviceport.a1simulator.http" . }} + initialDelaySeconds: 5 + periodSeconds: 15 \ No newline at end of file diff --git a/nonrtric/helm/a1simulator/templates/service.yaml b/nonrtric/helm/a1simulator/templates/service.yaml new file mode 100644 index 00000000..3bc13994 --- /dev/null +++ b/nonrtric/helm/a1simulator/templates/service.yaml @@ -0,0 +1,36 @@ +################################################################################ +# 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: {{ .Values.a1simulator.instanceName }} + namespace: nonrtric + labels: + app: nonrtric-{{ include "common.name.a1simulator" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + ports: + - name: http + protocol: TCP + port: {{ include "common.serviceport.a1simulator.http" . }} + targetPort: {{ include "common.serviceport.a1simulator.http" . }} + selector: + app: nonrtric-{{ include "common.name.a1simulator" . }} + release: {{ .Release.Name }} + type: ClusterIP diff --git a/nonrtric/helm/a1simulator/values.yaml b/nonrtric/helm/a1simulator/values.yaml new file mode 100644 index 00000000..af7ff5de --- /dev/null +++ b/nonrtric/helm/a1simulator/values.yaml @@ -0,0 +1,27 @@ +################################################################################ +# 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 a1-simulator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +a1simulator: + instanceName: a1-sim1 + imagePullPolicy: IfNotPresent + image: + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + name: near-rt-ric-simulator + tag: 1.0.1