Nginx not reflecting the proxy server

9/12/2017

Trying nginx on kubernetes to access services running at different ports.

Intially when all the services deployed and nginx deployed at the last then i see everything working fine.

If any of the services updated/restarted , nginx unable to access that particular service.

server {
    location / {
        proxy_pass http://backends.example.com:8080;
    }
}

and will be able to access the service only if I restart the nginx through

nginx -s reload 

Anyway to make nginx detect/poll to reflect the services restarts (Service Discovery with DNS)

-- charan kumar
kube-dns
kubernetes
nginx

1 Answer

9/12/2017

Service never "restarts", and it's ClusterIP never changes (well, that is unless you delete and recreate the service), so you don't need to watch for changes in the backing endpoints at all as this is in a way what kube-proxy does for you.

-- Radek 'Goblin' Pieczonka
Source: StackOverflow