I have a service which is accepting the request at /api/v1/orders
. I was able to validate the response using the Cluster IP. I logged into a pod and hit the curl http://order-service/api/v1/orders
and getting the response.
I then set up a Nginx Ingress Controller and the ingress with the below yaml definition. I used the cafe
example and the cafe
ingress is working fine.
When I try to access my order-service
I am getting 404. I am not sure how to debug this.
Note: My API is accessible on http://context/api/v1/orders
endpoint. How do I redirect the path the /orders/api/v1/orders
from the ingress?
curl -v -H "Content-type: application/j son" -H "Accept: application/json" https://classpath.com/orders/api/v1/orders --insec ure
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: orders-microservice-ingress
spec:
ingressClassName: nginx # use only with k8s version >= 1.18.0
tls:
- hosts:
- classpath.com
secretName: cafe-secret
rules:
- host: classpath.com
http:
paths:
- path: /orders
backend:
serviceName: order-service
servicePort: 80
I have set the aws loadbalancer IP to classpath.com
in the /etc/hosts
file.