serverless / serverless-kubeless

This plugin enables support for Kubeless within the Serverless Framework.
Apache License 2.0
303 stars 80 forks source link

Autoscaling function deployment in serverless-kubeless (HPA) #231

Open a7i opened 3 years ago

a7i commented 3 years ago

Ability to specify auto-scaling configuration. kubeless CLI allows setting it up using metrics as shown below:

$ kubeless autoscale create --help
automatically scale function based on monitored metrics

Usage:
  kubeless autoscale create <name> FLAG [flags]

Flags:
  -h, --help               help for create
      --max int32          maximum number of replicas (default 1)
      --metric string      metric to use for calculating the autoscale. Supported
      metrics: cpu, qps (default "cpu")
      --min int32          minimum number of replicas (default 1)
  -n, --namespace string   Specify namespace for the autoscale
      --value string       value of the average of the metric across all replicas.
      If metric is cpu, value is a number represented as percentage. If metric
      is qps, value must be in format of Quantity

Reference: kubeless.io autoscaling

It would be great to specify that configuration in serverless yml configuration.