KEDA: Kubernetes-based Event Driven Autoscaling

repository·main·Indexed Apr 15, 2026

https://github.com/kedacore/keda

KEDA is a CNCF graduated project providing fine-grained autoscaling for event-driven Kubernetes workloads, including scaling to/from zero. It operates as a Kubernetes Metrics Server using Custom Resource Definitions (CRDs) without external dependencies. Documentation covers ScaledObject validation, duplicate workload management, scaling modifiers, and local development workflows including VS Code debugging and custom image deployment.

Tokens
24.1K
Snippets
46
Records
105
Agent score
95%

What's inside KEDA

  1. Releases and Roadmap

    main

    Releases: You can find the latest official releases and download links at the KEDA Releases page.

    Roadmap: The project uses GitHub issues to maintain its backlog. A complete overview of all open items and planning can be found in the ROADMAP.md file.

    Sources: README.md

  2. Community and Support

    main

    Join the Conversation:

    • Slack: Join the #KEDA channel on the Kubernetes Slack to learn or chat about KEDA.
    • Meetings: Participate in community meetings to contribute or discuss the project's direction. Details are available on the KEDA website.

    Support Policy: For details on the KEDA support policy, visit keda.sh/support/.

    Adopters: If you are running KEDA in production, you can become a listed user by following the instructions at kedacore/keda-docs#become-a-listed-keda-user.

    Governance: Learn about the project's governance structure at kedacore/governance.

    Sources: README.md

  3. Get Server URL

    main

    Retrieve the URL of the gRPC server that this client is currently connected to.

    Usage:

    import (
        "github.com/kedacore/keda/v2/pkg/metricsservice"
    )
    
    serverURL := client.GetServerURL()
    fmt.Printf("Connected to: %s\n", serverURL)

    Sources: pkg/metricsservice/client.go

  4. Wait for gRPC Connection Readiness

    main

    Block until the gRPC connection to the KEDA Metrics Server is established and ready. This is useful during initialization to ensure the client can communicate before proceeding.

    Usage:

    import (
        "context"
        "github.com/go-logr/logr"
        "github.com/kedacore/keda/v2/pkg/metricsservice"
    )
    
    // logger: logr.Logger instance
    ready := client.WaitForConnectionReady(ctx, logger)
    if !ready {
        // Context timeout or connection failed
        return fmt.Errorf("connection not ready")
    }

    Sources: pkg/metricsservice/client.go

  5. Subscribe to Raw Metric Streams

    main

    Subscribe to a raw metric stream for a specific metric. This registers the subscriber with the KEDA Metrics Server so that metric updates are pushed to the client.

    Prerequisites:

    • The client must be initialized with rawStream=true in NewGrpcClient.
    • You must call GetRawMetricsStream to open the connection before subscribing.

    Usage:

    import (
        "context"
        "github.com/kedacore/keda/v2/pkg/metricsservice"
    )
    
    // subscriber: Unique identifier for this subscriber
    // scaledObjectName: Name of the ScaledObject
    // scaledObjectNamespace: Namespace of the ScaledObject
    // metricName: Name of the metric to subscribe to
    
    ack, err := client.Subscribe(
        ctx,
        "my-subscriber-id",
        "my-scaled-object",
        "default",
        "my-metric",
    )
    if err != nil {
        // handle error
    }
    
    if ack {
        // Subscription successful
    }

    Sources: pkg/metricsservice/client.go

  6. Steps

    main
    1. Clone the repository:
       git clone git@github.com:kedacore/keda.git
       cd keda
       code .
    1. In VS Code, run CTRL+SHIFT+P and select Dev Containers: Reopen in container.
    2. Once the container is ready, use the integrated terminal to build:
       make build

    Note: The first build may take time to install tooling. The image is cached for subsequent builds.

    git clone git@github.com:kedacore/keda.git
    cd keda
    code .
    # In VS Code: CTRL+SHIFT+P -> Dev Containers: Reopen in container
    make build

    Sources: BUILD.md

  7. Build KEDA with VS Code Dev Containers

    main
    Use VS Code Dev Containers to build KEDA with a pre-configured environment, eliminating the need to manually install dependencies.