KEDA Component

Kubernetes Event-driven Autoscaler. Scales workloads based on external metrics from queues, databases, Prometheus, Loki, and more.

Architecture

KEDA Operator - ScaledObject controller
Metrics Server - External metrics adapter
ScaledObject - Autoscaling configuration
Triggers - Event sources (60+ scalers)
TriggerAuth - Scaler credentials

Quick Reference

Attribute Example Default Effect
namespace REQ keda - KEDA operator namespace
log_level info info debug, info, error

Link to Sub-Components (ScaledObject Generation)

KEDA links to sub-components of other infrastructure to auto-generate ScaledObjects with appropriate triggers.

keda-queue LINK

KEDA → RabbitMQ queue sub-component. Generates: k8s/deploy/base/scaleup/rabbitmq.yaml

Link Attribute Example Description
keda_queue_mode QueueLength QueueLength | MessageRate
keda_queue_value 10 Threshold value to trigger scaling
Creates: Secret (AMQP connection), TriggerAuthentication, ScaledObject

keda-topic LINK

KEDA → Kafka topic sub-component. Generates: k8s/deploy/base/scaleup/kafka.yaml

Link Attribute Example Description
keda_lagthreshold 100 Consumer lag threshold
keda_pollinginterval 30 Polling interval (seconds)
keda_cooldownperiod 300 Cooldown period (seconds)
keda_minreplicacount 0 Minimum replicas (0 = scale-to-zero)
keda_maxreplicacount 10 Maximum replicas

keda-db LINK

KEDA → CNPG db sub-component. Generates: k8s/deploy/base/scaleup/cnpg.yaml

Link Attribute Example Description
keda_query SELECT COUNT(*) FROM jobs WHERE status='pending' SQL query returning numeric
keda_activation_query_value 1 Activation threshold
Creates: Secret (PostgreSQL creds), TriggerAuthentication, ScaledObject

keda-database LINK

KEDA → PostgreSQL database sub-component. Generates: k8s/deploy/base/scaleup/psql.yaml

Link Attribute Example Description
keda_query SELECT COUNT(*) FROM tasks SQL query returning numeric
keda_activation_query_value 5 Activation threshold

keda-mongo_db LINK

KEDA → MongoDB mongo_db sub-component. Generates: k8s/deploy/base/scaleup/mongodb.yaml

Link Attribute Example Description
keda_query {"status":"pending"} MongoDB query filter
keda_collection jobs Collection to query

keda-model LINK

KEDA → vLLM model sub-component. Generates Prometheus-based ScaledObject for LLM inference scaling.

Link Attribute Example Description
keda_query vllm:num_requests_running Prometheus query for vLLM metrics
keda_threshold 10 Request threshold for scaling

Query-Based Scalers (prometheus_query / loki_query)

Special sub-component types that can target any component for scaling based on custom queries.

Sub-Component Type Variable Use Case
prometheus_query __prometheus_query Scale any workload based on PromQL query result
loki_query __loki_query Scale any workload based on LogQL query result
prometheus_query attributes:
- query: PromQL query (e.g., sum(rate(http_requests_total[5m])))
- threshold: Scaling threshold value
- serverAddress: Prometheus server URL (auto-populated from link)

loki_query attributes:
- query: LogQL query (e.g., sum(rate({app="myapp"} |= "error" [5m])))
- threshold: Scaling threshold value
- serverAddress: Loki server URL (auto-populated from link)

Component Link Variables

Variable Link Type Effect
__prometheus prometheus-keda ServiceMonitor for KEDA metrics
__prometheus_scale keda-prometheus Prometheus server for query scaler
__loki_scale keda-loki Loki server for log-based scaler
__rabbitmq keda-rabbitmq RabbitMQ connection for scaler
__kafka keda-kafka Kafka connection for scaler
__postgresql keda-postgresql PostgreSQL connection for scaler
__mongodb keda-mongodb MongoDB connection for scaler

Generated Files

File Condition Contains
scaleup/rabbitmq.yaml keda-queue link Secret, TriggerAuth, ScaledObject
scaleup/kafka.yaml keda-topic link ScaledObject for Kafka
scaleup/cnpg.yaml keda-db link Secret, TriggerAuth, ScaledObject
scaleup/psql.yaml keda-database link Secret, TriggerAuth, ScaledObject
scaleup/mongodb.yaml keda-mongo_db link Secret, TriggerAuth, ScaledObject

Ports

Port Purpose Protocol
8080 Metrics server HTTP
9666 Prometheus metrics HTTP

Technical Info

Chart Version: 2.18.0
KEDA Version: 2.18.0
Extensions: local_extensions.b64encode
CRDs: ScaledObject, ScaledJob, TriggerAuthentication, ClusterTriggerAuthentication