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