I have created a Service as Load Balancer and tried accessing the service using Minikube tunnel. It is working.
When I tried creating Ingress for the service i get the IP as same as minikube IP and not the tunnel IP.
My ingress Controller is of type NodePort
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 18h
default springboot NodePort 10.103.228.107 <none> 8090:32389/TCP 16h
ingress-nginx ingress-nginx-controller NodePort 10.98.92.81 <none> 80:31106/TCP,443:32307/TCP 17h
ingress-nginx ingress-nginx-controller-admission ClusterIP 10.99.224.119 <none> 443/TCP 17h
kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 18h
kubernetes-dashboard dashboard-metrics-scraper ClusterIP 10.100.23.18 <none> 8000/TCP 16h
kubernetes-dashboard kubernetes-dashboard ClusterIP 10.98.172.252 <none> 80/TCP 16h
I tunnel this using:
minikube service ingress-nginx-controller -n ingress-nginx --url
* Starting tunnel for service ingress-nginx-controller.
|---------------|--------------------------|-------------|------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|---------------|--------------------------|-------------|------------------------|
| ingress-nginx | ingress-nginx-controller | | http://127.0.0.1:58628 |
| | | | http://127.0.0.1:58629 |
|---------------|--------------------------|-------------|------------------------|
http://127.0.0.1:58628
http://127.0.0.1:58629
! Because you are using a Docker driver on windows, the terminal needs to be open to run it.
I get the Url as http://127.0.0.1:58628.
I now apply ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingresstest
spec:
rules:
- host: "ravi.com"
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: springboot
port:
number: 8090
But the ingress addressed is exposed in
kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
ingresstest <none> ravi.com 192.168.49.2 80 64m
I need the tunnel URL in ingress