blob: 44eb1e68bd68a4815bd1b32780b8af2ee9528eb2 [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:
Sreeju7d7fc072019-06-13 12:03:00 -060030 app: rg{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070031 annotations:
Sreeju7d7fc072019-06-13 12:03:00 -060032 cni: "pon{{ $i }}.{{ $j }}"
Andy Bavier2259a6b2018-07-12 15:27:48 -070033 spec:
34 affinity:
35 podAffinity:
36 preferredDuringSchedulingIgnoredDuringExecution:
37 - weight: 100
38 podAffinityTerm:
39 labelSelector:
40 matchExpressions:
41 - key: app
42 operator: In
43 values:
Sreeju7d7fc072019-06-13 12:03:00 -060044 - onu{{ $i }}-{{ $j }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070045 topologyKey: kubernetes.io/hostname
46 containers:
Sreeju7d7fc072019-06-13 12:03:00 -060047 - name: rg{{ $i }}-{{ $j }}
Andy Baviere21a5f52019-05-28 15:39:52 -070048 image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}"
49 imagePullPolicy: {{ $.Values.images.rg.pullPolicy }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070050 env:
51 - name: POD_IP
52 valueFrom:
53 fieldRef:
54 fieldPath: status.podIP
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 fieldPath: metadata.namespace
59 command: [ "/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait" ]
Andy Bavier76af8b82018-08-21 17:48:24 -070060 securityContext:
61 privileged: true
Sreeju7d7fc072019-06-13 12:03:00 -060062{{- end }}
63{{- end }}