I'm new to Kubernetes and networking in general and I'm really confused about the LoadBalancer
service. Let's say I'm using VPS that DOES NOT have built-in support for LoadBalancer
unlike GCP, AWS EKS, etc (I'm using ssdnodes VPS). Let's say I want to use ingress controller, perhaps ingress-nginx, to proxy http/https requests into Kubernetes cluster. Now, I understand that Kubernetes services by default is "internal" only thus, I would need to expose services so that outside world can reach it - which can be done with NodePort
. Ok, so since I'm using proxy service ingress-nginx, maybe I can just expose ingress-nginx as NodePort
and point DNS record (AAAA) to it? This way, whenever I send request to, for example, "mysebsite.com" with AAAA record of "123.456.789", the nginx-ingress exposed to "123.456.789" will receive the request and properly pass them to associated services in the cluster.
Am I following correctly so far??
Here's what I'm also confused about. If my above theory is correct, why do I even need to use MetalLB to "enable lower network layers" (which I don't know much about) servers without built-in LoadBalancer
support? This makes me think that Kubernetes ingress is a lot more complicated compared to setting up standalone Nginx on a regular monolithic server. Which gives me an impression that in order for me to use Kubernetes properly, I only have few server options (GCP, AWS, and Azure). Also, what kind of collisions is Kubernetes trying to avoid for port 80 and 443, as those will only be used for web application anyways? Is there even a way to "forcefully" assign NodePort
IP to 80 and 443? If not, how can I avoid using port number in domain name, for example http://mywebsite.com:30000/login => http://mywebsite.com/login?
Thank you in advance for your help.