Skip to content

maxNoOfPodsToEvictPerNamespace to get a percentage value #1778

@ChobobDev

Description

@ChobobDev

Is your feature request related to a problem? Please describe.

Currently, maxNoOfPodsToEvictPerNamespace only accepts an integer value, which makes it difficult to configure eviction limits that scale proportionally with namespace size. In dynamic environments where namespaces have varying numbers of pods (e.g., 10 pods in namespace A vs 1000 pods in namespace B), setting a fixed integer limit is problematic:

Setting the limit too low (e.g., 10) prevents effective rebalancing in large namespaces
Setting the limit too high (e.g., 100) risks over-evicting in small namespaces, potentially causing service disruption
Manual recalculation and adjustment are required whenever namespace pod counts change significantly

This becomes especially challenging when using HPA (Horizontal Pod Autoscaler) where pod counts fluctuate automatically.

Describe the solution you'd like

Add support for percentage-based values in maxNoOfPodsToEvictPerNamespace, similar to how PodDisruptionBudget supports both integer and percentage values for maxUnavailable.
Example configuration:

pluginConfig:
- name: RemovePodsViolatingTopologySpreadConstraint
  args:
    maxNoOfPodsToEvictPerNamespace: "25%"  # Evict up to 25% of pods in each namespace

This would allow the descheduler to automatically calculate the eviction limit based on the current pod count in each namespace:

Namespace with 10 pods → max 2-3 evictions per cycle
Namespace with 100 pods → max 25 evictions per cycle
Namespace with 1000 pods → max 250 evictions per cycle

Describe alternatives you've considered

  • Continue using fixed integers: Requires constant monitoring and manual adjustment, not scalable
  • Use separate policy configurations per namespace: Creates configuration overhead and maintenance burden
    What version of descheduler are you using?

descheduler version: v 0.33.0 and 0.31.0

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions