Azure / karpenter-provider-azure

AKS Karpenter Provider
Apache License 2.0
308 stars 47 forks source link

Karpenter sometimes cannot create nodes/NodeClaims for workloads with zone affinity constraints #339

Closed comtalyst closed 1 month ago

comtalyst commented 1 month ago

Version

Karpenter Version: v0.4.0

Kubernetes Version: v1.28.5

Expected Behavior

When deploying a workload with zone affinity constraints such as below and scale-up is required, the scaleup should occur, with both NodeClaims and nodes created to handle the workloads.

preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
    labelSelector:
      matchExpressions:
      - key: app
        operator: In
        values:
        - inflate
    topologyKey: topology.kubernetes.io/zone
  weight: 100

Actual Behavior

NodeClaims might not be created, and the error log below might occur:

The NodeClaim "..." is invalid: spec.requirements[3].key: Invalid value: "string": label domain "kubernetes.io" is restricted

The requirements index can be varied.

Steps to Reproduce the Problem

Deploy a deployment with above affinity on a zoned region.

Resource Specs and Logs

See above.

Community Note

comtalyst commented 1 month ago

Working on it