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 | --- |
Matteo Scandolo | 5628d4b | 2021-01-11 11:46:12 -0800 | [diff] [blame] | 20 | apiVersion: apps/v1 |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 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: |
Andy Bavier | 8c0a03d | 2019-07-02 14:54:28 -0700 | [diff] [blame] | 30 | app: ponsim |
| 31 | rg: rg{{ $i }}-{{ $j }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 32 | annotations: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 33 | cni: "pon{{ $i }}.{{ $j }}" |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 34 | spec: |
| 35 | affinity: |
| 36 | podAffinity: |
| 37 | preferredDuringSchedulingIgnoredDuringExecution: |
| 38 | - weight: 100 |
| 39 | podAffinityTerm: |
| 40 | labelSelector: |
| 41 | matchExpressions: |
Andy Bavier | 8c0a03d | 2019-07-02 14:54:28 -0700 | [diff] [blame] | 42 | - key: onu |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 43 | operator: In |
| 44 | values: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 45 | - onu{{ $i }}-{{ $j }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 46 | topologyKey: kubernetes.io/hostname |
| 47 | containers: |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 48 | - name: rg{{ $i }}-{{ $j }} |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 49 | image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}" |
| 50 | imagePullPolicy: {{ $.Values.images.rg.pullPolicy }} |
Andy Bavier | 2259a6b | 2018-07-12 15:27:48 -0700 | [diff] [blame] | 51 | 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 Bavier | 76af8b8 | 2018-08-21 17:48:24 -0700 | [diff] [blame] | 61 | securityContext: |
| 62 | privileged: true |
Sreeju | 7d7fc07 | 2019-06-13 12:03:00 -0600 | [diff] [blame] | 63 | {{- end }} |
| 64 | {{- end }} |