blob: f29754621d10d1791fcf1392423a8cfc7e397ef9 [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: v1
21kind: Service
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 -070025 labels:
Sreeju7d7fc072019-06-13 12:03:00 -060026 name: onu{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070027spec:
28 ports:
29 - name: grpc
30 port: 50061
31 targetPort: 50061
32 selector:
Sreeju7d7fc072019-06-13 12:03:00 -060033 app: onu{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070034---
35apiVersion: apps/v1beta1
36kind: Deployment
37metadata:
Sreeju7d7fc072019-06-13 12:03:00 -060038 name: onu{{ $i }}-{{ $j }}
Andy Baviere21a5f52019-05-28 15:39:52 -070039 namespace: {{ $.Values.global.namespace }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070040spec:
41 replicas: 1
42 template:
43 metadata:
44 labels:
Sreeju7d7fc072019-06-13 12:03:00 -060045 app: onu{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070046 annotations:
Sreeju7d7fc072019-06-13 12:03:00 -060047 cni: "calico,pon{{ $i }}.{{ $j }}"
Andy Bavier2259a6b2018-07-12 15:27:48 -070048 spec:
49 affinity:
50 podAffinity:
51 preferredDuringSchedulingIgnoredDuringExecution:
52 - weight: 100
53 podAffinityTerm:
54 labelSelector:
55 matchExpressions:
56 - key: app
57 operator: In
58 values:
Sreeju7d7fc072019-06-13 12:03:00 -060059 - rg{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070060 topologyKey: kubernetes.io/hostname
Andy Bavier2259a6b2018-07-12 15:27:48 -070061 containers:
Sreeju7d7fc072019-06-13 12:03:00 -060062 - name: onu{{ $i }}-{{ $j }}
Andy Baviere21a5f52019-05-28 15:39:52 -070063 image: "{{ $.Values.global.registry }}{{ $.Values.images.onu.repository }}:{{ tpl $.Values.images.onu.tag $ }}"
64 imagePullPolicy: {{ $.Values.images.onu.pullPolicy }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070065 env:
66 - name: POD_IP
67 valueFrom:
68 fieldRef:
69 fieldPath: status.podIP
70 - name: NAMESPACE
71 valueFrom:
72 fieldRef:
73 fieldPath: metadata.namespace
Andy Bavier2259a6b2018-07-12 15:27:48 -070074 args:
75 - "/app/ponsim"
76 - "-device_type"
77 - "ONU"
78 - "-parent_addr"
Andy Baviere21a5f52019-05-28 15:39:52 -070079 - "olt{{ $i }}"
Andy Bavier2259a6b2018-07-12 15:27:48 -070080 - "-grpc_port"
81 - "50061"
82 - "-internal_if"
83 - "eth0"
84 - "-external_if"
85 - "eth1"
86 - "-promiscuous"
Andy Baviere21a5f52019-05-28 15:39:52 -070087{{- if not $.Values.legacyPonsim }}
88 - "-serial_number"
Sreeju7d7fc072019-06-13 12:03:00 -060089 - "PSMO{{ printf "%04d%04d" $i $j }}"
90{{- end }}
Andy Baviere21a5f52019-05-28 15:39:52 -070091{{- end }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070092
93 ports:
94 - containerPort: 50061
95 name: grpc-port
Sreeju7d7fc072019-06-13 12:03:00 -060096{{- end }}