This is what the spec for the scaled object looks like:
spec: scaleTargetRef: deploymentName: keda-kubernetes-events-scaler-node triggers: - type: kubernetes-events metadata: fieldSelector: "metadata.namespace=events-sample,type=Warning" # Optional # Scale Down Period will check if an event has occured in the # last n seconds and scale down if not scaleDownPeriodSeconds: "60" # Optional, Default: 60 # Number of Events are the number of events that would be set as # the target quantity of the HPA numberOfEvents: "3" # Optional, Defaults to 5.
It allows you to filter Kubernetes events based on a field selector. So you can filter by events with a reason such as ImagePullFailure or type such as Warning.
The Scale down period is what is used to check if there have been events in the last n seconds and based on that scale the deployment to zero. Additionally, the number of events parameter is what is used to scale up the pods and is used as the target avg value of the HPA.