Helm chart for bbsim
Change-Id: I557b585601ca2870d0193eb8af24af36f6fc43f8
diff --git a/bbsim/Chart.yaml b/bbsim/Chart.yaml
new file mode 100644
index 0000000..e3b4501
--- /dev/null
+++ b/bbsim/Chart.yaml
@@ -0,0 +1,20 @@
+# Copyright 2018-present Open Networking 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.
+
+name: bbsim
+description: Broadband Simulator
+icon: https://guide.opencord.org/logos/cord.svg
+
+version: 1.0.0-dev
+appVersion: latest
diff --git a/bbsim/templates/NOTES.txt b/bbsim/templates/NOTES.txt
new file mode 100644
index 0000000..1359652
--- /dev/null
+++ b/bbsim/templates/NOTES.txt
@@ -0,0 +1,5 @@
+BBSim deployed with release name: {{ .Release.Name }}
+
+OLT ID: {{ .Values.olt_id }}, on TCP port: {{ .Values.olt_tcp_port }}
+# of PON Ports: {{ .Values.pon_ports }}
+ONUs per PON Port: {{ .Values.onus_per_pon_port }} (total: {{ mul .Values.pon_ports .Values.onus_per_pon_port}})
diff --git a/bbsim/templates/_helpers.tpl b/bbsim/templates/_helpers.tpl
new file mode 100644
index 0000000..af6ac67
--- /dev/null
+++ b/bbsim/templates/_helpers.tpl
@@ -0,0 +1,48 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Copyright 2018-present Open Networking 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.
+*/}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "bbsim.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 "bbsim.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 "bbsim.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
diff --git a/bbsim/templates/deployment.yaml b/bbsim/templates/deployment.yaml
new file mode 100644
index 0000000..6de376f
--- /dev/null
+++ b/bbsim/templates/deployment.yaml
@@ -0,0 +1,81 @@
+---
+# Copyright 2017-present Open Networking 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: extensions/v1beta1
+kind: Deployment
+metadata:
+ name: {{ template "bbsim.fullname" . }}
+ namespace: {{ .Values.namespace }}
+ labels:
+ app: {{ template "bbsim.name" . }}
+ chart: {{ template "bbsim.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ template "bbsim.name" . }}
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ labels:
+ app: {{ template "bbsim.name" . }}
+ release: {{ .Release.Name }}
+ spec:
+ serviceAccount: {{ .Values.serviceAccountName }}
+ serviceAccountName: {{ .Values.serviceAccountName }}
+ containers:
+ - name: {{ .Chart.Name }}
+ image: {{ .Values.global.registry }}{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ securityContext:
+ privileged: true
+ command: [
+ "/app/bbsim",
+ "-n", "{{ .Values.onus_per_pon_port }}",
+ "-m", "{{ .Values.emulation_mode }}",
+ "-H", ":{{ .Values.olt_tcp_port }}",
+ "-id", "{{ .Values.olt_id }}",
+ "-i", "{{ .Values.pon_ports }}",
+ ]
+ ports:
+ - name: "bbsim-olt-id-{{ .Values.olt_id }}"
+ containerPort: {{ .Values.olt_tcp_port }}
+ port: {{ .Values.olt_tcp_port }}
+ protocol: TCP
+ env:
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.namespace
+ resources:
+{{ toYaml .Values.resources | indent 12 }}
+ {{- with .Values.nodeSelector }}
+ nodeSelector:
+{{ toYaml . | indent 8 }}
+ {{- end }}
+ {{- with .Values.affinity }}
+ affinity:
+{{ toYaml . | indent 8 }}
+ {{- end }}
+ {{- with .Values.tolerations }}
+ tolerations:
+{{ toYaml . | indent 8 }}
+ {{- end }}
diff --git a/bbsim/templates/service.yaml b/bbsim/templates/service.yaml
new file mode 100644
index 0000000..d63c129
--- /dev/null
+++ b/bbsim/templates/service.yaml
@@ -0,0 +1,34 @@
+---
+# Copyright 2018-present Open Networking 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
+kind: Service
+metadata:
+ name: {{ template "bbsim.fullname" . }}
+ namespace: {{ .Values.namespace }}
+ labels:
+ app: {{ template "bbsim.name" . }}
+ chart: {{ template "bbsim.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ type: ClusterIP
+ ports:
+ - name: "bbsim-olt-id-{{ .Values.olt_id }}"
+ port: {{ .Values.olt_tcp_port }}
+ protocol: TCP
+ selector:
+ app: {{ template "bbsim.name" . }}
+ release: {{ .Release.Name }}
diff --git a/bbsim/values.yaml b/bbsim/values.yaml
new file mode 100644
index 0000000..9e31972
--- /dev/null
+++ b/bbsim/values.yaml
@@ -0,0 +1,56 @@
+# Copyright 2018-present Open Networking 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.
+
+# bbsim values
+
+# CLI switches passed to bbsim
+
+# -id option
+olt_id: 0
+
+# -H option, port number portion
+olt_tcp_port: 50060
+
+# -i option
+pon_ports: 1
+
+# -n option
+onus_per_pon_port: 1
+
+# -m option
+emulation_mode: 'both'
+
+image:
+ repository: 'voltha/voltha-bbsim'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'IfNotPresent'
+
+global:
+ registry: ''
+
+namespace: voltha
+serviceAccountName: default
+
+nameOverride: ""
+fullnameOverride: ""
+
+replicaCount: 1
+
+resources: {}
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}