Logo Kubeship

Install Ingress NGINX on Azure Kubernetes Service (AKS)


Install Ingress NGINX - do not confuse with NGINX Ingress - on Kubernetes from manifest files.

Ingress NGINX is composed of several components. The simple way of installing is from the manifest file from the official repo :

kubectl apply -f \
    https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.13.3/deploy/static/provider/cloud/deploy.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: example
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  namespace: example
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx
        name: nginx
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
  namespace: example
spec:
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nginx
  namespace: example
spec:
  ingressClassName: nginx
  rules:
  - host: example.mydomain.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: nginx
            port:
              number: 80
kubectl port-forward service/ingress-nginx-controller 8000:80

References :

Keywords : Microsoft Azure, Ingress NGINX