From 8448a44a5497c1c75d25c93da9b9bffb605fce81 Mon Sep 17 00:00:00 2001 From: ddomingu Date: Wed, 8 Jan 2025 22:29:42 +0100 Subject: [PATCH] Include anti-affinity rules when executing fio-distributed with VM workloads (#837) --- roles/fio_distributed/templates/server_vm.yml.j2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/fio_distributed/templates/server_vm.yml.j2 b/roles/fio_distributed/templates/server_vm.yml.j2 index 8d42170b1..11256a261 100644 --- a/roles/fio_distributed/templates/server_vm.yml.j2 +++ b/roles/fio_distributed/templates/server_vm.yml.j2 @@ -43,6 +43,18 @@ spec: resources: requests: memory: {{ workload_args.vm_memory | default('5G') }} + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - fio-benchmark-{{ trunc_uuid }} + topologyKey: "kubernetes.io/hostname" volumes: - name: registrydisk containerDisk: