Comparing App Gateway v.s. Ngnix Ingress Controller for Latency in AKS

Introduction

Simple Architecture

Limitations

Steps

#example.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: aks-helloworld-one
spec:
replicas: 1
selector:
matchLabels:
app: aks-helloworld-one
template:
metadata:
labels:
app: aks-helloworld-one
spec:
containers:
- name: aks-helloworld-one
#image: mcr.microsoft.com/azuredocs/aks-helloworld:v1
image: k8s.gcr.io/hpa-example
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: aks-helloworld-one
spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
selector:
app: aks-helloworld-one
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: aks-helloworld-one
annotations:
kubernetes.io/ingress.class: azure/application-gateway
spec:
rules:
- host: aido.hynes.pri
http:
paths:
- backend:
serviceName: aks-helloworld-one
servicePort: 80
path: /
#example.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: aks-helloworld-two
spec:
replicas: 1
selector:
matchLabels:
app: aks-helloworld-two
template:
metadata:
labels:
app: aks-helloworld-two
spec:
containers:
- name: aks-helloworld-two
#image: mcr.microsoft.com/azuredocs/aks-helloworld:v1
image: k8s.gcr.io/hpa-example
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: aks-helloworld-two
spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
selector:
app: aks-helloworld-two
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: aks-helloworld-two
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: bido.hynes.pri
http:
paths:
- backend:
serviceName: aks-helloworld-two
servicePort: 80
path: /(.*)

Conclusion

http://aido.hynes.pri/ App Gateway Example output
http://bido.hynes.pri/ Nginx Ingress Controller Example output

--

--

Cloud Platform Architect. Opinions and articles on medium are my own.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adrian Hynes

Cloud Platform Architect. Opinions and articles on medium are my own.