accessing Kubernetes from remote hosts accessing Kubernetes from remote hosts kubernetes kubernetes

accessing Kubernetes from remote hosts


The answer above does solve the issue, but the application still works on the non-common, kubernetes assigned port. I guess the idea is to have kubernetes cluster visible on the single IP and standard ports.

The MetalLb setup can provide bare-metal load balancer, or the 'LoadBalancer' service type, which is not provided by kubernetes by default.Your example above uses 'NodePort' type and in your service configuration, you should be able to replace 'NodePort' with 'LoadBalancer' type. If the configuration is correct, kubectl get service example-service should display both addresses from the internal kube network and the external IP address from MetalLb range you have configured. Something like in the example below:

kube-server:~$ kubectl get service keycloak-db -n keycloak-db NAME          TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)          AGEkeycloak-db   LoadBalancer   10.109.91.158   192.168.1.243   8080:32434/TCP   33d

The other thing I noticed in your example is that the address range assigned in the MetalLb configuration (192.168.100.0/24) does not match your home network (10.11.0.0/16). If you don't have some routing in place, it would be better to reserve some IPs in the home network and use them in the MetalLb.


shouldnt it be curl <kubernetes machine IP >:30140 if you are using NodePort service ?