Voltha stacks on same node
Change-Id: Ide97ca9ed76c206e51d424dcb427854e119efa24
diff --git a/voltha-adapter-openonu/templates/openonu-go-deploy.yaml b/voltha-adapter-openonu/templates/openonu-go-deploy.yaml
index ccf984e..72c2771 100644
--- a/voltha-adapter-openonu/templates/openonu-go-deploy.yaml
+++ b/voltha-adapter-openonu/templates/openonu-go-deploy.yaml
@@ -134,3 +134,30 @@
{{- if .Values.resources.limits.cpu }}
cpu: {{ .Values.resources.limits.cpu }}
{{- end }}
+ affinity:
+ podAffinity:
+ preferredDuringSchedulingIgnoredDuringExecution:
+ {{- if .Values.scheduleRules.preferStackPodsOnSameNode }}
+ - podAffinityTerm:
+ topologyKey: kubernetes.io/hostname
+ labelSelector:
+ matchExpressions:
+ - key: app.kubernetes.io/stack
+ operator: In
+ values:
+ - {{ .Values.global.stack_name }}
+ weight: 100
+ {{- end }}
+ podAntiAffinity:
+ preferredDuringSchedulingIgnoredDuringExecution:
+ {{- if .Values.scheduleRules.preferStacksOnDifferentNodes }}
+ - podAffinityTerm:
+ topologyKey: kubernetes.io/hostname
+ labelSelector:
+ matchExpressions:
+ - key: app.kubernetes.io/name
+ operator: In
+ values:
+ - adapter-open-onu
+ weight: 100
+ {{- end }}