AWS EKS completly ignores 'topologySpreadConstraints'

0

Hey there,

When using AWS EKS 1.21, currently 1 node running, (incl. cluster-autoscaler with correctly functioning asg) and creating a deployment with 5 replicas and specifying 'topologySpreadConstraints' like this:

      topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: kubernetes.io/hostname
          whenUnsatisfiable: DoNotSchedule
          labelSelector:
            matchLabels:
              app: xxx

the scheduler ignores this completly and schedules all pods on the same node. (even though there is the 'DoNotSchedule') How can this be fixed? I want the cluster-autoscaler to see, that 2 nodes can not be scheduled.

Thanks in advance.

preguntada hace 2 años2189 visualizaciones
1 Respuesta
0
Respuesta aceptada

It is Kubernetes scheduler, not EKS, that schedules the pod.

That said, because you only had one node in one zone, the scheduler did not violate your constraints.

The skew is always 0. Please refer here as to how the skew is calculated.

Cluster Autoscaler does not consider this constraint when making scaling decisions.

You might want to consider increase the minimal and desired instance in your ASG.

Jason_S
respondido hace 2 años
  • Thank you. Is there a way to do this without having minimal / desired capacity set?

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas