Closed ricardomiguel-os closed 11 months ago
After removing the eviction-hard from the AWSNodeTemplate, the scheduler could schedule the pod. Does this mean that Karpenter doesn't consider AWSNodeTemplate user data configuration and the scheduler does?
If we want to change these values, can we only change them on the Provisioners?
The documentation mention that we can configure these fields on user data
You should set it on the provisioner/nodepool (see https://karpenter.sh/docs/concepts/nodepools/#eviction-thresholds). Those are then copied down to the Bottlerocket userdata. Karpenter needs these values for scheduling, which is why they're at the provisioner/nodepool level.
Ok, maybe this documentation with the eviction-hard
configuration misled us because we should configure this at provisioner/nodepool level.
Just one more question If we don't set any values on privisioner/nodepool kubeletConfiguration
Karpenter will assume default values right? Are they also copied and overridden to userdata?
Description
Observed Behavior: A pending pod requesting 768Mi memory cannot be scheduled because Karpenter provisions a node that doesn't have enough memory.
It seems that Karpenter is failing to calculate allocatable memory.
Expected Behavior: Karpenter should provision a node with the necessary resources to schedule the pod.
Reproduction Steps (Please include YAML):
1º Use Case - Without reserved capacity configured
Bottlerocket User Data
Karpenter logs
Provisioned node
Instance type: c6a.large
Memory capacity - Memory allocatable = 3880460Ki - 3173028862 = 3880460Ki - 3098661Ki = 781799Ki = 736Mb → 20,1% lost from the initial capacity.
Without any reserved capacity configured on the Botllerocket AWSNodeTemplate we lost around 20% of the memory from the initial capacity.
Since the pod needs 768Mi, if we sum with the Daemonsets (2280Mi + 768Mi) we get the memory that we need to schedule the pod = 3048Mi
So we need 3048Mi but the allocatable memory is 3026Mi = 3048Mi - 3026Mi = 22Mi missing to schedule the pod
2º Use Case - With reserved capacity configured
Bottlerocket User Data
Configured 512Mi of reserved memory
Karpenter logs
Provisioned node
Instance type: c6a.large
After setting up the reserved capacity (512Mi) on the Bottlerocket AWSNodeTemplate we were able to schedule the pod into the machine.
Memory capacity - Memory allocatable = 3880460Ki - 3238040574 = 3880460Ki - 3162149Ki = 718311Ki = 701Mb → 18,5% lost less allocatable memory from the initial capacity with the reserved memory configured.
Again we need 3048Mi but now the the allocatable memory is 3088Mi, thats why we can now fit the pod.
Note: Our provisioners doesn't have the
spec.kubeletConfiguration
configuredVersions:
Chart Version: v0.31.1
Kubernetes Version (
kubectl version
): v1.25Please 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