blob: 5bb865f174a0104512f0b6d0d6e5510c06d80d19 [file] [log] [blame]
Andy Bavier2259a6b2018-07-12 15:27:48 -07001---
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
Sreeju7d7fc072019-06-13 12:03:00 -060016{{- $onucount := (.Values.numOnus|int)}}
Andy Baviere21a5f52019-05-28 15:39:52 -070017{{- range $i, $junk := until (.Values.numOlts|int) }}
Sreeju7d7fc072019-06-13 12:03:00 -060018{{- range $j, $junk1 := until ($onucount) }}
Andy Baviere21a5f52019-05-28 15:39:52 -070019---
Andy Bavier2259a6b2018-07-12 15:27:48 -070020apiVersion: apps/v1beta1
21kind: Deployment
22metadata:
Sreeju7d7fc072019-06-13 12:03:00 -060023 name: onu{{ $i }}-{{ $j }}
Andy Baviere21a5f52019-05-28 15:39:52 -070024 namespace: {{ $.Values.global.namespace }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070025spec:
26 replicas: 1
27 template:
28 metadata:
29 labels:
Andy Bavier8c0a03d2019-07-02 14:54:28 -070030 app: ponsim
31 onu: onu{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070032 annotations:
Sreeju7d7fc072019-06-13 12:03:00 -060033 cni: "calico,pon{{ $i }}.{{ $j }}"
Andy Bavier2259a6b2018-07-12 15:27:48 -070034 spec:
35 affinity:
36 podAffinity:
37 preferredDuringSchedulingIgnoredDuringExecution:
38 - weight: 100
39 podAffinityTerm:
40 labelSelector:
41 matchExpressions:
Andy Bavier8c0a03d2019-07-02 14:54:28 -070042 - key: rg
Andy Bavier2259a6b2018-07-12 15:27:48 -070043 operator: In
44 values:
Sreeju7d7fc072019-06-13 12:03:00 -060045 - rg{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070046 topologyKey: kubernetes.io/hostname
Andy Bavier2259a6b2018-07-12 15:27:48 -070047 containers:
Sreeju7d7fc072019-06-13 12:03:00 -060048 - name: onu{{ $i }}-{{ $j }}
Andy Baviere21a5f52019-05-28 15:39:52 -070049 image: "{{ $.Values.global.registry }}{{ $.Values.images.onu.repository }}:{{ tpl $.Values.images.onu.tag $ }}"
50 imagePullPolicy: {{ $.Values.images.onu.pullPolicy }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070051 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 Bavier2259a6b2018-07-12 15:27:48 -070060 args:
61 - "/app/ponsim"
62 - "-device_type"
63 - "ONU"
64 - "-parent_addr"
Andy Baviere21a5f52019-05-28 15:39:52 -070065 - "olt{{ $i }}"
Andy Bavier2259a6b2018-07-12 15:27:48 -070066 - "-grpc_port"
67 - "50061"
68 - "-internal_if"
69 - "eth0"
70 - "-external_if"
71 - "eth1"
72 - "-promiscuous"
Andy Baviere21a5f52019-05-28 15:39:52 -070073{{- if not $.Values.legacyPonsim }}
74 - "-serial_number"
Sreeju7d7fc072019-06-13 12:03:00 -060075 - "PSMO{{ printf "%04d%04d" $i $j }}"
76{{- end }}
Andy Baviere21a5f52019-05-28 15:39:52 -070077{{- end }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070078
79 ports:
80 - containerPort: 50061
81 name: grpc-port
Sreeju7d7fc072019-06-13 12:03:00 -060082{{- end }}