Configuring instance count
By default, Knative will scale number of Pods for each Service based on incoming requests:
- minimum: 0 (scale-to-zero, wake up on request)
- maximum: unbounded
To adjust these numbers you can specify annotations at
Note: Make sure annotation values are “quoted”, so they are treated as strings.
apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: name: hello spec: template: metadata: annotations: autoscaling.knative.dev/minScale: "1" # and/or: autoscaling.knative.dev/maxScale: "20" spec: containers: - image: gcr.io/google-samples/hello-app:1.0 [...]
Note that setting
minScale > 0 will cause each
Revision to always run
specified number of Pods despite they're not getting any traffic. In that case,
do not forget to clean up old revisions.