Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 1 | --- |
| 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.uluderya | 3a4548f | 2020-04-01 13:47:17 -0700 | [diff] [blame] | 15 | {{- $log_level := tpl .Values.log_level . }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 16 | |
David K. Bainbridge | e1aba80 | 2020-06-25 21:53:17 -0700 | [diff] [blame] | 17 | apiVersion: apps/v1 |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ template "bbsim.fullname" . }} |
Jonathan Hart | f6c66e2 | 2020-02-10 13:47:19 -0800 | [diff] [blame] | 21 | namespace: {{ .Release.Namespace }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 22 | labels: |
David Bainbridge | 70c0f30 | 2020-05-22 09:58:34 -0700 | [diff] [blame] | 23 | app: "bbsim" |
| 24 | name: {{ template "bbsim.name" . }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 25 | chart: {{ template "bbsim.chart" . }} |
| 26 | release: {{ .Release.Name }} |
| 27 | heritage: {{ .Release.Service }} |
| 28 | spec: |
| 29 | replicas: {{ .Values.replicaCount }} |
| 30 | selector: |
| 31 | matchLabels: |
David Bainbridge | 70c0f30 | 2020-05-22 09:58:34 -0700 | [diff] [blame] | 32 | app: "bbsim" |
| 33 | name: {{ template "bbsim.name" . }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 34 | release: {{ .Release.Name }} |
| 35 | template: |
| 36 | metadata: |
| 37 | labels: |
Matteo Scandolo | 822d0c1 | 2020-04-07 18:31:27 -0700 | [diff] [blame] | 38 | app: "bbsim" |
David Bainbridge | 70c0f30 | 2020-05-22 09:58:34 -0700 | [diff] [blame] | 39 | name: {{ template "bbsim.name" . }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 40 | release: {{ .Release.Name }} |
Matteo Scandolo | 822d0c1 | 2020-04-07 18:31:27 -0700 | [diff] [blame] | 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 }}" |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 47 | spec: |
| 48 | serviceAccount: {{ .Values.serviceAccountName }} |
| 49 | serviceAccountName: {{ .Values.serviceAccountName }} |
| 50 | containers: |
| 51 | - name: {{ .Chart.Name }} |
serkant.uluderya | 3a4548f | 2020-04-01 13:47:17 -0700 | [diff] [blame] | 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 . }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 54 | securityContext: |
Matteo Scandolo | af538bd | 2020-12-08 11:33:58 -0800 | [diff] [blame^] | 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 |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 71 | command: [ |
| 72 | "/app/bbsim", |
Andrey Pozolotin | b8fb016 | 2020-09-10 16:04:20 +0300 | [diff] [blame] | 73 | "-openolt_address", ":{{ .Values.olt_tcp_port }}", |
Matteo Scandolo | 3ed0289 | 2019-10-07 09:57:06 -0700 | [diff] [blame] | 74 | "-olt_id", "{{ .Values.olt_id }}", |
| 75 | "-nni", "{{ .Values.nni }}", |
| 76 | "-pon", "{{ .Values.pon }}", |
| 77 | "-onu", "{{ .Values.onu }}", |
Matteo Scandolo | 9b10cf6 | 2020-09-30 15:00:51 -0700 | [diff] [blame] | 78 | "-oltRebootDelay", "{{ .Values.oltRebootDelay }}", |
serkant.uluderya | 3a4548f | 2020-04-01 13:47:17 -0700 | [diff] [blame] | 79 | "-logLevel", "{{ $log_level }}", |
Pragya Arya | 87231de | 2020-03-11 17:30:23 +0530 | [diff] [blame] | 80 | "-delay", "{{ .Values.delay }}", |
Matteo Scandolo | 9dab4bd | 2020-08-24 12:29:48 -0700 | [diff] [blame] | 81 | "-services", "configs/services.yaml", |
Matteo Scandolo | b2d061f | 2020-09-09 08:31:24 -0700 | [diff] [blame] | 82 | "-rest_api_address", ":{{ .Values.bbsim_rest_port }}", |
| 83 | "-ca", "{{ .Values.controlledActivation }}", |
Pragya Arya | 87231de | 2020-03-11 17:30:23 +0530 | [diff] [blame] | 84 | {{ if .Values.enableEvents -}} |
| 85 | "-enableEvents", |
| 86 | "-kafkaAddress", "{{ .Values.kafkaAddress }}", |
| 87 | {{ end -}} |
| 88 | {{ if .Values.enablePerf -}} |
Matteo Scandolo | 189d39f | 2020-04-23 16:11:26 -0700 | [diff] [blame] | 89 | "-enableperf", |
Pragya Arya | 87231de | 2020-03-11 17:30:23 +0530 | [diff] [blame] | 90 | {{ end -}} |
Shrey Baid | f2a4e2c | 2020-06-16 22:49:41 +0530 | [diff] [blame] | 91 | "-kafkaEventTopic", "{{ .Values.kafkaEventTopic }}", |
| 92 | {{ if .Values.authRetry -}} |
| 93 | "-authRetry", |
| 94 | {{ end -}} |
| 95 | {{ if .Values.dhcpRetry -}} |
| 96 | "-dhcpRetry", |
| 97 | {{ end -}} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 98 | ] |
| 99 | ports: |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 100 | - name: "bbsim-{{ .Values.olt_id }}" |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 101 | containerPort: {{ .Values.olt_tcp_port }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 102 | protocol: TCP |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 103 | - name: "bbsim-{{ .Values.olt_id }}-api" |
| 104 | containerPort: {{ .Values.bbsim_api_port }} |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 105 | protocol: TCP |
| 106 | - name: "bbsim-{{ .Values.olt_id }}-sadis" |
| 107 | containerPort: {{ .Values.bbsim_sadis_port }} |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 108 | protocol: TCP |
Andrey Pozolotin | 9a10944 | 2020-09-07 22:22:39 +0300 | [diff] [blame] | 109 | - name: "bbsim-{{ .Values.olt_id }}-rest" |
| 110 | containerPort: {{ .Values.bbsim_rest_port }} |
| 111 | protocol: TCP |
Andrea Campanella | 28398c0 | 2020-10-13 14:48:41 +0200 | [diff] [blame] | 112 | - name: "bbsim-{{ .Values.olt_id }}-dmi" |
| 113 | containerPort: {{ .Values.bbsim_dmi_port }} |
| 114 | protocol: TCP |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 115 | env: |
| 116 | - name: POD_IP |
| 117 | valueFrom: |
| 118 | fieldRef: |
| 119 | fieldPath: status.podIP |
| 120 | - name: NAMESPACE |
| 121 | valueFrom: |
| 122 | fieldRef: |
| 123 | fieldPath: metadata.namespace |
| 124 | resources: |
| 125 | {{ toYaml .Values.resources | indent 12 }} |
Matteo Scandolo | 9dab4bd | 2020-08-24 12:29:48 -0700 | [diff] [blame] | 126 | volumeMounts: |
| 127 | - name: bbsim-services-config |
| 128 | mountPath: /app/configs/services.yaml |
| 129 | subPath: services.yaml |
| 130 | volumes: |
| 131 | - name: bbsim-services-config |
| 132 | configMap: |
| 133 | name: bbsim-services-{{ .Values.olt_id }} |
| 134 | items: |
| 135 | - key: bbsimServicesConfig |
| 136 | path: services.yaml |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 137 | {{- with .Values.nodeSelector }} |
| 138 | nodeSelector: |
| 139 | {{ toYaml . | indent 8 }} |
| 140 | {{- end }} |
| 141 | {{- with .Values.affinity }} |
| 142 | affinity: |
| 143 | {{ toYaml . | indent 8 }} |
| 144 | {{- end }} |
| 145 | {{- with .Values.tolerations }} |
| 146 | tolerations: |
| 147 | {{ toYaml . | indent 8 }} |
| 148 | {{- end }} |