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