Skip to content

Proposal: Support Descheduler Extender Plugin #1726

@googs1025

Description

@googs1025
  • To enhance flexibility, Descheduler can support an Extender plugin (like upstream scheduler) allowing external services to make decision on whether a pod can be evicted. This enables integration with custom logic without modifying Descheduler code.
apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
profiles:
  - name: default
    pluginConfig:
      - ...
      - name: "ExternalDecision"
        args:
          # for the external HTTP service (Extender)
          extender:
            # Base URL of the external service
            urlPrefix: "https://127.0.0.1:8080"
            # endpoint path to call (e.g., POST <urlPrefix>/<decisionVerb>)
            decisionVerb: "evict" 
            # Whether to ignore failures (timeout, network error, non-200 response)
            ignorable: true                   # Required: true/false
            # Timeout for the HTTP request
            httpTimeout: 5s                   # Required: e.g., "5s"
            # Enable HTTPS
            enableHTTPS: true                 # Optional: defaults to false
            # TLS configuration for verifying the server
            tlsConfig:
              caCertFile: "/path/to/ca.crt"   # Optional: path to CA certificate

            # Plugin-specific behavior
            # when the extender call fails (ignored if ignorable=true)
            failPolicy: "Deny"                  # Optional: "Allow", "Deny", "Ignore" (default: "Deny")

Request:
Endpoint: POST /
Request Body (JSON):

{
  "pod": { /* Full v1.Pod object */ },
  "node": { /* Full v1.Node object */ }
}

Response Body (JSON):

{
  "allow": true,     // boolean: true to allow eviction, false to block
  "reason": "Pod is eligible for cost-saving migration."
}

Plugin Behavior

  • Success (allow: true): Eviction pod.
  • Blocked (allow: false): Pod is skipped; reason is logged.
  • Failure (timeout, error, non-200):
    • If ignorable: true: Proceed as if allow: true (or respect failPolicy if implemented).
    • If ignorable: false: Block eviction (allow: false), unless failPolicy overrides.

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

Describe the solution you'd like

Describe alternatives you've considered

What version of descheduler are you using?

descheduler version:

Additional context

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