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: |
| 55 | privileged: true |
| 56 | command: [ |
| 57 | "/app/bbsim", |
Andrey Pozolotin | b8fb016 | 2020-09-10 16:04:20 +0300 | [diff] [blame^] | 58 | "-openolt_address", ":{{ .Values.olt_tcp_port }}", |
Matteo Scandolo | 3ed0289 | 2019-10-07 09:57:06 -0700 | [diff] [blame] | 59 | "-olt_id", "{{ .Values.olt_id }}", |
| 60 | "-nni", "{{ .Values.nni }}", |
| 61 | "-pon", "{{ .Values.pon }}", |
| 62 | "-onu", "{{ .Values.onu }}", |
serkant.uluderya | 3a4548f | 2020-04-01 13:47:17 -0700 | [diff] [blame] | 63 | "-logLevel", "{{ $log_level }}", |
Pragya Arya | 87231de | 2020-03-11 17:30:23 +0530 | [diff] [blame] | 64 | "-delay", "{{ .Values.delay }}", |
Matteo Scandolo | 9dab4bd | 2020-08-24 12:29:48 -0700 | [diff] [blame] | 65 | "-services", "configs/services.yaml", |
Matteo Scandolo | b2d061f | 2020-09-09 08:31:24 -0700 | [diff] [blame] | 66 | "-rest_api_address", ":{{ .Values.bbsim_rest_port }}", |
| 67 | "-ca", "{{ .Values.controlledActivation }}", |
Pragya Arya | 87231de | 2020-03-11 17:30:23 +0530 | [diff] [blame] | 68 | {{ if .Values.enableEvents -}} |
| 69 | "-enableEvents", |
| 70 | "-kafkaAddress", "{{ .Values.kafkaAddress }}", |
| 71 | {{ end -}} |
| 72 | {{ if .Values.enablePerf -}} |
Matteo Scandolo | 189d39f | 2020-04-23 16:11:26 -0700 | [diff] [blame] | 73 | "-enableperf", |
Pragya Arya | 87231de | 2020-03-11 17:30:23 +0530 | [diff] [blame] | 74 | {{ end -}} |
Shrey Baid | f2a4e2c | 2020-06-16 22:49:41 +0530 | [diff] [blame] | 75 | "-kafkaEventTopic", "{{ .Values.kafkaEventTopic }}", |
| 76 | {{ if .Values.authRetry -}} |
| 77 | "-authRetry", |
| 78 | {{ end -}} |
| 79 | {{ if .Values.dhcpRetry -}} |
| 80 | "-dhcpRetry", |
| 81 | {{ end -}} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 82 | ] |
| 83 | ports: |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 84 | - name: "bbsim-{{ .Values.olt_id }}" |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 85 | containerPort: {{ .Values.olt_tcp_port }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 86 | protocol: TCP |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 87 | - name: "bbsim-{{ .Values.olt_id }}-api" |
| 88 | containerPort: {{ .Values.bbsim_api_port }} |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 89 | protocol: TCP |
| 90 | - name: "bbsim-{{ .Values.olt_id }}-sadis" |
| 91 | containerPort: {{ .Values.bbsim_sadis_port }} |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 92 | protocol: TCP |
Andrey Pozolotin | 9a10944 | 2020-09-07 22:22:39 +0300 | [diff] [blame] | 93 | - name: "bbsim-{{ .Values.olt_id }}-rest" |
| 94 | containerPort: {{ .Values.bbsim_rest_port }} |
| 95 | protocol: TCP |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 96 | env: |
| 97 | - name: POD_IP |
| 98 | valueFrom: |
| 99 | fieldRef: |
| 100 | fieldPath: status.podIP |
| 101 | - name: NAMESPACE |
| 102 | valueFrom: |
| 103 | fieldRef: |
| 104 | fieldPath: metadata.namespace |
| 105 | resources: |
| 106 | {{ toYaml .Values.resources | indent 12 }} |
Matteo Scandolo | 9dab4bd | 2020-08-24 12:29:48 -0700 | [diff] [blame] | 107 | volumeMounts: |
| 108 | - name: bbsim-services-config |
| 109 | mountPath: /app/configs/services.yaml |
| 110 | subPath: services.yaml |
| 111 | volumes: |
| 112 | - name: bbsim-services-config |
| 113 | configMap: |
| 114 | name: bbsim-services-{{ .Values.olt_id }} |
| 115 | items: |
| 116 | - key: bbsimServicesConfig |
| 117 | path: services.yaml |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 118 | {{- with .Values.nodeSelector }} |
| 119 | nodeSelector: |
| 120 | {{ toYaml . | indent 8 }} |
| 121 | {{- end }} |
| 122 | {{- with .Values.affinity }} |
| 123 | affinity: |
| 124 | {{ toYaml . | indent 8 }} |
| 125 | {{- end }} |
| 126 | {{- with .Values.tolerations }} |
| 127 | tolerations: |
| 128 | {{ toYaml . | indent 8 }} |
| 129 | {{- end }} |