I am using Kubernetes in minikube on Ubuntu 18.04 with ingress add-on enabled. I want my NextJS service to communicate to my Express Service connected via ingress server by making request only via Ingress controller. So when I use cross namespace communication it doesn't work as illustrated in the tutorial presented. Since ingress-nginx in minikube runs on kube-system namespace.
$ kubectl get service -n kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-nginx-controller-admission ClusterIP 10.103.20.47 none 443/TCP 15d
kube-dns ClusterIP 10.96.0.10 none 53/UDP,53/TCP,9153/TCP 36d
The services that I am running
$ kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
exp-mongo-srv ClusterIP 10.103.255.125 <none> 27017/TCP 42s
exp-srv ClusterIP 10.103.118.45 <none> 3000/TCP 42s
next-srv ClusterIP 10.108.158.184 <none> 3000/TCP 39s
Expected request url was: http://ingress-nginx.ingress-nginx.svc.cluster.local(Communication through nginx)
But instead I have to go through http://exp-srv:3000
(Which is direct communication between services)