blob: 3a5b91a980370869c451b5465935f510bc6aa714 [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:
36 app: {{ template "bbsim.name" . }}
37 release: {{ .Release.Name }}
38 spec:
39 serviceAccount: {{ .Values.serviceAccountName }}
40 serviceAccountName: {{ .Values.serviceAccountName }}
41 containers:
42 - name: {{ .Chart.Name }}
serkant.uluderya3a4548f2020-04-01 13:47:17 -070043 image: '{{ tpl .Values.images.bbsim.registry . }}{{ tpl .Values.images.bbsim.repository . }}:{{ tpl ( tpl .Values.images.bbsim.tag . ) . }}'
44 imagePullPolicy: {{ tpl .Values.images.bbsim.pullPolicy . }}
Zack Williams1849e612018-10-05 15:26:44 -070045 securityContext:
46 privileged: true
47 command: [
48 "/app/bbsim",
Matteo Scandolo3ed02892019-10-07 09:57:06 -070049 "-olt_id", "{{ .Values.olt_id }}",
50 "-nni", "{{ .Values.nni }}",
51 "-pon", "{{ .Values.pon }}",
52 "-onu", "{{ .Values.onu }}",
serkant.uluderya3a4548f2020-04-01 13:47:17 -070053 "-logLevel", "{{ $log_level }}",
Matteo Scandoloeb401ad2019-10-30 13:32:11 -070054 {{ if .Values.auth -}}
55 "-auth",
56 {{ end -}}
57 {{ if .Values.dhcp -}}
58 "-dhcp",
59 {{ end -}}
Jonathan Hart1b9ae5c2020-02-11 16:54:45 -080060 "-c_tag", "{{ .Values.c_tag }}",
61 "-s_tag", "{{ .Values.s_tag }}",
Pragya Arya87231de2020-03-11 17:30:23 +053062 "-delay", "{{ .Values.delay }}",
63 {{ if .Values.enableEvents -}}
64 "-enableEvents",
65 "-kafkaAddress", "{{ .Values.kafkaAddress }}",
66 {{ end -}}
67 {{ if .Values.enablePerf -}}
68 "-enableperf"
69 {{ end -}}
Zack Williams1849e612018-10-05 15:26:44 -070070 ]
71 ports:
Matteo Scandolo812688a2019-12-11 09:16:53 -080072 - name: "bbsim-{{ .Values.olt_id }}"
Zack Williams1849e612018-10-05 15:26:44 -070073 containerPort: {{ .Values.olt_tcp_port }}
74 port: {{ .Values.olt_tcp_port }}
75 protocol: TCP
Matteo Scandolo812688a2019-12-11 09:16:53 -080076 - name: "bbsim-{{ .Values.olt_id }}-api"
77 containerPort: {{ .Values.bbsim_api_port }}
78 port: {{ .Values.bbsim_api_port }}
79 protocol: TCP
80 - name: "bbsim-{{ .Values.olt_id }}-sadis"
81 containerPort: {{ .Values.bbsim_sadis_port }}
82 port: {{ .Values.bbsim_sadis_port }}
83 protocol: TCP
Zack Williams1849e612018-10-05 15:26:44 -070084 env:
85 - name: POD_IP
86 valueFrom:
87 fieldRef:
88 fieldPath: status.podIP
89 - name: NAMESPACE
90 valueFrom:
91 fieldRef:
92 fieldPath: metadata.namespace
93 resources:
94{{ toYaml .Values.resources | indent 12 }}
95 {{- with .Values.nodeSelector }}
96 nodeSelector:
97{{ toYaml . | indent 8 }}
98 {{- end }}
99 {{- with .Values.affinity }}
100 affinity:
101{{ toYaml . | indent 8 }}
102 {{- end }}
103 {{- with .Values.tolerations }}
104 tolerations:
105{{ toYaml . | indent 8 }}
106 {{- end }}