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 locallymake test: Run linter and unit testsmake e2e-test: Run all e2e tests against an existing clustermake generate: Generate code (DeepCopy) and Kubernetes manifestsmake deploy: Build and deploy all components to the clustermake deploy-interceptor: Build and deploy the interceptormake deploy-operator: Build and deploy the operatormake deploy-scaler: Build and deploy the scalermake 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:
- Local registry:
export KO_DOCKER_REPO=localhost:<port> - KinD:
export KO_DOCKER_REPO=kind.local(only works with Docker, not Podman)
After making code changes, deploy a single component:
make deploy-interceptor
Or deploy all components at once:
make deploy
ko will:
- Build the Go binary with dependency caching
- Create a container image with layer caching
- Push to the configured registry
- Apply manifests with resolved image references
Running E2E Tests
E2E tests live in test/e2e/ and are organized by profile. Each profile groups tests that require a specific HTTP Add-on configuration.
For example, the default profile covers standard routing and scaling behavior with the default configuration while the tls profile tests TLS termination and requires the interceptor to be deployed with TLS certificates enabled.
Cluster setup
# Create a KinD cluster
kind create cluster
# Install all e2e dependencies and deploy the HTTP Add-on
make e2e-setup
# Or install individual dependencies (see Makefile for all targets)
make e2e-deps-otel-collector
make e2e-deps-jaeger
Running tests
# Run all e2e tests (all profiles)
make e2e-test
# Run a specific profile
make e2e-test PROFILE=tls
# Run a specific test by name
make e2e-test PROFILE=default RUN=TestColdStart
# Run tests matching specific labels
make e2e-test E2E_ARGS="--labels=area=scaling"
# List tests without executing them
make e2e-test E2E_ARGS="--dry-run"
The PROFILE variable selects a test profile directory under test/e2e/ (e.g. PROFILE=tls runs ./test/e2e/tls/...).
The RUN variable filters tests by name using Go’s -run flag (supports regex, e.g. RUN=TestColdStart or RUN="TestHost|TestPath").
The E2E_ARGS variable passes flags to the e2e-framework via -args (e.g. --labels, --feature, --skip-labels, --dry-run).
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