LoadBalancer + HAProxy Ingress Setup

#minikube #tunneling

  1. Install HAProxy Ingress
kubectl create ns haproxy-controller

helm repo add haproxytech https://haproxytech.github.io/helm-charts
helm repo update

helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
  -n haproxy-controller \
  --set controller.service.type=LoadBalancer

This chart sets the default IngressClass name to haproxy, so you need to specify ingressClassName: haproxy in your Ingress resource for it to match. HAProxy Technologies

  1. Assign External IP to LoadBalancer

    In another terminal:

minikube tunnel
  1. Update IngressClass in Gitea Chart (values)

    From the values you provided, just change className: traefik to haproxy:

ingress:
  enabled: true
  className: haproxy
  annotations:
    # (필수 아님) HTTP만 쓸 거면 생략 가능
  hosts:
    - host: gitea.127.0.0.1.nip.io
      paths:
        - path: /
          pathType: Prefix

Apply:

helm upgrade --install gitea gitea-charts/gitea -n devops -f values-gitea.yaml
  1. Verify & Access
kubectl get ingress -A
kubectl get svc -n haproxy-controller haproxy-kubernetes-ingress
curl -H 'Host: gitea.127.0.0.1.nip.io' http://127.0.0.1/