KEDA HTTP Add-On

Documentation for the KEDA HTTP add-on

View project on GitHub

Developing

In this file you’ll find all the references needed for you to start contributing code to the HTTP Add-on project.

Getting started

To get started, first fork this repository to your account. You’ll need to have the following tools installed:

  • Go for development
  • golangci-lint for Go linting
  • ko for building container images and deploying
  • kustomize for generating Kubernetes manifests
  • Make for build automation
  • pre-commit for static checks (optional)

Setting up pre-commit hooks

Install pre-commit and golangci-lint, then register the git hooks:

pre-commit install --hook-type pre-commit --hook-type pre-push

This enables automatic static checks (formatting, linting, changelog validation, etc.) on git commit and git push as configured in .pre-commit-config.yaml. To run all checks manually: make pre-commit.

Prerequisites

Kubernetes cluster

You’ll need a running Kubernetes cluster. You can use a cloud provider (AKS, GKE, EKS) or a local cluster like KinD, k3s, or Minikube.

KEDA

Install KEDA and the HTTP Add-on following the install instructions.

Makefile Reference

  • make build: Build all binaries locally
  • make test: Run linter and unit tests
  • make e2e-test-local: Run e2e tests (assumes cluster is already set up)
  • make generate: Generate code (DeepCopy) and Kubernetes manifests
  • make deploy: Build and deploy all components to the cluster
  • make deploy-interceptor: Build and deploy the interceptor
  • make deploy-operator: Build and deploy the operator
  • make deploy-scaler: Build and deploy the scaler
  • make pre-commit: Run all static checks

Local Development with ko

This project uses ko for building container images and deploying to Kubernetes. ko builds Go binaries and packages them into container images without requiring Docker, with automatic dependency caching for fast incremental builds.

Set the KO_DOCKER_REPO environment variable for your target:

  • KinD: export KO_DOCKER_REPO=kind.local
  • Local registry: export KO_DOCKER_REPO=localhost:5001

After making code changes, deploy a single component:

make deploy-interceptor

Or deploy all components at once:

make deploy

ko will:

  1. Build the Go binary with dependency caching
  2. Create a container image with layer caching
  3. Push to the configured registry
  4. Apply manifests with resolved image references

Debugging

To inspect the interceptor’s pending request queue, port-forward the admin service and query the /queue endpoint:

kubectl port-forward -n keda svc/keda-add-ons-http-interceptor-admin 9090
curl localhost:9090/queue