blob: 732014a8cb29ce42d75cc486fb95e7997601d6b2 [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{{- $rgcount := (.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 ($rgcount) }}
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: rg{{ $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 rg: rg{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070032 annotations:
Sreeju7d7fc072019-06-13 12:03:00 -060033 cni: "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: onu
Andy Bavier2259a6b2018-07-12 15:27:48 -070043 operator: In
44 values:
Sreeju7d7fc072019-06-13 12:03:00 -060045 - onu{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070046 topologyKey: kubernetes.io/hostname
47 containers:
Sreeju7d7fc072019-06-13 12:03:00 -060048 - name: rg{{ $i }}-{{ $j }}
Andy Baviere21a5f52019-05-28 15:39:52 -070049 image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}"
50 imagePullPolicy: {{ $.Values.images.rg.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
60 command: [ "/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait" ]
Andy Bavier76af8b82018-08-21 17:48:24 -070061 securityContext:
62 privileged: true
Sreeju7d7fc072019-06-13 12:03:00 -060063{{- end }}
64{{- end }}