Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 1 | --- |
| 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 Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 16 | {{- range $i, $junk := until (.Values.numOlts|int) }} |
| 17 | --- |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 18 | apiVersion: apps/v1beta1 |
| 19 | kind: Deployment |
| 20 | metadata: |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 21 | name: rg{{ $i }} |
| 22 | namespace: {{ $.Values.global.namespace }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 23 | spec: |
| 24 | replicas: 1 |
| 25 | template: |
| 26 | metadata: |
| 27 | labels: |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 28 | app: rg{{ $i }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 29 | annotations: |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 30 | cni: "pon{{ $i }}" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 31 | 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 Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 42 | - onu{{ $i }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 43 | topologyKey: kubernetes.io/hostname |
| 44 | containers: |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 45 | - name: rg{{ $i }} |
| 46 | image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}" |
| 47 | imagePullPolicy: {{ $.Values.images.rg.pullPolicy }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 48 | 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 Bavier | 76af8b8 | 2018-08-21 17:48:24 -0700 | [diff] [blame] | 58 | securityContext: |
| 59 | privileged: true |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 60 | {{- end }} |