blob: b867db1db3ab3a38c3bfdc12a81a72f48a30e346 [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:
Matteo Scandoloaf538bd2020-12-08 11:33:58 -080055 privileged: {{ .Values.privileged }}
56 livenessProbe:
57 exec:
58 command:
59 - bbsimctl
60 - olt
61 - get
62 initialDelaySeconds: 5
63 periodSeconds: 30
64 readinessProbe:
65 httpGet:
66 path: /v2/cfg
67 port: {{ .Values.bbsim_sadis_port }}
68 httpHeaders:
69 initialDelaySeconds: 5
70 periodSeconds: 30
Zack Williams1849e612018-10-05 15:26:44 -070071 command: [
72 "/app/bbsim",
Andrey Pozolotinb8fb0162020-09-10 16:04:20 +030073 "-openolt_address", ":{{ .Values.olt_tcp_port }}",
Matteo Scandolo3ed02892019-10-07 09:57:06 -070074 "-olt_id", "{{ .Values.olt_id }}",
75 "-nni", "{{ .Values.nni }}",
76 "-pon", "{{ .Values.pon }}",
77 "-onu", "{{ .Values.onu }}",
Matteo Scandolobafbb992021-05-28 13:47:09 -070078 "-bp_format", "{{ .Values.bp_format }}",
Matteo Scandolo9b10cf62020-09-30 15:00:51 -070079 "-oltRebootDelay", "{{ .Values.oltRebootDelay }}",
serkant.uluderya3a4548f2020-04-01 13:47:17 -070080 "-logLevel", "{{ $log_level }}",
Pragya Arya87231de2020-03-11 17:30:23 +053081 "-delay", "{{ .Values.delay }}",
Matteo Scandolo9dab4bd2020-08-24 12:29:48 -070082 "-services", "configs/services.yaml",
Matteo Scandolob2d061f2020-09-09 08:31:24 -070083 "-rest_api_address", ":{{ .Values.bbsim_rest_port }}",
84 "-ca", "{{ .Values.controlledActivation }}",
Holger Hildebrandtbfb48732021-04-27 09:27:06 +000085 "-omci_response_rate", "{{ .Values.omci_response_rate }}",
Pragya Arya87231de2020-03-11 17:30:23 +053086 {{ if .Values.enableEvents -}}
87 "-enableEvents",
88 "-kafkaAddress", "{{ .Values.kafkaAddress }}",
89 {{ end -}}
90 {{ if .Values.enablePerf -}}
Matteo Scandolo189d39f2020-04-23 16:11:26 -070091 "-enableperf",
Pragya Arya87231de2020-03-11 17:30:23 +053092 {{ end -}}
Shrey Baidf2a4e2c2020-06-16 22:49:41 +053093 "-kafkaEventTopic", "{{ .Values.kafkaEventTopic }}",
94 {{ if .Values.authRetry -}}
95 "-authRetry",
96 {{ end -}}
97 {{ if .Values.dhcpRetry -}}
98 "-dhcpRetry",
99 {{ end -}}
Zack Williams1849e612018-10-05 15:26:44 -0700100 ]
101 ports:
Matteo Scandolo812688a2019-12-11 09:16:53 -0800102 - name: "bbsim-{{ .Values.olt_id }}"
Zack Williams1849e612018-10-05 15:26:44 -0700103 containerPort: {{ .Values.olt_tcp_port }}
Zack Williams1849e612018-10-05 15:26:44 -0700104 protocol: TCP
Matteo Scandolo812688a2019-12-11 09:16:53 -0800105 - name: "bbsim-{{ .Values.olt_id }}-api"
106 containerPort: {{ .Values.bbsim_api_port }}
Matteo Scandolo812688a2019-12-11 09:16:53 -0800107 protocol: TCP
108 - name: "bbsim-{{ .Values.olt_id }}-sadis"
109 containerPort: {{ .Values.bbsim_sadis_port }}
Matteo Scandolo812688a2019-12-11 09:16:53 -0800110 protocol: TCP
Andrey Pozolotin9a109442020-09-07 22:22:39 +0300111 - name: "bbsim-{{ .Values.olt_id }}-rest"
112 containerPort: {{ .Values.bbsim_rest_port }}
113 protocol: TCP
Andrea Campanella28398c02020-10-13 14:48:41 +0200114 - name: "bbsim-{{ .Values.olt_id }}-dmi"
115 containerPort: {{ .Values.bbsim_dmi_port }}
116 protocol: TCP
Zack Williams1849e612018-10-05 15:26:44 -0700117 env:
118 - name: POD_IP
119 valueFrom:
120 fieldRef:
121 fieldPath: status.podIP
122 - name: NAMESPACE
123 valueFrom:
124 fieldRef:
125 fieldPath: metadata.namespace
126 resources:
127{{ toYaml .Values.resources | indent 12 }}
Matteo Scandolo9dab4bd2020-08-24 12:29:48 -0700128 volumeMounts:
129 - name: bbsim-services-config
130 mountPath: /app/configs/services.yaml
131 subPath: services.yaml
132 volumes:
133 - name: bbsim-services-config
134 configMap:
135 name: bbsim-services-{{ .Values.olt_id }}
136 items:
137 - key: bbsimServicesConfig
138 path: services.yaml
Zack Williams1849e612018-10-05 15:26:44 -0700139 {{- with .Values.nodeSelector }}
140 nodeSelector:
141{{ toYaml . | indent 8 }}
142 {{- end }}
143 {{- with .Values.affinity }}
144 affinity:
145{{ toYaml . | indent 8 }}
146 {{- end }}
147 {{- with .Values.tolerations }}
148 tolerations:
149{{ toYaml . | indent 8 }}
150 {{- end }}