blob: a90820757ea8a1e3bb1d90cac42053a0b9b43cf8 [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
David K. Bainbridgee1aba802020-06-25 21:53:17 -070017apiVersion: apps/v1
Zack Williams1849e612018-10-05 15:26:44 -070018kind: 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:
David Bainbridge70c0f302020-05-22 09:58:34 -070023 app: "bbsim"
24 name: {{ template "bbsim.name" . }}
Zack Williams1849e612018-10-05 15:26:44 -070025 chart: {{ template "bbsim.chart" . }}
26 release: {{ .Release.Name }}
27 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
30 selector:
31 matchLabels:
David Bainbridge70c0f302020-05-22 09:58:34 -070032 app: "bbsim"
33 name: {{ template "bbsim.name" . }}
Zack Williams1849e612018-10-05 15:26:44 -070034 release: {{ .Release.Name }}
35 template:
36 metadata:
37 labels:
Matteo Scandolo822d0c12020-04-07 18:31:27 -070038 app: "bbsim"
David Bainbridge70c0f302020-05-22 09:58:34 -070039 name: {{ template "bbsim.name" . }}
Zack Williams1849e612018-10-05 15:26:44 -070040 release: {{ .Release.Name }}
Matteo Scandolo822d0c12020-04-07 18:31:27 -070041 app.kubernetes.io/name: "bbsim"
42 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
43 app.kubernetes.io/component: "device-emulator"
44 app.kubernetes.io/part-of: "voltha"
45 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
46 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Zack Williams1849e612018-10-05 15:26:44 -070047 spec:
48 serviceAccount: {{ .Values.serviceAccountName }}
49 serviceAccountName: {{ .Values.serviceAccountName }}
50 containers:
51 - name: {{ .Chart.Name }}
serkant.uluderya3a4548f2020-04-01 13:47:17 -070052 image: '{{ tpl .Values.images.bbsim.registry . }}{{ tpl .Values.images.bbsim.repository . }}:{{ tpl ( tpl .Values.images.bbsim.tag . ) . }}'
53 imagePullPolicy: {{ tpl .Values.images.bbsim.pullPolicy . }}
Zack Williams1849e612018-10-05 15:26:44 -070054 securityContext:
55 privileged: true
56 command: [
57 "/app/bbsim",
Matteo Scandolo3ed02892019-10-07 09:57:06 -070058 "-olt_id", "{{ .Values.olt_id }}",
59 "-nni", "{{ .Values.nni }}",
60 "-pon", "{{ .Values.pon }}",
61 "-onu", "{{ .Values.onu }}",
serkant.uluderya3a4548f2020-04-01 13:47:17 -070062 "-logLevel", "{{ $log_level }}",
Matteo Scandoloeb401ad2019-10-30 13:32:11 -070063 {{ if .Values.auth -}}
64 "-auth",
65 {{ end -}}
66 {{ if .Values.dhcp -}}
67 "-dhcp",
68 {{ end -}}
Shrey Baid8d069a72020-05-12 00:12:06 +053069 {{ if .Values.igmp -}}
70 "-igmp",
71 {{ end -}}
Jonathan Hart1b9ae5c2020-02-11 16:54:45 -080072 "-c_tag", "{{ .Values.c_tag }}",
Matteo Scandolo189d39f2020-04-23 16:11:26 -070073 "-c_tag_allocation", "{{ .Values.c_tag_allocation }}",
Jonathan Hart1b9ae5c2020-02-11 16:54:45 -080074 "-s_tag", "{{ .Values.s_tag }}",
Matteo Scandolo189d39f2020-04-23 16:11:26 -070075 "-s_tag_allocation", "{{ .Values.s_tag_allocation }}",
Pragya Arya87231de2020-03-11 17:30:23 +053076 "-delay", "{{ .Values.delay }}",
77 {{ if .Values.enableEvents -}}
78 "-enableEvents",
79 "-kafkaAddress", "{{ .Values.kafkaAddress }}",
80 {{ end -}}
81 {{ if .Values.enablePerf -}}
Matteo Scandolo189d39f2020-04-23 16:11:26 -070082 "-enableperf",
Pragya Arya87231de2020-03-11 17:30:23 +053083 {{ end -}}
Matteo Scandolo189d39f2020-04-23 16:11:26 -070084 "-sadisFormat", "{{ .Values.sadisFormat }}",
Shrey Baidf2a4e2c2020-06-16 22:49:41 +053085 "-kafkaEventTopic", "{{ .Values.kafkaEventTopic }}",
86 {{ if .Values.authRetry -}}
87 "-authRetry",
88 {{ end -}}
89 {{ if .Values.dhcpRetry -}}
90 "-dhcpRetry",
91 {{ end -}}
Zack Williams1849e612018-10-05 15:26:44 -070092 ]
93 ports:
Matteo Scandolo812688a2019-12-11 09:16:53 -080094 - name: "bbsim-{{ .Values.olt_id }}"
Zack Williams1849e612018-10-05 15:26:44 -070095 containerPort: {{ .Values.olt_tcp_port }}
Zack Williams1849e612018-10-05 15:26:44 -070096 protocol: TCP
Matteo Scandolo812688a2019-12-11 09:16:53 -080097 - name: "bbsim-{{ .Values.olt_id }}-api"
98 containerPort: {{ .Values.bbsim_api_port }}
Matteo Scandolo812688a2019-12-11 09:16:53 -080099 protocol: TCP
100 - name: "bbsim-{{ .Values.olt_id }}-sadis"
101 containerPort: {{ .Values.bbsim_sadis_port }}
Matteo Scandolo812688a2019-12-11 09:16:53 -0800102 protocol: TCP
Zack Williams1849e612018-10-05 15:26:44 -0700103 env:
104 - name: POD_IP
105 valueFrom:
106 fieldRef:
107 fieldPath: status.podIP
108 - name: NAMESPACE
109 valueFrom:
110 fieldRef:
111 fieldPath: metadata.namespace
112 resources:
113{{ toYaml .Values.resources | indent 12 }}
114 {{- with .Values.nodeSelector }}
115 nodeSelector:
116{{ toYaml . | indent 8 }}
117 {{- end }}
118 {{- with .Values.affinity }}
119 affinity:
120{{ toYaml . | indent 8 }}
121 {{- end }}
122 {{- with .Values.tolerations }}
123 tolerations:
124{{ toYaml . | indent 8 }}
125 {{- end }}