improve affinity spread of rw cores

Change-Id: Iaf6460710e4b7497ffc431beabf1a0bfa6fd7f1d
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index 5e199c8..aa52ca8 100644
--- a/voltha/Chart.yaml
+++ b/voltha/Chart.yaml
@@ -17,5 +17,5 @@
 description: A Helm chart for Voltha based on K8S resources in Voltha project
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 2.0.0
+version: 2.0.1
 appVersion: 2.0.0
diff --git a/voltha/templates/rw-core.yaml b/voltha/templates/rw-core.yaml
index 4dd0e06..5be011d 100644
--- a/voltha/templates/rw-core.yaml
+++ b/voltha/templates/rw-core.yaml
@@ -17,7 +17,7 @@
 {{- $tag := tpl .Values.images.rw_core.tag . }}
 {{- range $i, $e := until $count }}
 {{- $core_idx := add $i 1 }}
-{{- $pair_idx := div $i 2 | int }}
+{{- $affinity_group := add1 (mod $i 2) }}
 ---
 apiVersion: apps/v1
 kind: Deployment
@@ -33,19 +33,29 @@
     metadata:
       labels:
         app: rw-core
-        affinity-index: anti-affinity-{{ $pair_idx }}
+        affinity-group: affinity-group-{{ $affinity_group }}
       annotations:
         cni: "calico"
     spec:
       affinity:
         podAntiAffinity:
+          preferredDuringSchedulingIgnoredDuringExecution:
+          - weight: 100
+            podAffinityTerm:
+              labelSelector:
+                matchExpressions:
+                - key: app
+                  operator: In
+                  values:
+                  - rw-core
+              topologyKey: "kubernetes.io/hostname"
           requiredDuringSchedulingIgnoredDuringExecution:
           - labelSelector:
               matchExpressions:
-              - key: affinity-index
+              - key: affinity-group
                 operator: In
                 values:
-                - anti-affinity-{{ $pair_idx }}
+                - affinity-group-{{ $affinity_group }}
             topologyKey: "kubernetes.io/hostname"
       serviceAccountName: {{ $root.Values.serviceaccount }}
       containers: