-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
The Core Issue
The Karmada metrics adapter had an incomplete implementation of external metrics functionality. The GetExternalMetric method was returning an error: "karmada-metrics-adapter still not implement it", which meant:
HPA with External Metrics Failed: HorizontalPodAutoscaler configurations using external metrics would fail
Missing Multi-cluster Metrics Support: No way to aggregate external metrics from member clusters
Incomplete Metrics Infrastructure: The metrics adapter was only partially functional.
Why This Problem Exists
External metrics are crucial for autoscaling based on external systems (databases, message queues, APIs)
Karmada's multi-cluster architecture requires metrics aggregation from member clusters
The original implementation was a placeholder that prevented actual functionality
Location and Context
Files Modified
Primary: pkg/metricsadapter/provider/externalmetrics.go - Core implementation
Supporting: pkg/metricsadapter/adapter.go - Integration with metrics adapter
Infrastructure: pkg/metricsadapter/controller.go - Added SecretLister support
Testing: pkg/metricsadapter/provider/externalmetrics_test.go - Comprehensive tests
Why its important:
Scale based on business metrics (not just CPU/memory)
Aggregate metrics across clusters for intelligent decisions
Support enterprise workloads with external dependencies
Optimize costs through intelligent scaling