Replace haproxy by ingress in AKS

4/6/2021

I'am new in Azure Kubernetes.

I'm implementing a AKS and I want to use ingress in order to be redirected to app-front POD when i tape https://front.domain.com and be redirect to grafana POD when i tape https://grafana.domain.com in the brosser.

I Ask if it's possible to do that without use haproxy for example.

I manage DNS sub-domain in OVH.

Thanks

-- Quentin Merlin
azure-aks
kubernetes
kubernetes-ingress

2 Answers

4/6/2021

You can install an Ingress controller like NGINX Ingress Controller. If you need certificate management (via Let's Encrypt) also install cert-manager.

Using Helm this can be done with:

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx

and

helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace
-- derkoe
Source: StackOverflow

4/6/2021

You can use Ingress with a chosen Ingress Controller(s). Ingress Controller is needed as:

In order for the Ingress resource to work, the cluster must have an ingress controller running.

Unlike other types of controllers which run as part of the kube-controller-manager binary, Ingress controllers are not started automatically with a cluster. Use this page to choose the ingress controller implementation that best fits your cluster.

Create an ingress controller in Azure Kubernetes Service (AKS) will show you a step by step guide describing an example of how it could be implemented.

As for the routing, the Create an ingress route shows how it works:

To route traffic to each application, create a Kubernetes ingress resource. The ingress resource configures the rules that route traffic to one of the two applications.

Based on your question, if your service is only reachable via https you need to add the following annotation to your ingress yaml:

nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
-- WytrzymaƂy Wiktor
Source: StackOverflow