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 | |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 16 | {{- $rgcount := (.Values.numOnus|int) }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 17 | {{- range $i, $junk := until (.Values.numOlts|int) }} |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 18 | {{- range $j, $junk1 := until ($rgcount) }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 19 | --- |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 20 | apiVersion: apps/v1beta1 |
| 21 | kind: Deployment |
| 22 | metadata: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 23 | name: rg{{ $i }}-{{ $j }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 24 | namespace: {{ $.Values.global.namespace }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 25 | spec: |
| 26 | replicas: 1 |
| 27 | template: |
| 28 | metadata: |
| 29 | labels: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 30 | app: rg{{ $i }}-{{ $j }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 31 | annotations: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 32 | cni: "pon{{ $i }}.{{ $j }}" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 33 | spec: |
| 34 | affinity: |
| 35 | podAffinity: |
| 36 | preferredDuringSchedulingIgnoredDuringExecution: |
| 37 | - weight: 100 |
| 38 | podAffinityTerm: |
| 39 | labelSelector: |
| 40 | matchExpressions: |
| 41 | - key: app |
| 42 | operator: In |
| 43 | values: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 44 | - onu{{ $i }}-{{ $j }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 45 | topologyKey: kubernetes.io/hostname |
| 46 | containers: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 47 | - name: rg{{ $i }}-{{ $j }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 48 | image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}" |
| 49 | imagePullPolicy: {{ $.Values.images.rg.pullPolicy }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 50 | 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 Bavier | 76af8b8 | 2018-08-21 17:48:24 -0700 | [diff] [blame] | 60 | securityContext: |
| 61 | privileged: true |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 62 | {{- end }} |
| 63 | {{- end }} |