Autoscaling concepts
Knative Serving supports the implementation of Knative Pod Autoscaler (KPA) and Kubernetes’ Horizontal Pod Autoscaler (HPA). The features and limitations of each of these Autoscalers are listed below.
IMPORTANT: If you want to use Kubernetes Horizontal Pod Autoscaler (HPA), you must install it after you install Knative Serving.
- Part of the Knative Serving core and enabled by default once Knative Serving is installed.
- Supports scale to zero functionality.
- Does not support CPU-based autoscaling.
Horizontal Pod Autoscaler (HPA)
- Not part of the Knative Serving core, and must be enabled after Knative Serving installation.
- Does not support scale to zero functionality.
The type of Autoscaler implementation (KPA or HPA) can be configured by using the annotation.
- Global settings key:
pod-autoscaler-class
- Per-revision annotation key:
autoscaling.knative.dev/class
- Possible values: or
"hpa.autoscaling.knative.dev"
- Default:
"kpa.autoscaling.knative.dev"
Configuring for autoscaling in Knative can be set using either global or per-revision settings.
- If per-revision settings are specified, these will override the global settings when both types of settings exist.
Global settings
Global settings for autoscaling are configured using the ConfigMap. If you installed Knative Serving using the Operator, you can set global configuration settings in the spec.config.autoscaler
ConfigMap, located in the KnativeServing
custom resource (CR).
Example of the default autoscaling ConfigMap
Per-revision settings for autoscaling are configured by adding annotations to a revision.
Example
Was this page helpful?
Glad to hear it! Please .
Sorry to hear that. Please tell us how we can improve.