I'm using kubernetes nginx ingress controller (not the nginx supported one, but the k8s supported one), with AKS (k8s version 1.17 at the moment), for which the corresponding apiversion for Ingress is networking.k8s.io/v1beta1, therefore using this documentation.
For the most basic Ingress, all fine, i.e:
# singlebackend-ingress-rule.yaml
apiVersion: networking.k8s.io/v1beta1 # AKS is with 1.17, and supports only apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-rules
spec:
rules:
- host: ingress-domain.westeurope.cloudapp.azure.com
http:
paths:
- backend:
serviceName: backend-webapi
servicePort: 80
Deployed as:
kubectl apply -f singlebackend-ingress-rule.yaml
curl http://ingress-domain.westeurope.cloudapp.azure.com.westeurope.cloudapp.azure.com/health
200
{
"me" : {
"status" : "ok",
"version" : "v15",
"appName" : "Backend.WebApi",
"aspNetCore_Environment" : "aks"
}
}
However, if I only add backend: /api, and do the exact same:
# multiplebackend-ingress-rule.yaml
apiVersion: networking.k8s.io/v1beta1 # AKS is with 1.17, and supports only apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-rules
spec:
rules:
- host: ingress-domain.westeurope.cloudapp.azure.com
http:
paths:
- backend:
serviceName: backend-webapi
servicePort: 80
path: /api
Deployed as:
kubectl apply -f multiplebackend-ingress-rule.yaml
curl http://ingress-domain.westeurope.cloudapp.azure.com.westeurope.cloudapp.azure.com/api/health
HTTP/2 404
server: nginx/1.19.1
date: Tue, 01 Sep 2020 09:24:36 GMT
content-length: 0
strict-transport-security: max-age=15724800; includeSubDomains
I get 404. What am I missing?