Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -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 | |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 16 | {{- $onucount := (.Values.numOnus|int)}} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 17 | {{- range $i, $junk := until (.Values.numOlts|int) }} |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 18 | {{- range $j, $junk1 := until ($onucount) }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 19 | --- |
Matteo Scandolo | 5628d4b | 2021-01-11 11:46:12 -0800 | [diff] [blame] | 20 | apiVersion: apps/v1 |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 21 | kind: Deployment |
| 22 | metadata: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 23 | name: onu{{ $i }}-{{ $j }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 24 | namespace: {{ $.Values.global.namespace }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 25 | spec: |
| 26 | replicas: 1 |
| 27 | template: |
| 28 | metadata: |
| 29 | labels: |
Andy Bavier | 8c0a03d | 2019-07-02 14:54:28 -0700 | [diff] [blame] | 30 | app: ponsim |
| 31 | onu: onu{{ $i }}-{{ $j }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 32 | annotations: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 33 | cni: "calico,pon{{ $i }}.{{ $j }}" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 34 | spec: |
| 35 | affinity: |
| 36 | podAffinity: |
| 37 | preferredDuringSchedulingIgnoredDuringExecution: |
| 38 | - weight: 100 |
| 39 | podAffinityTerm: |
| 40 | labelSelector: |
| 41 | matchExpressions: |
Andy Bavier | 8c0a03d | 2019-07-02 14:54:28 -0700 | [diff] [blame] | 42 | - key: rg |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 43 | operator: In |
| 44 | values: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 45 | - rg{{ $i }}-{{ $j }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 46 | topologyKey: kubernetes.io/hostname |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 47 | containers: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 48 | - name: onu{{ $i }}-{{ $j }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 49 | image: "{{ $.Values.global.registry }}{{ $.Values.images.onu.repository }}:{{ tpl $.Values.images.onu.tag $ }}" |
| 50 | imagePullPolicy: {{ $.Values.images.onu.pullPolicy }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 51 | env: |
| 52 | - name: POD_IP |
| 53 | valueFrom: |
| 54 | fieldRef: |
| 55 | fieldPath: status.podIP |
| 56 | - name: NAMESPACE |
| 57 | valueFrom: |
| 58 | fieldRef: |
| 59 | fieldPath: metadata.namespace |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 60 | args: |
| 61 | - "/app/ponsim" |
| 62 | - "-device_type" |
| 63 | - "ONU" |
| 64 | - "-parent_addr" |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 65 | - "olt{{ $i }}" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 66 | - "-grpc_port" |
| 67 | - "50061" |
| 68 | - "-internal_if" |
| 69 | - "eth0" |
| 70 | - "-external_if" |
| 71 | - "eth1" |
| 72 | - "-promiscuous" |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 73 | {{- if not $.Values.legacyPonsim }} |
| 74 | - "-serial_number" |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 75 | - "PSMO{{ printf "%04d%04d" $i $j }}" |
| 76 | {{- end }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 77 | {{- end }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 78 | |
| 79 | ports: |
| 80 | - containerPort: 50061 |
| 81 | name: grpc-port |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 82 | {{- end }} |