eksctl addon aws-ebs-csi-driver setting nodeAffinity

0

Using an eksctl file to setup the EKS cluster and add-ons usually the addon for EBS CSI is like this:

addons:
- name: aws-ebs-csi-driver
  version: latest
  resolveConflicts: overwrite

The eksctl documentation says that is possible to use a field configurationValues: to set custom values in addon deployment.

But the EBS CSI driver has a Deployment ebs-csi-controller in kube-system namespace with the following affinity setup:

      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 1
              preference:
                matchExpressions:
                  - key: eks.amazonaws.com/compute-type
                    operator: NotIn
                    values:
                      - fargate
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: app
                      operator: In
                      values:
                        - ebs-csi-controller
                topologyKey: kubernetes.io/hostname

so the question is if is possible to add a nodeAffinity to complement the default affinity using the field configurationValues: of eksctl file on addons setup, and if yes how to do it?

For the moment the "fix" was done changing direct the Deployment object in the EKS.

The need for this kind of customization is because if you have a specific nodegroup to run core services, like EBS CSI, will be necessary to add a custom affinity to put them (are 2 replicas) on there.

profile picture
asked a year ago794 views
1 Answer
0

You can use the following command to see supported configuration options for EBS CSI driver

aws eks describe-addon-configuration --addon-name aws-ebs-csi-driver --addon-version v1.15.0-eksbuild.1

nodeAffinity is not a supported input value, but nodeSelector is. Is that sufficient for your use case?

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions