Menu

1 / 2

Adding Ingress with HAProxy

DEV Community·Josef Polar·6 months ago
#0ElfXkym
Reading 0:00
15s threshold

After getting the Service running, the next thing I needed was a way to route external HTTP traffic to it. That's where Ingress comes in — and I went with the HAProxy ingress controller.

Installing the HAProxy ingress controller

helm repo add haproxytech https://haproxytech.github.io/helm-charts helm repo update helm install haproxy-ingress haproxytech/kubernetes-ingress \ --namespace ingress-controller \ --create-namespace

Enter fullscreen mode

Exit fullscreen mode

Then I checked it came up:

kubectl get pods -n ingress-controller

Enter fullscreen mode

Exit fullscreen mode

Writing the Ingress resource

apiVersion : networking.k8s.io/v1 kind : Ingress metadata : name : my-app-ingress annotations : kubernetes.io/ingress.class : haproxy spec : rules : - host : my-app.example.com http : paths : - path : / pathType : Prefix backend : service : name : my-app-service port : number : 80

Enter fullscreen mode

Exit fullscreen mode

The host field is the domain I want to route.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.