Prerequisites
Before you begin, ensure you have:- The Sawmills Collector deployed and running in the
sawmillsnamespace - KEDA installed in your Kubernetes cluster (KEDA installation guide)
- (Optional) Prometheus deployed if you want to use Prometheus-based scaling
Enabling KEDA Autoscaling for Sawmills
KEDA can be enabled and configured via the Sawmills Collector Helm chart. The configuration is managed under themanagedCharts.sawmills-collector.keda section in your values.yaml file.
Step 1: Enable KEDA in Helm Values
Add or update the following section in yourvalues.yaml of the remote operator:
- minReplicas/maxReplicas: Minimum and maximum number of collector pods.
- pollingInterval: How often KEDA checks metrics for scaling decisions.
- cooldownPeriod: How long to wait after scaling before scaling down.
- scaling: Configure one or more scaling sources (Prometheus, external, CPU, memory).
Step 2: Apply the Configuration
After updating yourvalues.yaml, upgrade your Sawmills Collector release:
KEDA Scaling Options
You can configure KEDA to scale based on different metrics sources:1. Prometheus-based Scaling
Enablescaling.prometheus.enabled: true and provide the Prometheus server address and PromQL query. Example:
2. External Scaler (OTLP) Scaling
Enablescaling.external.enabled: true to use the KEDA OTLP external scaler. Example:
3. CPU/Memory-based Scaling
Enablescaling.cpu.enabled and/or scaling.memory.enabled to scale based on resource utilization:
Example: Full KEDA Configuration
Here is a complete example for enabling KEDA with multiple scaling sources:KEDA Scaler Component for OpenTelemetry
The Sawmills Helm chart includes an optional KEDA scaler component for advanced OTLP-based scaling. To enable it, set:Verifying KEDA Autoscaling
- Check KEDA ScaledObject
- Check Collector Pod Scaling
- Check KEDA Operator Logs
Troubleshooting KEDA Autoscaling
- ScaledObject Not Created: Ensure
keda.enabled: trueand Helm upgrade completed successfully. - Pods Not Scaling: Check metric queries, thresholds, and KEDA operator logs for errors.
- Prometheus/External Metrics Not Detected: Verify Prometheus/external scaler endpoints are reachable and queries return expected results.
- Resource-based Scaling Not Working: Ensure CPU/memory requests and limits are set on the collector pods.
Best Practices for KEDA with Sawmills
- Start with conservative scaling thresholds and adjust based on observed workloads.
- Use multiple scaling sources (e.g., CPU and Prometheus) for robust autoscaling.
- Monitor KEDA and collector logs for scaling anomalies.
- Test scaling behavior under simulated load before deploying to production.
- For advanced scenarios, leverage the external scaler for custom OTLP metrics.