Ingress
The HAProxy Ingress Controller is exposed using ALB Ingress. To do this, an Ingress needs to be created:
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: haproxy-ingress namespace: ingress annotations: alb.ingress.kubernetes.io/healthcheck-port: '1042' alb.ingress.kubernetes.io/healthcheck-path: /healthz alb.ingress.kubernetes.io/group.name: haproxy alb.ingress.kubernetes.io/load-balancer-name: haproxy-ingress alb.ingress.kubernetes.io/scheme: internet-facing alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}, {"HTTPS":8000}, {"HTTPS":8001}, {"HTTPS":8002} ]' alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:XXXXXXXXXX: certificate/XXXXX-xxxx-XXXX-XXXX-XXXXxxxXXX alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true, stickiness.lb_cookie.duration_seconds=60 alb.ingress.kubernetes.io/target-type: ip spec: ingressClassName: alb rules: - http: paths: - path: / backend: service: name: haproxy-kubernetes-ingress port: number: 80 pathType: Prefix - path: /stats backend: service: name: haproxy-kubernetes-ingress port: number: 1024 pathType: Prefix
The example above has two rules:
path : /
- This is used by all the Ingresses controlled by HAProxy.path: /stats
- This is used to expose the statistics pages of the HAProxy (protected with basic authentication as seen in the previous section).