I'm using Minikube single-node Kubernetes cluster inside Oracle VM Virtualbox. One of the pods in the node is a Next.js based client and the rest of the pods are different microservices. Let's say my client (Pod1) needs to send a HTTP request to the auth microservice (Pod2), before rendering - see the diagram: Minikube Cluster
Below is my ingress-service.yaml file:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: 'true'
spec:
rules:
- host: dummyweb.info
http:
paths:
- path: /api/users/?(.*)
backend:
serviceName: auth-srv
servicePort: 3000
- path: /?(.*)
backend:
serviceName: client-srv
servicePort: 3000
You can see that each service has a specific path. Thus, I would like to send the HTTP request from client (Pod1) to Ingress Service and then Ingress to reroute the request to the appropriate service, depending on the path. In other words, client living in Pod1 will send HTTP GET request to auth service living in Pod2 through Ingress Service using the following URL:
http://<ingress-service-url>/api/users/....
I need to figure out what is the URL of the Ingress service.
I enabled NGINX Ingress controller:
minikube addons enable ingress
I verified that the NGINX Ingress controller is running:
kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-f9fd979d6-hfnfj 1/1 Running 5 45h
etcd-minikube 1/1 Running 5 45h
ingress-nginx-admission-create-dkthv 0/1 Completed 0 23h
ingress-nginx-admission-patch-4gtth 0/1 Completed 0 23h
ingress-nginx-controller-789d9c4dc-qdqxv 1/1 Running 3 23h
kube-apiserver-minikube 1/1 Running 5 45h
kube-controller-manager-minikube 1/1 Running 5 45h
kube-proxy-sr6pt 1/1 Running 5 45h
kube-scheduler-minikube 1/1 Running 5 45h
storage-provisioner 1/1 Running 11 45h
Then, I'm checking what services are available in kube-system namespace:
kubectl get services -n kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-nginx-controller-admission ClusterIP 10.97.5.35 <none> 443/TCP 24h
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 45h
I'm assuming that the inner URL to the Ingress service is:
http://ingress-nginx-controller-admission.kube-system.svc.cluster.local
As we saw above, ingress-nginx-controller-admission service exposes only port 443, so on HTTP request I'm getting the following error:
Server Error
Error: connect ETIMEDOUT 10.97.5.35:80
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown> (Error: connect ETIMEDOUT
10.97.5.35 (80)
TCPConnectWrap.afterConnect [as oncomplete]
net.js (1145:16)
- Is this the right inner URL to access Ingress Service in Minikube?
- If it is, how to open port 80?
I'm not interested in connecting directly to auth service.