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.