Skip to main content
Configure horizontal pod autoscaling to automatically adjust the number of replicas based on resource utilization.

Field Reference

Basic Configuration

When autoscaling is enabled, the instances field is ignored. The autoscaler manages replica count automatically.
For high availability, set minInstances to at least 3. See High Availability Applications for more details.

How It Works

When either CPU or memory usage exceeds your configured threshold, Porter automatically adds replicas. When usage drops, replicas are removed (down to your minimum).

Example: Autoscaling in Action

Consider an API service with this configuration:
Here’s how the autoscaler responds to changing load: Key behaviors:
  • Either metric triggers scaling: If CPU or memory exceeds its threshold, replicas are added
  • Both must be low to scale down: Replicas are only removed when both CPU and memory are below their thresholds
  • Respects bounds: Replicas never drop below minInstances (2) or exceed maxInstances (10)
  • Gradual changes: The autoscaler adjusts incrementally, not all at once, to avoid oscillation

Custom Metrics Autoscaling (Prometheus)

Scale based on application-specific metrics like queue length, request latency, or custom business metrics.
Custom metrics autoscaling requires Prometheus to be accessible in your cluster. See Custom Metrics and Autoscaling for setup details.

Temporal Autoscaling

Scale Temporal workflow workers based on task queue depth. Porter monitors your Temporal task queues and automatically adjusts worker count.
Temporal autoscaling requires a Temporal integration to be configured. See Temporal Autoscaling for setup details.