Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 1 | --- |
Joey Armstrong | 0747509 | 2023-01-26 10:56:13 -0500 | [diff] [blame] | 2 | # Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 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. |
Elia Battiston | 587c6b2 | 2022-02-21 18:41:31 +0100 | [diff] [blame] | 15 | {{- $log_level := tpl .Values.log_level . | lower }} |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 16 | |
| 17 | apiVersion: apps/v1 |
| 18 | kind: Deployment |
| 19 | metadata: |
| 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 }} |
| 28 | spec: |
| 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 |
Matteo Scandolo | 70cadc5 | 2021-07-08 17:14:52 -0700 | [diff] [blame] | 64 | timeoutSeconds: 5 |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 65 | readinessProbe: |
| 66 | httpGet: |
| 67 | path: /v2/cfg |
| 68 | port: {{ .Values.bbsim_sadis_port }} |
| 69 | httpHeaders: |
| 70 | initialDelaySeconds: 5 |
| 71 | periodSeconds: 30 |
Matteo Scandolo | 70cadc5 | 2021-07-08 17:14:52 -0700 | [diff] [blame] | 72 | timeoutSeconds: 5 |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 73 | command: [ |
| 74 | "/app/bbsim", |
Matteo Scandolo | 70cadc5 | 2021-07-08 17:14:52 -0700 | [diff] [blame] | 75 | "-openolt_address", "0.0.0.0:{{ .Values.olt_tcp_port }}", |
Andrea Campanella | 97c47ab | 2021-07-21 20:59:44 +0200 | [diff] [blame] | 76 | "-dmi_server_address", ":{{ .Values.bbsim_dmi_port}}", |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 77 | "-olt_id", "{{ .Values.olt_id }}", |
| 78 | "-nni", "{{ .Values.nni }}", |
Elia Battiston | 587c6b2 | 2022-02-21 18:41:31 +0100 | [diff] [blame] | 79 | "-nni_speed", "{{ .Values.nni_speed }}", |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 80 | "-pon", "{{ .Values.pon }}", |
| 81 | "-onu", "{{ .Values.onu }}", |
| 82 | "-uni", "{{ .Values.uni }}", |
Elia Battiston | ffb9da5 | 2022-01-20 10:38:05 +0100 | [diff] [blame] | 83 | "-pots", "{{ .Values.pots }}", |
Holger Hildebrandt | c7c4779 | 2022-05-12 07:30:06 +0000 | [diff] [blame] | 84 | "-omccVersion", "{{ .Values.omccVersion }}", |
Andrea Campanella | 66534ee | 2022-03-17 14:50:00 +0100 | [diff] [blame] | 85 | "-nni_dhcp_trap_vid", "{{ .Values.nni_dhcp_trap_vid }}", |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 86 | "-bp_format", "{{ .Values.bp_format }}", |
| 87 | "-oltRebootDelay", "{{ .Values.oltRebootDelay }}", |
| 88 | "-logLevel", "{{ $log_level }}", |
| 89 | "-delay", "{{ .Values.delay }}", |
| 90 | "-services", "configs/services.yaml", |
Elia Battiston | 587c6b2 | 2022-02-21 18:41:31 +0100 | [diff] [blame] | 91 | {{ if .Values.ponPortsConfig -}} |
| 92 | "-pon_port_config_file", "configs/pon-config.yaml", |
| 93 | {{ end -}} |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 94 | "-rest_api_address", ":{{ .Values.bbsim_rest_port }}", |
| 95 | "-ca", "{{ .Values.controlledActivation }}", |
| 96 | "-omci_response_rate", "{{ .Values.omci_response_rate }}", |
Matteo Scandolo | a205aad | 2022-03-18 10:13:18 -0700 | [diff] [blame] | 97 | {{ if .Values.injectOmciUnknownMe }} |
| 98 | "-injectOmciUnknownMe", |
| 99 | {{ end -}} |
Matteo Scandolo | d7938f1 | 2022-02-18 08:27:52 -0800 | [diff] [blame] | 100 | {{ if .Values.injectOmciUnknownAttributes }} |
| 101 | "-injectOmciUnknownAttributes", |
| 102 | {{ end -}} |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 103 | {{ if .Values.enableEvents -}} |
| 104 | "-enableEvents", |
| 105 | "-kafkaAddress", "{{ .Values.kafkaAddress }}", |
| 106 | {{ end -}} |
| 107 | {{ if .Values.enablePerf -}} |
| 108 | "-enableperf", |
| 109 | {{ end -}} |
| 110 | "-kafkaEventTopic", "{{ .Values.kafkaEventTopic }}", |
| 111 | {{ if .Values.authRetry -}} |
| 112 | "-authRetry", |
| 113 | {{ end -}} |
| 114 | {{ if .Values.dhcpRetry -}} |
| 115 | "-dhcpRetry", |
| 116 | {{ end -}} |
| 117 | ] |
| 118 | ports: |
| 119 | - name: "bbsim-{{ .Values.olt_id }}" |
| 120 | containerPort: {{ .Values.olt_tcp_port }} |
| 121 | protocol: TCP |
| 122 | - name: "bbsim-{{ .Values.olt_id }}-api" |
| 123 | containerPort: {{ .Values.bbsim_api_port }} |
| 124 | protocol: TCP |
| 125 | - name: "bbsim-{{ .Values.olt_id }}-sadis" |
| 126 | containerPort: {{ .Values.bbsim_sadis_port }} |
| 127 | protocol: TCP |
| 128 | - name: "bbsim-{{ .Values.olt_id }}-rest" |
| 129 | containerPort: {{ .Values.bbsim_rest_port }} |
| 130 | protocol: TCP |
| 131 | - name: "bbsim-{{ .Values.olt_id }}-dmi" |
| 132 | containerPort: {{ .Values.bbsim_dmi_port }} |
| 133 | protocol: TCP |
| 134 | env: |
| 135 | - name: POD_IP |
| 136 | valueFrom: |
| 137 | fieldRef: |
| 138 | fieldPath: status.podIP |
| 139 | - name: NAMESPACE |
| 140 | valueFrom: |
| 141 | fieldRef: |
| 142 | fieldPath: metadata.namespace |
| 143 | resources: |
| 144 | {{ toYaml .Values.resources | indent 12 }} |
| 145 | volumeMounts: |
| 146 | - name: bbsim-services-config |
| 147 | mountPath: /app/configs/services.yaml |
| 148 | subPath: services.yaml |
Elia Battiston | 587c6b2 | 2022-02-21 18:41:31 +0100 | [diff] [blame] | 149 | - name: bbsim-pon-ports-config |
| 150 | mountPath: /app/configs/pon-config.yaml |
| 151 | subPath: pon-config.yaml |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 152 | volumes: |
| 153 | - name: bbsim-services-config |
| 154 | configMap: |
| 155 | name: bbsim-services-{{ .Values.olt_id }} |
| 156 | items: |
| 157 | - key: bbsimServicesConfig |
| 158 | path: services.yaml |
Elia Battiston | 587c6b2 | 2022-02-21 18:41:31 +0100 | [diff] [blame] | 159 | - name: bbsim-pon-ports-config |
| 160 | configMap: |
| 161 | name: bbsim-pon-ports-{{ .Values.olt_id }} |
| 162 | items: |
| 163 | - key: bbsimPonPortsConfig |
| 164 | path: pon-config.yaml |
Matteo Scandolo | 71d97d9 | 2021-06-24 11:58:32 +0200 | [diff] [blame] | 165 | {{- with .Values.nodeSelector }} |
| 166 | nodeSelector: |
| 167 | {{ toYaml . | indent 8 }} |
| 168 | {{- end }} |
| 169 | {{- with .Values.affinity }} |
| 170 | affinity: |
| 171 | {{ toYaml . | indent 8 }} |
| 172 | {{- end }} |
| 173 | {{- with .Values.tolerations }} |
| 174 | tolerations: |
| 175 | {{ toYaml . | indent 8 }} |
| 176 | {{- end }} |