Hanzo
Hanzo Skills Reference

Hanzo Ingress - Cloud-Native L7 Reverse Proxy and Load Balancer

Hanzo Ingress is a Kubernetes-native L7 reverse proxy and load balancer that serves as the front door for all Hanzo production traffic. Built in Go (Traefik fork), it watches Kubernetes Ingress res...

Overview

Hanzo Ingress is a Kubernetes-native L7 reverse proxy and load balancer that serves as the front door for all Hanzo production traffic. Built in Go (Traefik fork), it watches Kubernetes Ingress resources, auto-provisions TLS certificates via Let's Encrypt, and routes traffic to internal services. Single static binary, zero runtime dependencies. Live on hanzo-k8s cluster as the default IngressClass (hanzo).

Why Hanzo Ingress?

  • Kubernetes-native: Watches Ingress resources, auto-configures routes
  • Automatic TLS: Let's Encrypt provisioning and renewal with wildcard support
  • Dynamic configuration: Zero-restart config updates as Ingress resources change
  • Full protocol support: HTTP/2, gRPC, WebSocket
  • Built-in middleware: Rate limiting, circuit breakers, retries, auth, compression
  • Web dashboard: React UI for route visualization and health monitoring
  • Multi-provider: Kubernetes Ingress (primary), Docker, File, Consul, Etcd, ECS

Tech Stack

  • Language: Go 1.26
  • Module: github.com/hanzoai/ingress/v3
  • Binary: hanzo-ingress
  • WebUI: React dashboard (Node.js build stage)
  • Image: ghcr.io/hanzoai/ingress:latest
  • Build: Multi-stage Dockerfile (Node webui + Go binary)

OSS Base

Repo: hanzoai/ingress (Traefik fork). Entry point: cmd/traefik/.

When to use

  • Routing external traffic to K8s services
  • TLS termination for *.hanzo.ai and other domains
  • Applying middleware (rate limiting, auth, compression) to routes
  • Load balancing across service replicas
  • Creating Ingress resources for new services on hanzo-k8s

Hard requirements

  1. Kubernetes cluster with RBAC permissions for Ingress resources
  2. Ports 80/443 available (hostNetwork mode)
  3. DNS resolving to cluster LB (Cloudflare proxied)

Quick reference

ItemValue
Imageghcr.io/hanzoai/ingress:latest
Binaryhanzo-ingress
IngressClasshanzo (default)
Controllerhanzo.ai/ingress-controller
Health checkGET /ping on port 80
Replicas2 (production)
Namespacehanzo
NetworkhostNetwork (direct port binding)
Ports80 (HTTP), 443 (HTTPS)
Resources100m-1000m CPU, 128Mi-512Mi memory
Repogithub.com/hanzoai/ingress
K8s contextdo-sfo3-hanzo-k8s

One-file quickstart

Docker

docker run -d \
  --name hanzo-ingress \
  -p 80:80 \
  -p 443:443 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  ghcr.io/hanzoai/ingress:latest \
  --entrypoints.web.address=:80 \
  --entrypoints.websecure.address=:443 \
  --providers.docker=true \
  --ping=true

Kubernetes

kubectl apply -f https://raw.githubusercontent.com/hanzoai/ingress/master/k8s/hanzo/rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/hanzoai/ingress/master/k8s/hanzo/ingressclass.yaml
kubectl apply -f https://raw.githubusercontent.com/hanzoai/ingress/master/k8s/hanzo/deployment.yaml
kubectl apply -f https://raw.githubusercontent.com/hanzoai/ingress/master/k8s/hanzo/service.yaml

Build from Source

make build
./hanzo-ingress --configFile=config.toml

Create an Ingress Resource

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-service
  namespace: hanzo
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
spec:
  ingressClassName: hanzo
  tls:
  - hosts:
    - my-service.hanzo.ai
    secretName: my-service-tls
  rules:
  - host: my-service.hanzo.ai
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 8080

Core Concepts

Architecture

              Internet
                 |
        +--------+--------+
        | Cloudflare CDN  |
        | DNS, WAF, DDoS  |
        +--------+--------+
                 |
        +--------+--------+
        | Hanzo Ingress   |   L7 reverse proxy
        | (ports 80/443)  |   TLS termination
        | IngressClass:   |   Route matching
        |   "hanzo"       |   Load balancing
        +--+-+-+-+-+--+---+
           | | | | |  |
     +-----+ | | | |  +--------+
     |   +---+ | | +-----+     |
     |   |  +--+ +--+    |     |
     v   v  v       v    v     v
  +-----+-----+  +----+ +---+ +-------+  +-----+
  | Hanzo     |  | IAM| |KMS| | Cloud |  | PaaS|
  | Gateway   |  +----+ +---+ +-------+  +-----+
  | (API)     |
  +--+--+--+--+
     |  |  |
     v  v  v
  +------+------+------+
  |Engine|Search|  LLM |    Backend services
  +------+------+------+

Request Flow

  1. DNS resolves *.hanzo.ai to Cloudflare
  2. Cloudflare proxies to hanzo-k8s cluster LB (24.199.76.156)
  3. Hanzo Ingress terminates TLS, matches host/path rules
  4. Request forwarded to the matching backend service
  5. For API traffic (api.hanzo.ai), routes to Hanzo Gateway for endpoint-level routing

Routed Domains (Production)

DomainBackend Service
hanzo.aihanzo-app
api.hanzo.ai, llm.hanzo.aiHanzo Gateway
hanzo.id, lux.id, zoo.idIAM (Casdoor)
kms.hanzo.aiKMS (Infisical)
platform.hanzo.aiPlatform (Dokploy)
console.hanzo.aiConsole
cloud.hanzo.aiCloud

Middleware

Middlewares are applied via Kubernetes Ingress annotations:

metadata:
  annotations:
    hanzo.ai/ingress-ratelimit-average: "100"
    hanzo.ai/ingress-ratelimit-burst: "200"

Key built-in middlewares: auth, ratelimiter, circuitbreaker, retry, compress, headers, ipallowlist, buffering, inflightreq, redirect, stripprefix, grpcweb, observability (OpenTelemetry), metrics (Prometheus/Datadog/StatsD/OTLP), accesslog.

K8s Manifests

k8s/hanzo/
  rbac.yaml           # ServiceAccount + ClusterRole
  ingressclass.yaml   # IngressClass "hanzo" (default)
  deployment.yaml     # 2-replica Deployment, hostNetwork
  service.yaml        # LoadBalancer Service
  middlewares.yaml    # Default middleware configurations

Configuration (Production CLI)

./hanzo-ingress \
  --providers.kubernetesingress=true \
  --providers.kubernetesingress.ingressendpoint.publishedservice=hanzo/hanzo-ingress \
  --providers.kubernetesingress.allowemptyservices=true \
  --entrypoints.web.address=:80 \
  --entrypoints.websecure.address=:443 \
  --entrypoints.websecure.http.tls=true \
  --ping=true \
  --ping.entryPoint=web \
  --api.dashboard=false \
  --log.level=INFO \
  --accesslog=true

Repository Structure

cmd/traefik/          # Binary entry point
internal/             # Core routing, middleware, provider logic
pkg/                  # Public packages, config types, version
webui/                # Built-in dashboard (React)
k8s/
  hanzo/              # Production K8s manifests (hanzo-k8s cluster)
  lux/                # Lux cluster manifests (lux-k8s cluster)
integration/          # Integration test suite
contrib/              # Community contributed configs
docs/                 # Extended documentation
Dockerfile            # Multi-stage build (Node webui + Go binary)
Makefile              # Build, test, Docker targets

Build and Test

# Build binary
make build

# Run unit tests
make test-unit

# Run integration tests
make test-integration

# Build Docker image
make build-image

# Lint
make lint

Deploy / Update

kubectl --context do-sfo3-hanzo-k8s apply -f k8s/hanzo/

# Verify pods
kubectl --context do-sfo3-hanzo-k8s -n hanzo get pods -l app=hanzo-ingress

# View logs
kubectl --context do-sfo3-hanzo-k8s -n hanzo logs -l app=hanzo-ingress --tail=100 -f

Troubleshooting

IssueCauseSolution
Port conflict on 80/443Other ingress controller runningRemove conflicting controller
TLS cert not provisionedcert-manager not configuredInstall cert-manager with letsencrypt issuer
404 on known domainIngress resource missing or wrong classCheck ingressClassName: hanzo
Dashboard not loadingapi.dashboard=false in productionEnable in non-prod or use port-forward
ProjectRole
Hanzo GatewayAPI gateway, rate limiting, endpoint routing
Hanzo EngineGPU inference engine, model serving
Hanzo EdgeOn-device inference runtime
Internet -> Ingress (TLS/L7) -> Gateway (API routing) -> Engine (inference) / Services
  • hanzo/hanzo-platform.md - PaaS for deploying applications
  • hanzo/hanzo-cloud.md - Cloud dashboard
  • hanzo/hanzo-universe.md - Production K8s infrastructure

How is this guide?

Last updated on

On this page