Open bwmetcalf opened 1 month ago
So if I understand correctly, you're doing
product: blah
labeled podsproduct: blah
pods. These pods that you've shared don't have the product: blah
label. Is this expected? If you're trying to make them spread on each other, these TSC/anti-affinity constraints are targeting other pods, not the ones you've created.
In general, I'm wondering why you need preferred zonal and hostname spread, and also zonal anti affinity. You're trying to create a deployment that isn't scheduled on the same instance and also is spread evenly spread across each instance and AZ? Seems like you could either remove the required hostname anti affinity or the preferred zonal topology spread, and that should make it easier to reason about.
Description
Observed Behavior:
This will be rather long as I describe the different scenarios we've tested. We have a deployment that, by default, does not specify
topologySpreadConstraints
oraffinity
and using the k8s default constraints with no node selectors or tolerations, the three replicas get deployed across our three AZs in us-west-2 to our untainted node pool. We are attempting to provide a dedicated node pool for this deployment and cannot seem to get karpenter to honor or work with different combinations oftopologySpreadConstraints
and/oraffinity
configurations. Below are the node pool and and subnet sections of the node class definitions, podnodeSelector
andtolerations
, along with the behavior we are seeing with the different scenarios.Node pool:
Node class snippet:
The first thing we tried is a
topologySpreadConstraints
definition as follow (tried withScheduleAnyway
andDoNotSchedule
):This resulted in karpenter spinning up the first node and scheduling all three pods on it. We then attempted the following:
which resulted in karpenter not responding at all and the first pod of the deployment never getting scheduled. The following schedules all three pods in the deployment, but does not spread them across AZs (the only change from above is the affinity topology key):
Below are from the pods:
Expected Behavior: Karpenter would honor the
topologySpreadConstraints
oraffinity
settings and spread pods across three nodes in three AZs.Reproduction Steps (Please include YAML):
Versions:
Chart Version:
0.37.0
Kubernetes Version (
kubectl version
):v1.28.11-eks-db838b0
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment