blob: ae3203c26fbb95fabb069388e93f9913ca5c87e9 [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
Andy Baviere21a5f52019-05-28 15:39:52 -070016{{- range $i, $junk := until (.Values.numOlts|int) }}
17---
Andy Bavier2259a6b2018-07-12 15:27:48 -070018apiVersion: apps/v1beta1
19kind: Deployment
20metadata:
Andy Baviere21a5f52019-05-28 15:39:52 -070021 name: rg{{ $i }}
22 namespace: {{ $.Values.global.namespace }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070023spec:
24 replicas: 1
25 template:
26 metadata:
27 labels:
Andy Baviere21a5f52019-05-28 15:39:52 -070028 app: rg{{ $i }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070029 annotations:
Andy Baviere21a5f52019-05-28 15:39:52 -070030 cni: "pon{{ $i }}"
Andy Bavier2259a6b2018-07-12 15:27:48 -070031 spec:
32 affinity:
33 podAffinity:
34 preferredDuringSchedulingIgnoredDuringExecution:
35 - weight: 100
36 podAffinityTerm:
37 labelSelector:
38 matchExpressions:
39 - key: app
40 operator: In
41 values:
Andy Baviere21a5f52019-05-28 15:39:52 -070042 - onu{{ $i }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070043 topologyKey: kubernetes.io/hostname
44 containers:
Andy Baviere21a5f52019-05-28 15:39:52 -070045 - name: rg{{ $i }}
46 image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}"
47 imagePullPolicy: {{ $.Values.images.rg.pullPolicy }}
Andy Bavier2259a6b2018-07-12 15:27:48 -070048 env:
49 - name: POD_IP
50 valueFrom:
51 fieldRef:
52 fieldPath: status.podIP
53 - name: NAMESPACE
54 valueFrom:
55 fieldRef:
56 fieldPath: metadata.namespace
57 command: [ "/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait" ]
Andy Bavier76af8b82018-08-21 17:48:24 -070058 securityContext:
59 privileged: true
Andy Baviere21a5f52019-05-28 15:39:52 -070060{{- end }}