I have a private 2 nodes Kubernetes cluster configured on VMWare Workstation 15. I'm using MetalLB and Calico.
Ingress service and ingress look like:
xxx@c1-cp1:~/Desktop$ kubectl get svc -n ingress-controller-2
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
wsnginx-ingress-nginx-controller LoadBalancer 10.109.117.222 192.168.44.136 80:30167/TCP,443:30680/TCP 24h
wsnginx-ingress-nginx-controller-admission ClusterIP 10.105.103.165 <none> 443/TCP 24h
xxx@c1-cp1:~/Desktop$ kubectl get ing apollo-ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
apollo-ingress wsnginx test.xxx.com 192.168.44.136 80 3h17m
I am using Nat Network Adapter and static IPS. I have port forwarding configured as following
curl -D- http://192.168.44.136 -H 'Host: test.xxx.com'
from VM, returns 200 status but I cannot manage to access it from host machine Win10 on 127.0.0.1:8080
as I get a 404 NGINX NotFound
.
Could you please help me out? what am I doing wrong? How else could I expose it in my private network?
Thank you!
UPDATE
I am not sure if this is the right way, but I managed to connect from the host machine, by changing a bit the Ingress resource. I put in comments the host parameter, as
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: apollo-ingress
spec:
ingressClassName: wsnginx
rules:
#- host: test.xxx.com
- http:
paths:
- backend:
service:
name: apollo-service
port:
number: 80
path: /
pathType: Prefix
and now my ingress looks like this
NAMESPACE NAME CLASS HOSTS ADDRESS PORTS AGE
default ingress.networking.k8s.io/apollo-ingress wsnginx * 192.168.44.136 80 3h31m
It seems that I can access it now from my host machine as well. I am having a Rest API so I've just opened it from browser http://127.0.0.1:8080