I'm trying to set up a very simple Kubernetes cluster with frontend, backend and db services. Here is part of the Frontend service definition file:
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
tier: frontend
spec:
selector:
tier: frontend
ports:
- port: 80
nodePort: 30080
type: LoadBalancer
When I access the cluster's IP at port 30080 everything is working properly.
Now I'm trying to set up an Ingress that will work at port 80 (in preparation for deploying the cluster to Azure). I want to direct all HTTP traffic to the frontend, as this is the only HTTP service in my cluster. So the ingress definition file is as follows:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: zippori
annotations:
kubernetes.io/ingress.class: addon-http-application-routing
spec:
backend:
serviceName: frontend
servicePort: 80
However, when I access http://minikube-ip I get the following very simple error:
default backend - 404
It is as if Ingress doesn't forward anything to my frontend, and just tries its own default backend.
How can I fix this?