From a4e7af2517dc59815785e093184915999eb42e32 Mon Sep 17 00:00:00 2001 From: torredil Date: Tue, 23 Aug 2022 18:16:08 +0000 Subject: [PATCH] Add controller nodeAffinity to prefer EC2 over Fargate Signed-off-by: torredil --- charts/aws-ebs-csi-driver/values.yaml | 11 ++++++++++- deploy/kubernetes/base/controller.yaml | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 2d7076c11c..bb11510f9e 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -90,7 +90,16 @@ fullnameOverride: controller: # If arbitrary args like "--aws-sdk-debug-log=true" need to be passed, use this value additionalArgs: [] - affinity: {} + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + preference: + matchExpressions: + - key: eks.amazonaws.com/compute-type + operator: NotIn + values: + - fargate # The default filesystem type of the volume to provision when fstype is unspecified in the StorageClass. # If the default is not set and fstype is unset in the StorageClass, then no fstype will be set defaultFsType: ext4 diff --git a/deploy/kubernetes/base/controller.yaml b/deploy/kubernetes/base/controller.yaml index 397c8e696f..3dc44b54fb 100644 --- a/deploy/kubernetes/base/controller.yaml +++ b/deploy/kubernetes/base/controller.yaml @@ -23,6 +23,15 @@ spec: kubernetes.io/os: linux serviceAccountName: ebs-csi-controller-sa priorityClassName: system-cluster-critical + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: eks.amazonaws.com/compute-type + operator: NotIn + values: + - fargate tolerations: - key: CriticalAddonsOnly operator: Exists