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-local: Run e2e tests (assumes cluster is already set up)make 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:
- 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:
- 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
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