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)
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.