Crane-scheduler: Kubernetes Scheduling Optimization Based on Real Workload
Crane‑scheduler improves Kubernetes efficiency by collecting real‑time node metrics via Prometheus, annotating nodes, and applying configurable predicates and weighted priorities—plus a hot‑value mechanism—to balance load, cut waste, and prevent hotspots, delivering more stable, better‑utilized clusters.
Crane-scheduler addresses the gap between Kubernetes' resource requests and actual usage, which causes uneven cluster load. The article explains how this leads to resource waste and instability, then introduces Crane-scheduler as a solution that uses real-time node metrics for scheduling.
Architecture: Crane-scheduler relies on Node-exporter and Prometheus to collect and aggregate node metrics. It consists of Scheduler-Controller (periodically pulls metrics and annotates nodes) and Scheduler (uses annotations for filtering and scoring).
Scheduling Strategies: Users can configure predicates (threshold-based filtering) and priorities (weighted scoring based on metrics). The system also includes a hot-value mechanism to prevent scheduling hotspots.
Scheduler-Controller periodically pulls metrics from Prometheus and annotates nodes with CPU/memory usage averages and maximums.
Predicates filter nodes where metrics exceed thresholds (e.g., CPU usage >65%).
Priorities assign weights to metrics (e.g., CPU usage max avg 1h: weight 0.5) and calculate scores.
Hot-value tracks recent scheduling frequency to adjust scores.
Benefits: Balances load, reduces waste, and maintains stability. Case studies show improved resource utilization in public and internal clusters.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.