Skip to content

HAPTIC

HAPTIC lets you shape Kubernetes traffic routing by editing the templates that generate your HAProxy configuration. Start with ready-to-use Ingress and Gateway API support, then add your own annotations, routing rules, or resource types as your needs change.

Choose your next step

Your task Start here
Install HAPTIC Getting started
Replace an existing ingress controller Migration guide
Upgrade an existing HAPTIC installation Upgrade procedure and release notes
Add routing behavior or custom annotations Templating guide
Try a template before installing Browser playground
Monitor or troubleshoot an installation Operations guides

Quick start

Use Kubernetes 1.33 or newer and Helm 3.8 or newer. HAPTIC is pre-1.0: pin a chart version and check the upgrade notes before updating. Choose the installed version in the documentation menu; dev also describes unreleased features.

helm install haptic oci://registry.gitlab.com/haproxy-haptic/haptic/charts/haptic --version 0.5.0 --namespace haptic --create-namespace

This installs the controller, two HAProxy replicas, and the default routing libraries. Getting started explains how to check the installation and includes an optional sample app.

Add behavior with a template

Add a custom annotation with a template snippet. This example lets each Ingress choose a request-ID header for its own backends. With Helm, put the snippet under controller.config.templateSnippets.

In the Resources panel, change the shop Ingress's example.com/request-id-header value to X-Trace-ID. Check the http-request set-header line in haproxy.cfg, then remove the annotation to remove the line.

controller:
  config:
    templateSnippets:
      backend-directives-300-request-id:
        template: |
          {%- if ingress != nil %}
            {%- var header = ingress.metadata.annotations["example.com/request-id-header"] %}
            {%- if header != "" %}
              {%- if !regex_search(header, "^[A-Za-z0-9-]+$") %}
                {{ fail("example.com/request-id-header must contain only letters, digits, or hyphens.") }}
              {%- end %}
              http-request set-header {{ header }} %[uuid()]
            {%- end %}
          {%- end %}

Set example.com/request-id-header: "X-Request-ID" on an Ingress to enable the header. This example accepts letters, digits, and hyphens in the header name. The backend hook scopes the rule to that Ingress; changing it requires a reload. See the Templating Guide for more examples.

Route your applications

Use Ingress for host and path routing, or Gateway API for listeners and routes managed separately. The routing guides cover TLS, authentication, rate limits, caching, and compatibility with annotations from other controllers.

Customize and operate HAPTIC

HAPTIC is an independent community project and isn't affiliated with HAProxy Technologies.

Found a problem on this page? Report it