External Load Balancer Nginx to Ingress on k8s

Viewed 11

Good day! The question may seem strange, but I am trying to understand the situation and the possibilities of its implementation. I will be grateful for the answer and your time.

Components: Virtual machine with reverse proxy server as nginx k8s load balancer input load balancer running on, running on 80,443 ports in a k8s cluster dns entry for *.k8s.test.lab

Can I use the following construction: convert a VM running to a load balancer directly nginx, convert a VM running to a load balancer directly, avoiding an ingress load balancer in a k8s cluster?

Can I get content from the site.test.laboratory? If so, where to make changes for this?

After making the following configuration on an external nginx, I get the error 502 faulty gateway

[block scheme]

upstream loadbalancer {
    server srv-k8s-worker0.test.lab:80;
    server srv-k8s-worker1.test.lab:80;
    server srv-k8s-worker2.test.lab:80;

}

server {
    listen 80;

    server_name site.test.lab;  # name in browser

    location / {
        proxy_pass http://loadbalancer;
        
        }
}

Also, for verification, I created dns records for the

  • srv-k8s-worker0.test.lab
  • srv-k8s-worker1.test.lab
  • srv-k8s-worker2.test.lab

In general, an answer is needed about the possibility of this configuration as a whole and whether it makes sense. Node port is not an option to use.

The only option that allows you to change the domain names that I managed to do.

server {
    listen 80;

    server_name site.test.lab;  # name in browser

    location / {
        proxy_pass http://site.k8s.test.lab;
        
        }
}

Thanks!

0 Answers
Related