Kevin Patel:
Hi @Alistair Mackay @unnivkn @Mumshad Mannambeth I’m working on Lightning Lab-2 Q.4
Create a single ingress resource called ingress-vh-routing. The resource should route HTTP traffic to multiple hostnames as specified below:
The service video-service should be accessible on http://watch.ecom-store.com:30093/video
The service apparels-service should be accessible on http://apparels.ecom-store.com:30093/wear
Here 30093 is the port used by the Ingress Controller
Ingress resource configured correctly?
Answer:
k create ingress ingress-vh-routing --rule=“http://watch.ecom-store.com/video=video-service:8080|watch.ecom-store.com/video=video-service:8080” --rule=“http://apparels.ecom-store.com/wear=apparels-service:8080|apparels.ecom-store.com/wear=apparels-service:8080” --annotation=“http://nginx.ingress.kubernetes.io/rewrite-target=/|nginx.ingress.kubernetes.io/rewrite-target=/” --annotation=“http://nginx.ingress.kubernetes.io/ssl-redirect=false|nginx.ingress.kubernetes.io/ssl-redirect=false”
Now after creating ingress, I’m trying to confirm it’s working as expected using
controlplane ~ ➜ curl -H “Host:http://watch.ecom-store.com|watch.ecom-store.com” 10.106.227.249 (This IP is retrieved using k describe ingress ingress-vh-routing and It’s value of Address field which is same as ingress-controller svc IP)
I’ve added redirect-target and ssl-redirect annotations but still getting 404, do you know why? and in general, what’s the best way to troubleshoot ingress related issues?
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>