Skip to content

Linux Foundation Black Friday Sale: Up to 65% off Save now

Back to the blog
CNCF projects6 min read

What is KEDA? Event-driven autoscaling for Kubernetes

Sajeeva Nambadawa Vithanage4 Dec 2026 · Senior Software Site Reliability Engineer

What is KEDA? It's Kubernetes Event-driven Autoscaling: a small component that scales your workloads on the things that actually create work, such as queue length, stream lag or a Prometheus query, instead of only CPU and memory. It can also scale a deployment all the way to zero when there's nothing to do.

KEDA is a CNCF graduated project. If you run queue consumers, batch jobs or anything bursty on Kubernetes, it's one of the first add-ons worth learning. Our KEDA project page collects its links and our posts about it.

Key points

  • KEDA scales Deployments, StatefulSets, custom resources and Jobs based on events from external systems.
  • It works with the Horizontal Pod Autoscaler (HPA), not instead of it: KEDA feeds the HPA external metrics and handles scaling between zero and one.
  • You describe scaling with a ScaledObject (or a ScaledJob for Jobs) and one or more triggers, called scalers.
  • It joined the CNCF on 12 March 2020, moved to incubating on 18 August 2021 and graduated on 22 August 2023.
  • It installs with one Helm chart into its own namespace.

What is KEDA: the problem it solves

The built-in HPA scales on resource metrics. That's fine for a web service where CPU tracks traffic. It's a poor fit for a worker that pulls messages from a queue: the queue can hold 50,000 messages while each pod sits at modest CPU, and the HPA sees no reason to add pods.

KEDA fixes that by letting you scale on the source of the work. Its documentation lists many built-in scalers, including Kafka, RabbitMQ, AWS SQS and Prometheus, and you can write custom ones.

The second problem is idle cost. The HPA won't take a deployment below one replica. KEDA can, so a consumer that only has work a few times a day doesn't need to hold a pod the rest of the time.

Maturity: a CNCF graduated project

According to its CNCF project page, KEDA was accepted into the CNCF on 12 March 2020, moved to incubating on 18 August 2021 and graduated on 22 August 2023. Graduation means it has passed the CNCF's bar for adoption, governance and security, which is why you'll find it in many managed Kubernetes offerings and platform stacks. The documentation we read for this post is for KEDA v2.21.

How KEDA works

KEDA runs three components in your cluster:

  1. keda-operator watches KEDA's resources, creates and manages an HPA for each scaled workload, and handles scaling between zero and one replica.
  2. keda-metrics-apiserver exposes the event data (queue depth, lag, query results) to the HPA as external metrics through the Kubernetes API server.
  3. keda-admission-webhooks validate KEDA resources when you apply them, for example stopping two ScaledObjects from targeting the same deployment.

The split matters. KEDA's operator takes a workload from zero to one and back; the HPA it manages does one to N using KEDA's metrics. One consequence from the docs: the CPU and memory triggers can't scale to zero, because those metrics come from metrics-server and there are none when no pods are running.

The main custom resources are:

  • ScaledObject: links a Deployment, StatefulSet or custom resource to one or more triggers.
  • ScaledJob: creates Kubernetes Jobs from events, for work that should run to completion.
  • TriggerAuthentication: keeps the credentials a scaler needs (a queue password, a cloud identity) out of the ScaledObject.

A KEDA example: scale on a Prometheus query

This is the Prometheus scaler example from the KEDA docs, with the target deployment named my-deployment:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: prometheus-scaledobject
  namespace: default
spec:
  scaleTargetRef:
    name: my-deployment
  triggers:
  - type: prometheus
    metadata:
      serverAddress: http://<prometheus-host>:9090
      threshold: '100'
      query: sum(rate(http_requests_total{deployment="my-deployment"}[2m]))

KEDA runs the PromQL query and uses threshold as the target value per replica. The query must return a single value. An optional activationThreshold (default 0) decides when the scaler wakes the workload up from zero.

You didn't set the replica limits here, so KEDA's defaults apply. From the ScaledObject reference:

Field Default
pollingInterval 30 seconds
cooldownPeriod 300 seconds
minReplicaCount 0
maxReplicaCount 100

A minReplicaCount of 0 is what allows scale to zero. Set it to 1 if your workload must always be warm. Pro tip: set maxReplicaCount deliberately. The default of 100 is generous if a misbehaving query suddenly reports a huge value.

If you want to try this, our post on Prometheus covers the metrics side.

KEDA vs the HPA and other autoscalers

The common question is "KEDA or HPA?". The honest answer is both: KEDA creates and manages an HPA for you and adds event sources and scale to zero.

It also sits next to other autoscaling tools rather than replacing them:

  • HPA: scales pods horizontally on resource or custom metrics. KEDA builds on it.
  • Vertical Pod Autoscaler: changes requests and limits on pods, a different axis.
  • Cluster Autoscaler or Karpenter: add and remove nodes. KEDA adds pods; these make room for them.
  • Knative Serving: scales HTTP services, including to zero, based on requests. KEDA is the more general choice for queues, streams and scheduled work.

How to get started with KEDA

Install it with Helm, as the KEDA docs show:

helm repo add kedacore https://kedacore.github.io/charts
helm repo update
helm install keda kedacore/keda --namespace keda --create-namespace

Then:

  1. Check the three components are running with kubectl get pods -n keda.
  2. Pick one real workload, ideally a queue consumer, and write a ScaledObject with a single trigger.
  3. Watch the HPA KEDA creates (kubectl get hpa, named keda-hpa-<name> by default) while you push messages through.
  4. Add a TriggerAuthentication before you put credentials anywhere near the manifest.

For guided study, the Linux Foundation has a course, Mastering Kubernetes Event-Driven Autoscaling with KEDA (LFS257), and a shorter one, Scaling Cloud Native Applications with KEDA (LFEL1014). There's no KEDA certification exam, but autoscaling and workload scaling are part of what you need to know for CKA. The KEDA project page on CertDirectory has the official links in one place.

FAQ

What is KEDA in Kubernetes? KEDA (Kubernetes Event-driven Autoscaling) is a CNCF graduated project that scales Kubernetes workloads based on events from external systems, such as queues, streams or Prometheus queries, and can scale them to zero.

Does KEDA replace the HPA? No. KEDA creates and manages an HPA and feeds it external metrics. KEDA handles zero to one replica; the HPA handles one to N.

Can KEDA scale to zero? Yes, with minReplicaCount: 0 (the default) and an event-based trigger. The CPU and memory triggers can't scale to zero.

What is the difference between a ScaledObject and a ScaledJob? A ScaledObject scales a long-running workload such as a Deployment. A ScaledJob creates Kubernetes Jobs from events, for work that runs to completion.

Is KEDA a CNCF project? Yes. It joined the CNCF in March 2020 and graduated in August 2023.

Pick one queue consumer this week and give it a ScaledObject; it's the fastest way to see what KEDA does.

Sources