How to deploy without 502 bad gateway

Hi,

I have three instances of rancher nodes with ingress. In front of this I have also bare metal reverse proxy with NGINX.

Three instances of rancher have IPs:
172.20.58.1
172.20.58.2
172.20.58.3

When user is connecting to my site, request is going to my bare metal nginx, then in config:
upstream xxx {
server 172.20.58.1;
server 172.20.58.2;
server 172.20.58.3:;
}

Everything is fine, but when I make “redeploy” users got 502 bad gateway. I have to wait till redeploy is done and then everything is fine.

How to make it zero-downtime? Can I assign ingress an IP and set this IP in my external reverse proxy? I understand for now, in this setup my external nginx is connecting directly to nodes. I got no idea how to connect it properly and why and for what I need this ingress :slight_smile:

Greetings

I presume you are referring to redeploying a deployment? How many replicas of your app do you have and what is the Scaling/Upgrade policy?

If the policy is set to “Rolling: start new pods, then stop old”, then you should see a new pod get started, and then the old one is stopped and there should not be any downtime. If the policy is either of the other two options and you only have one replica, then it will stop the old pod before starting the new pod.

If you are viewing the details of the deployment (click on the name in the Workloads view), and then click redeploy from the 3-dots on the top right you will see the order that it starts/stops the pods.