Skip to content

Predictive scaler trigger configuration

Configure prediction trigger metadata below. MetricPredictor API reference describes source, model and training fields; Predictive scaling explains fit and quality limits.

Use the Kedify build of KEDA for this trigger. Keep a live-demand trigger while evaluating forecast quality.

Enable predictive scaling and forecast a sample workload before applying this trigger to production. Inspect the selected model, source units, horizon and predicted versus actual values. For failures, use predictive diagnostics.

The MetricPredictor custom resource makes sure the model can get its metric data and can be periodically trained. However, if we want to actually use the model for prediction, one has to reference it from a Kedify predictive scaler as one of the triggers.

triggers:
- name: valueFromTheFuture
type: kedify-predictive
metadata:
modelName: app*e-shop
horizon: 15m
modelMapeThreshold: "80"
estimateType: upper-estimate
targetValue: "10"
  • modelName: This name must match the model name created by mp resource (implicitly ${namespace}*${name-of-mp})
  • horizon (optional): Prediction horizon - what will be the estimated value in time "now+horizon"? Example: 150s Default: if not specified, default from mp definition is used
  • modelMapeThreshold (optional): Maximum accepted Mean Absolute Percentage Error (MAPE) on held-out data. If the model exceeds this threshold, the scaler returns highMapeDefaultReturnValue. Lower values make acceptance stricter; they do not improve model precision. Default: 40.
  • highMapeDefaultReturnValue (optional): This is the default value returned when model is not performing well or has not been trained yet. Default 0
  • estimateType (optional): ML Model returns the estimated value but also upper and lower bounds. Allowed values: upper-estimate, lower-estimate, the-estimate Default: the-estimate
  • httpMethod (optional): What HTTP method should be used when asking a model for prediction. Allowed values: GET, POST. Default GET
  • url (optional): Endpoint used to request a prediction. Default: http://kedify-predictor.keda.svc:8000/models/{modelName}/predict?horizon={horizon}.
  • valueLocation (optional): JSON path that should be used for obtaining the predicted value from the HTTP request (without the leading dot). Default: based on the estimateType value - forecast.0.yhat or forecast.0.yhat_{lower,upper}
  • unsafeSsl & authOptions: Same set of configuration options as described for metrics-api scaler.
  • targetValue: Common configuration option for all KEDA scalers
  • activationTargetValue (optional): If predicted value is below this threshold the scaler will be considered as not active. Used for 0-1 scaling. Default 0