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. |
| 15 | |
| 16 | apiVersion: extensions/v1beta1 |
| 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ template "bbsim.fullname" . }} |
Jonathan Hart | f6c66e2 | 2020-02-10 13:47:19 -0800 | [diff] [blame] | 20 | namespace: {{ .Release.Namespace }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 21 | labels: |
| 22 | app: {{ template "bbsim.name" . }} |
| 23 | chart: {{ template "bbsim.chart" . }} |
| 24 | release: {{ .Release.Name }} |
| 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
| 27 | replicas: {{ .Values.replicaCount }} |
| 28 | selector: |
| 29 | matchLabels: |
| 30 | app: {{ template "bbsim.name" . }} |
| 31 | release: {{ .Release.Name }} |
| 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ template "bbsim.name" . }} |
| 36 | release: {{ .Release.Name }} |
| 37 | spec: |
| 38 | serviceAccount: {{ .Values.serviceAccountName }} |
| 39 | serviceAccountName: {{ .Values.serviceAccountName }} |
| 40 | containers: |
| 41 | - name: {{ .Chart.Name }} |
Luca Prete | 61164ae | 2018-11-28 16:15:59 -0800 | [diff] [blame] | 42 | image: {{ .Values.global.registry }}{{ .Values.images.bbsim.repository }}:{{ tpl .Values.images.bbsim.tag . }} |
| 43 | imagePullPolicy: {{ .Values.images.bbsim.pullPolicy }} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 44 | securityContext: |
| 45 | privileged: true |
| 46 | command: [ |
| 47 | "/app/bbsim", |
Matteo Scandolo | 3ed0289 | 2019-10-07 09:57:06 -0700 | [diff] [blame] | 48 | "-olt_id", "{{ .Values.olt_id }}", |
| 49 | "-nni", "{{ .Values.nni }}", |
| 50 | "-pon", "{{ .Values.pon }}", |
| 51 | "-onu", "{{ .Values.onu }}", |
Matteo Scandolo | eb401ad | 2019-10-30 13:32:11 -0700 | [diff] [blame] | 52 | {{ if .Values.auth -}} |
| 53 | "-auth", |
| 54 | {{ end -}} |
| 55 | {{ if .Values.dhcp -}} |
| 56 | "-dhcp", |
| 57 | {{ end -}} |
Jonathan Hart | 1b9ae5c | 2020-02-11 16:54:45 -0800 | [diff] [blame] | 58 | "-c_tag", "{{ .Values.c_tag }}", |
| 59 | "-s_tag", "{{ .Values.s_tag }}", |
Pragya Arya | 87231de | 2020-03-11 17:30:23 +0530 | [diff] [blame] | 60 | "-delay", "{{ .Values.delay }}", |
| 61 | {{ if .Values.enableEvents -}} |
| 62 | "-enableEvents", |
| 63 | "-kafkaAddress", "{{ .Values.kafkaAddress }}", |
| 64 | {{ end -}} |
| 65 | {{ if .Values.enablePerf -}} |
| 66 | "-enableperf" |
| 67 | {{ end -}} |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 68 | ] |
| 69 | ports: |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 70 | - name: "bbsim-{{ .Values.olt_id }}" |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 71 | containerPort: {{ .Values.olt_tcp_port }} |
| 72 | port: {{ .Values.olt_tcp_port }} |
| 73 | protocol: TCP |
Matteo Scandolo | 812688a | 2019-12-11 09:16:53 -0800 | [diff] [blame] | 74 | - name: "bbsim-{{ .Values.olt_id }}-api" |
| 75 | containerPort: {{ .Values.bbsim_api_port }} |
| 76 | port: {{ .Values.bbsim_api_port }} |
| 77 | protocol: TCP |
| 78 | - name: "bbsim-{{ .Values.olt_id }}-sadis" |
| 79 | containerPort: {{ .Values.bbsim_sadis_port }} |
| 80 | port: {{ .Values.bbsim_sadis_port }} |
| 81 | protocol: TCP |
Zack Williams | 1849e61 | 2018-10-05 15:26:44 -0700 | [diff] [blame] | 82 | env: |
| 83 | - name: POD_IP |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | fieldPath: status.podIP |
| 87 | - name: NAMESPACE |
| 88 | valueFrom: |
| 89 | fieldRef: |
| 90 | fieldPath: metadata.namespace |
| 91 | resources: |
| 92 | {{ toYaml .Values.resources | indent 12 }} |
| 93 | {{- with .Values.nodeSelector }} |
| 94 | nodeSelector: |
| 95 | {{ toYaml . | indent 8 }} |
| 96 | {{- end }} |
| 97 | {{- with .Values.affinity }} |
| 98 | affinity: |
| 99 | {{ toYaml . | indent 8 }} |
| 100 | {{- end }} |
| 101 | {{- with .Values.tolerations }} |
| 102 | tolerations: |
| 103 | {{ toYaml . | indent 8 }} |
| 104 | {{- end }} |