blob: 119bc65fd5fada23ad4d940d092c4160f3062a58 [file] [log] [blame]
Matteo Scandolo71d97d92021-06-24 11:58:32 +02001---
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.
15{{- $log_level := tpl .Values.log_level . }}
16
17apiVersion: apps/v1
18kind: Deployment
19metadata:
20 name: {{ template "bbsim.fullname" . }}
21 namespace: {{ .Release.Namespace }}
22 labels:
23 app: "bbsim"
24 name: {{ template "bbsim.name" . }}
25 chart: {{ template "bbsim.chart" . }}
26 release: {{ .Release.Name }}
27 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
30 selector:
31 matchLabels:
32 app: "bbsim"
33 name: {{ template "bbsim.name" . }}
34 release: {{ .Release.Name }}
35 template:
36 metadata:
37 labels:
38 app: "bbsim"
39 name: {{ template "bbsim.name" . }}
40 release: {{ .Release.Name }}
41 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 }}"
47 spec:
48 serviceAccount: {{ .Values.serviceAccountName }}
49 serviceAccountName: {{ .Values.serviceAccountName }}
50 containers:
51 - name: {{ .Chart.Name }}
52 image: '{{ tpl .Values.images.bbsim.registry . }}{{ tpl .Values.images.bbsim.repository . }}:{{ tpl ( tpl .Values.images.bbsim.tag . ) . }}'
53 imagePullPolicy: {{ tpl .Values.images.bbsim.pullPolicy . }}
54 securityContext:
55 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
71 command: [
72 "/app/bbsim",
73 "-openolt_address", ":{{ .Values.olt_tcp_port }}",
74 "-olt_id", "{{ .Values.olt_id }}",
75 "-nni", "{{ .Values.nni }}",
76 "-pon", "{{ .Values.pon }}",
77 "-onu", "{{ .Values.onu }}",
78 "-uni", "{{ .Values.uni }}",
79 "-bp_format", "{{ .Values.bp_format }}",
80 "-oltRebootDelay", "{{ .Values.oltRebootDelay }}",
81 "-logLevel", "{{ $log_level }}",
82 "-delay", "{{ .Values.delay }}",
83 "-services", "configs/services.yaml",
84 "-rest_api_address", ":{{ .Values.bbsim_rest_port }}",
85 "-ca", "{{ .Values.controlledActivation }}",
86 "-omci_response_rate", "{{ .Values.omci_response_rate }}",
87 {{ if .Values.enableEvents -}}
88 "-enableEvents",
89 "-kafkaAddress", "{{ .Values.kafkaAddress }}",
90 {{ end -}}
91 {{ if .Values.enablePerf -}}
92 "-enableperf",
93 {{ end -}}
94 "-kafkaEventTopic", "{{ .Values.kafkaEventTopic }}",
95 {{ if .Values.authRetry -}}
96 "-authRetry",
97 {{ end -}}
98 {{ if .Values.dhcpRetry -}}
99 "-dhcpRetry",
100 {{ end -}}
101 ]
102 ports:
103 - name: "bbsim-{{ .Values.olt_id }}"
104 containerPort: {{ .Values.olt_tcp_port }}
105 protocol: TCP
106 - name: "bbsim-{{ .Values.olt_id }}-api"
107 containerPort: {{ .Values.bbsim_api_port }}
108 protocol: TCP
109 - name: "bbsim-{{ .Values.olt_id }}-sadis"
110 containerPort: {{ .Values.bbsim_sadis_port }}
111 protocol: TCP
112 - name: "bbsim-{{ .Values.olt_id }}-rest"
113 containerPort: {{ .Values.bbsim_rest_port }}
114 protocol: TCP
115 - name: "bbsim-{{ .Values.olt_id }}-dmi"
116 containerPort: {{ .Values.bbsim_dmi_port }}
117 protocol: TCP
118 env:
119 - name: POD_IP
120 valueFrom:
121 fieldRef:
122 fieldPath: status.podIP
123 - name: NAMESPACE
124 valueFrom:
125 fieldRef:
126 fieldPath: metadata.namespace
127 resources:
128{{ toYaml .Values.resources | indent 12 }}
129 volumeMounts:
130 - name: bbsim-services-config
131 mountPath: /app/configs/services.yaml
132 subPath: services.yaml
133 volumes:
134 - name: bbsim-services-config
135 configMap:
136 name: bbsim-services-{{ .Values.olt_id }}
137 items:
138 - key: bbsimServicesConfig
139 path: services.yaml
140 {{- with .Values.nodeSelector }}
141 nodeSelector:
142{{ toYaml . | indent 8 }}
143 {{- end }}
144 {{- with .Values.affinity }}
145 affinity:
146{{ toYaml . | indent 8 }}
147 {{- end }}
148 {{- with .Values.tolerations }}
149 tolerations:
150{{ toYaml . | indent 8 }}
151 {{- end }}