blob: 7936d0f3b4010b56e01ac8b8b6672ff89f93ae04 [file] [log] [blame]
Zack Williams1849e612018-10-05 15:26:44 -07001---
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
serkant.uluderya3a4548f2020-04-01 13:47:17 -070015{{- $log_level := tpl .Values.log_level . }}
Zack Williams1849e612018-10-05 15:26:44 -070016
17apiVersion: extensions/v1beta1
18kind: Deployment
19metadata:
20 name: {{ template "bbsim.fullname" . }}
Jonathan Hartf6c66e22020-02-10 13:47:19 -080021 namespace: {{ .Release.Namespace }}
Zack Williams1849e612018-10-05 15:26:44 -070022 labels:
23 app: {{ template "bbsim.name" . }}
24 chart: {{ template "bbsim.chart" . }}
25 release: {{ .Release.Name }}
26 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
29 selector:
30 matchLabels:
31 app: {{ template "bbsim.name" . }}
32 release: {{ .Release.Name }}
33 template:
34 metadata:
35 labels:
Matteo Scandolo822d0c12020-04-07 18:31:27 -070036 app: "bbsim"
Zack Williams1849e612018-10-05 15:26:44 -070037 release: {{ .Release.Name }}
Matteo Scandolo822d0c12020-04-07 18:31:27 -070038 app.kubernetes.io/name: "bbsim"
39 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
40 app.kubernetes.io/component: "device-emulator"
41 app.kubernetes.io/part-of: "voltha"
42 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
43 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Zack Williams1849e612018-10-05 15:26:44 -070044 spec:
45 serviceAccount: {{ .Values.serviceAccountName }}
46 serviceAccountName: {{ .Values.serviceAccountName }}
47 containers:
48 - name: {{ .Chart.Name }}
serkant.uluderya3a4548f2020-04-01 13:47:17 -070049 image: '{{ tpl .Values.images.bbsim.registry . }}{{ tpl .Values.images.bbsim.repository . }}:{{ tpl ( tpl .Values.images.bbsim.tag . ) . }}'
50 imagePullPolicy: {{ tpl .Values.images.bbsim.pullPolicy . }}
Zack Williams1849e612018-10-05 15:26:44 -070051 securityContext:
52 privileged: true
53 command: [
54 "/app/bbsim",
Matteo Scandolo3ed02892019-10-07 09:57:06 -070055 "-olt_id", "{{ .Values.olt_id }}",
56 "-nni", "{{ .Values.nni }}",
57 "-pon", "{{ .Values.pon }}",
58 "-onu", "{{ .Values.onu }}",
serkant.uluderya3a4548f2020-04-01 13:47:17 -070059 "-logLevel", "{{ $log_level }}",
Matteo Scandoloeb401ad2019-10-30 13:32:11 -070060 {{ if .Values.auth -}}
61 "-auth",
62 {{ end -}}
63 {{ if .Values.dhcp -}}
64 "-dhcp",
65 {{ end -}}
Jonathan Hart1b9ae5c2020-02-11 16:54:45 -080066 "-c_tag", "{{ .Values.c_tag }}",
Matteo Scandolo189d39f2020-04-23 16:11:26 -070067 "-c_tag_allocation", "{{ .Values.c_tag_allocation }}",
Jonathan Hart1b9ae5c2020-02-11 16:54:45 -080068 "-s_tag", "{{ .Values.s_tag }}",
Matteo Scandolo189d39f2020-04-23 16:11:26 -070069 "-s_tag_allocation", "{{ .Values.s_tag_allocation }}",
Pragya Arya87231de2020-03-11 17:30:23 +053070 "-delay", "{{ .Values.delay }}",
71 {{ if .Values.enableEvents -}}
72 "-enableEvents",
73 "-kafkaAddress", "{{ .Values.kafkaAddress }}",
74 {{ end -}}
75 {{ if .Values.enablePerf -}}
Matteo Scandolo189d39f2020-04-23 16:11:26 -070076 "-enableperf",
Pragya Arya87231de2020-03-11 17:30:23 +053077 {{ end -}}
Matteo Scandolo189d39f2020-04-23 16:11:26 -070078 "-sadisFormat", "{{ .Values.sadisFormat }}",
Zack Williams1849e612018-10-05 15:26:44 -070079 ]
80 ports:
Matteo Scandolo812688a2019-12-11 09:16:53 -080081 - name: "bbsim-{{ .Values.olt_id }}"
Zack Williams1849e612018-10-05 15:26:44 -070082 containerPort: {{ .Values.olt_tcp_port }}
83 port: {{ .Values.olt_tcp_port }}
84 protocol: TCP
Matteo Scandolo812688a2019-12-11 09:16:53 -080085 - name: "bbsim-{{ .Values.olt_id }}-api"
86 containerPort: {{ .Values.bbsim_api_port }}
87 port: {{ .Values.bbsim_api_port }}
88 protocol: TCP
89 - name: "bbsim-{{ .Values.olt_id }}-sadis"
90 containerPort: {{ .Values.bbsim_sadis_port }}
91 port: {{ .Values.bbsim_sadis_port }}
92 protocol: TCP
Zack Williams1849e612018-10-05 15:26:44 -070093 env:
94 - name: POD_IP
95 valueFrom:
96 fieldRef:
97 fieldPath: status.podIP
98 - name: NAMESPACE
99 valueFrom:
100 fieldRef:
101 fieldPath: metadata.namespace
102 resources:
103{{ toYaml .Values.resources | indent 12 }}
104 {{- with .Values.nodeSelector }}
105 nodeSelector:
106{{ toYaml . | indent 8 }}
107 {{- end }}
108 {{- with .Values.affinity }}
109 affinity:
110{{ toYaml . | indent 8 }}
111 {{- end }}
112 {{- with .Values.tolerations }}
113 tolerations:
114{{ toYaml . | indent 8 }}
115 {{- end }}