Migration assistance from Ingress NGINX to HAProxy Kubernetes Ingress Controller

Your toolkit for converting configuration and annotations from the retiring Ingress NGINX to HAProxy Kubernetes Ingress Controller. Get started fast by following our installation instructions and tutorials.

Annotation Mapping

Ingress NGINX Example

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  tls:
  - hosts:
      - my-app.tld
  rules:
  - host: example.com
    http:
      paths:
      - path: /app
        pathType: Prefix
        backend:
          service:
            name: app-service
            port:
              number: 80

HAProxy Kubernetes Ingress Controller Example

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    kubernetes.io/ingress.class: haproxy
    haproxy.org/path-rewrite: /
    haproxy.org/ssl-redirect: "true"
spec:
  tls:
  - hosts:
      - my-app.tld
    secretName: my-app-tls
  rules:
  - host: example.com
    http:
      paths:
      - path: /app
        pathType: Prefix
        backend:
          service:
            name: app-service
            port:
              number: 80

Getting Started

Install HAProxy Kubernetes Ingress Controller using Helm

  1. Add the HAProxy Kubernetes Ingress Controller Helm repository:

    helm repo add haproxytech https://haproxytech.github.io/helm-charts
    helm repo update
  2. Install HAProxy Kubernetes Ingress Controller:

    helm install haproxy-ingress haproxytech/kubernetes-ingress \
      --namespace haproxy-controller \
      --create-namespace
  3. Verify the installation:

    kubectl get pods -n haproxy-controller
    kubectl get svc -n haproxy-controller
  4. Custom installation with values:

    helm install haproxy-ingress haproxytech/kubernetes-ingress \
      --namespace haproxy-controller \
      --create-namespace \
      --set controller.service.type=LoadBalancer \
      --set controller.replicaCount=2
  5. Check the ingress class:

    kubectl get ingressclass

Tutorials

Official tutorials for HAProxy Kubernetes Ingress Controller

For more information, see the complete documentation.

Route HTTP traffic

Define Ingress rules that state how traffic should be routed within your Kubernetes cluster.

Load balance traffic

The ingress controller load balances traffic across pods without further configuration, but you can customize its behavior.

Terminate SSL / TLS

HAProxy Kubernetes Ingress Controller can terminate SSL/TLS, handling encrypting traffic when it leaves and decrypting it when it enters.

Load balance TCP services

Use the HAProxy Kubernetes Ingress Controller to load balance TCP services.

Load balance FastCGI applications

Use the HAProxy Kubernetes Ingress Controller to load balance PHP applications over FastCGI.

Add an auxiliary configuration

In most cases, annotations on resources are sufficient, but you can use raw HAProxy configuration directives for unaddressed features.