Multiple ponsimONU support - template updates
Change-Id: I1b4c79f61e0d0f9b566c09517c939bee890b41a3
diff --git a/ponsimv2/templates/rg.yaml b/ponsimv2/templates/rg.yaml
index ae3203c..44eb1e6 100644
--- a/ponsimv2/templates/rg.yaml
+++ b/ponsimv2/templates/rg.yaml
@@ -13,21 +13,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+{{- $rgcount := (.Values.numOnus|int) }}
{{- range $i, $junk := until (.Values.numOlts|int) }}
+{{- range $j, $junk1 := until ($rgcount) }}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
- name: rg{{ $i }}
+ name: rg{{ $i }}-{{ $j }}
namespace: {{ $.Values.global.namespace }}
spec:
replicas: 1
template:
metadata:
labels:
- app: rg{{ $i }}
+ app: rg{{ $i }}-{{ $j }}
annotations:
- cni: "pon{{ $i }}"
+ cni: "pon{{ $i }}.{{ $j }}"
spec:
affinity:
podAffinity:
@@ -39,10 +41,10 @@
- key: app
operator: In
values:
- - onu{{ $i }}
+ - onu{{ $i }}-{{ $j }}
topologyKey: kubernetes.io/hostname
containers:
- - name: rg{{ $i }}
+ - name: rg{{ $i }}-{{ $j }}
image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}"
imagePullPolicy: {{ $.Values.images.rg.pullPolicy }}
env:
@@ -57,4 +59,5 @@
command: [ "/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait" ]
securityContext:
privileged: true
-{{- end }}
\ No newline at end of file
+{{- end }}
+{{- end }}