LowNodeUtilization fails with "prometheus client not initialized" in v0.35.0
## What happened?
After upgrading from v0.34.0 to v0.35.0, the descheduler fails to start with:
```
E0224 00:02:42.772045 1 profile.go:240] "unable to initialize a plugin" err="prometheus client not initialized" pluginName="LowNodeUtilization"
E0224 00:02:42.772223 1 server.go:74] "failed to run descheduler server" err="failed to create new descheduler: unable to create \"default\" profile: unable to build LowNodeUtilization plugin: unable to initialize \"LowNodeUtilization\" plugin: prometheus client not initialized"
```
This is 100% reproducible — every run fails immediately.
## What did you expect to happen?
The descheduler should start successfully and run the LowNodeUtilization plugin with Prometheus-based metrics, as it did in v0.34.0.
## Configuration
```yaml
apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
metricsProviders:
- source: KubernetesMetrics
- prometheus:
url: http://mimir-query-frontend.monitoring.svc.cluster.local:8080/prometheus
source: Prometheus
profiles:
- name: default
pluginConfig:
- args:
evictableNamespaces:
exclude:
- kube-system
metricsUtilization:
prometheus:
query: |
1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)
source: Prometheus
targetThresholds:
MetricResource: 75
thresholds:
MetricResource: 65
name: LowNodeUtilization
plugins:
balance:
enabled:
- LowNodeUtilization
```
The Prometheus endpoint is healthy and reachable from the cluster. No NetworkPolicies blocking cross-namespace traffic.
## Root cause analysis
This appears to be a regression introduced by #1815 ("feat(pkg/descheduler): create profiles outside the descheduling cycle").
In v0.34.0, profiles were created inside the descheduling loop (after `reconcileInClusterSAToken()` had initialized the Prometheus client). In v0.35.0, profiles are created once during `newDescheduler()` initialization — before the descheduling loop starts and before `reconcileInClusterSAToken()` runs. So `NewLowNodeUtilization()` calls `handle.PrometheusClient()` at build time, gets nil, and returns an error.
## Environment
- Descheduler version: v0.35.0 (chart 0.35.0)
- Kubernetes version: v1.33
- Deployment method: CronJob via Helm chart
- Worked on: v0.34.0
- Broken on: v0.35.0
1 条评论