DEV Community

Carlos Mendible
Carlos Mendible

Posted on • Originally published at carlos.mendible.com on

AKS: Configure TLS termination with the http application routing addon

When you install a AKS cluster you can configure it to deploy the http application routing addon or you you can update an existing cluster to deploy it.

Either way you end up with an NGINX Ingress Controller running, in the kube-system namespace of your cluster, with the following properties:

  • ingress-class: addon-http-application-routing
  • annotations-prefix: nginx.ingress.kubernetes.io

Does this means that you can use this controller for TLS termination? The answer is yes! And you can also use rate limits, and whitelisting as described in my post Secure your Kubernetes services with NGINX ingress controller, tls and more.

So to try it out, follow steps 2 and 5 of the previous post, but be sure to replace the contents of the ingress_rules.yaml file with the following yaml (Don’t forget to replace the DNS Zone Name):

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dni-function
  namespace: default
  annotations:
    kubernetes.io/ingress.class: addon-http-application-routing
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - dni-function.<YOUR CLUSTERS DNS ZONE NAME>
    secretName: tls-secret
  rules:
  - host: dni-function.<YOUR CLUSTERS DNS ZONE NAME>
    http:
      paths:
      - path: /
        backend:
          serviceName: dni-function
          servicePort: 80
Enter fullscreen mode Exit fullscreen mode

Note that the kubernetes.io/ingress.class value must be: addon-http-application-routing

Once you have tls working go ahead and try rate limits and whitelisting!

Hope it helps.

Please download all code and files here and be sure to check the online documentation to learn more about the annotations and other NGINX features.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay