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: olt{{ $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: olt{{ $i }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 25 | spec: |
| 26 | ports: |
| 27 | - name: grpc |
| 28 | port: 50060 |
| 29 | targetPort: 50060 |
| 30 | selector: |
Andy Bavier | 8c0a03d | 2019-07-02 14:54:28 -0700 | [diff] [blame] | 31 | olt: olt{{ $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: olt{{ $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 | 8c0a03d | 2019-07-02 14:54:28 -0700 | [diff] [blame] | 43 | app: ponsim |
| 44 | olt: olt{{ $i }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 45 | annotations: |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 46 | cni: "calico,nni{{ $i }}" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 47 | spec: |
Andy Bavier | 8c0a03d | 2019-07-02 14:54:28 -0700 | [diff] [blame] | 48 | affinity: |
| 49 | podAffinity: |
| 50 | preferredDuringSchedulingIgnoredDuringExecution: |
| 51 | - weight: 100 |
| 52 | podAffinityTerm: |
| 53 | labelSelector: |
| 54 | matchExpressions: |
| 55 | - key: app |
| 56 | operator: In |
| 57 | values: |
| 58 | - mininet |
| 59 | topologyKey: kubernetes.io/hostname |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 60 | containers: |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 61 | - name: olt{{ $i }} |
| 62 | image: "{{ $.Values.global.registry }}{{ $.Values.images.olt.repository }}:{{ tpl $.Values.images.olt.tag $ }}" |
| 63 | imagePullPolicy: {{ $.Values.images.olt.pullPolicy }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 64 | env: |
| 65 | - name: POD_IP |
| 66 | valueFrom: |
| 67 | fieldRef: |
| 68 | fieldPath: status.podIP |
| 69 | - name: NAMESPACE |
| 70 | valueFrom: |
| 71 | fieldRef: |
| 72 | fieldPath: metadata.namespace |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 73 | args: |
| 74 | - "/app/ponsim" |
| 75 | - "-device_type" |
| 76 | - "OLT" |
| 77 | - "-onus" |
| 78 | - "4" |
| 79 | - "-internal_if" |
Jonathan Hart | 26867b2 | 2018-08-14 14:53:28 -0700 | [diff] [blame] | 80 | - "eth1" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 81 | - "-external_if" |
Jonathan Hart | 26867b2 | 2018-08-14 14:53:28 -0700 | [diff] [blame] | 82 | - "eth1" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 83 | - "-vcore_endpoint" |
| 84 | - "vcore" |
| 85 | - "-promiscuous" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 86 | ports: |
| 87 | - containerPort: 50060 |
| 88 | name: grpc-port |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 89 | {{- end }} |