aws / karpenter-provider-aws

Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.
https://karpenter.sh
Apache License 2.0
6.77k stars 953 forks source link

The Discription of DisruptionBudge with non-percentage value is incorrect #6814

Open dan12315 opened 2 months ago

dan12315 commented 2 months ago

Description

How can the docs be improved?

https://github.com/aws/karpenter-provider-aws/blob/main/website/content/en/v1.0/concepts/disruption.md#nodes

If the budget is configured with a percentage value, such as 20%, Karpenter will calculate the number of allowed disruptions as allowed_disruptions = roundup(total * percentage) - total_deleting - total_notready. If otherwise defined as a non-percentage value, Karpenter will simply subtract the number of nodes from the total (total - non_percentage_value) - total_deleting - total_notready. For multiple budgets in a NodePool, Karpenter will take the minimum value (most restrictive) of each of the budgets.

From the example offered below, the , It should be "If otherwise defined as a non-percentage value, Karpenter will simply use this number as budget : non_percentage_value - total_deleting - total_notready"

jfmrm commented 3 weeks ago

I'm having some trouble understanding this as well... The semantic of the given formula is "the number of nodes I want to protect" while the example shows a different semantic "the number of nodes I accept to be disrupted", which is the same semantic of the percentage value formula.

matheusraz commented 3 weeks ago

As @jfmrm mentioned, I believe the problem is how the formula is defined in the docs. Instead of considering total - non_percentage_value as the total of allowed_disruptions it should be non_percentage_value directly