From 994fef22f5602793b70ac33d183391f57360060a Mon Sep 17 00:00:00 2001 From: bravof Date: Tue, 15 Sep 2020 15:36:59 -0300 Subject: [PATCH] fix(pod affinity): pods now are scheduled into the same node to allow file sharing --- .../charts/snmpexporter/templates/deployment.yaml | 11 ++++++++++- .../helm-charts/eechart/templates/statefulset.yaml | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml b/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml index 5aef90fe..f9920ea6 100644 --- a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml +++ b/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml @@ -3,12 +3,21 @@ kind: Deployment metadata: name: {{ include "snmpexporter.fullname" . }} labels: - {{- include "snmpexporter.labels" . | nindent 4 }} + vnf: {{ .Values.global.osm.vnf_id | lower}} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "snmpexporter.selectorLabels" . | nindent 6 }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: vnf + operator: In + values: + - {{ .Values.global.osm.vnf_id | lower}} template: metadata: labels: diff --git a/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml b/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml index 1868dd86..dbde1114 100755 --- a/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml +++ b/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml @@ -3,7 +3,7 @@ kind: StatefulSet metadata: name: {{ include "eechart.fullname" . }} labels: -{{ include "eechart.labels" . | indent 4 }} + vnf: {{ .Values.global.osm.vnf_id | lower}} spec: serviceName: {{ include "eechart.fullname" . }} replicas: {{ .Values.replicaCount }} -- GitLab