Support Upstream:Backup directive for service failure use cases #4091
Replies: 6 comments 5 replies
-
This has come up again, but for TransportServer defined services (TCP/UDP) I like the simplicity of what we originally proposed.
Where only a backup and backupPort parameter are added. This latest suggestion introduced a little differently which has me thinking.
In the case of defining multiple upstreams in a VirtualServer, how does the special upstream type of backup, fit into the mix? I think at this point in time, we need a number of YAML mock-ups that cover the full patterns of VirtualServer, VirtualServerRoute, and TransportServer so that we can come to the better pattern that accommodates the assumptions that the current CRDs contain. The over-simplified examples no longer work. |
Beta Was this translation helpful? Give feedback.
-
I think what was initially proposed would suffice for both VirtualServer and TransportServer.
I assume that the properties of the upstream will be inherited by the backup service also. Things like max-conns, max-fails, send-timeout, etc. |
Beta Was this translation helpful? Give feedback.
-
Putting in a suggestion for how the VirtualServer upstream might look: The idea is to have
|
Beta Was this translation helpful? Give feedback.
-
One thing to consider about how the From the docs on the backup directive:
I understand I may be going too much into implementation here, but something that should be considered. It might effect what events a user expects to see when setting a |
Beta Was this translation helpful? Give feedback.
-
Added with 3.4: #4653 |
Beta Was this translation helpful? Give feedback.
-
NGINX Ingress Controller customers have expressed a desire to be able to have the continued benefits of NGINX Ingress Controller balancing traffic directly to all of the pods of a Service, but they want the ability to say "if all of the pods of the backend service become unhealthy, direct the traffic to this alternate location"
In nginx.conf this can be achieved using the backup directive under the upstream block. Where an upstream server can be set as the backup when all the other servers fail (fail to respond, are deemed unhealthy via active or passive health checks, etc).
The key here is that a local service has fully failed and traffic needs to be forwarded to some other target.
This is different than using weights. When using weights such as you might for a blue/green, there always runs the risk of a low number of requests being routed to the alternative destination. And that does not work for all applications or situations. For example, NIC today supports weights of 1 - 99. Which would mean if two upstream services are defined 99 requests could be sent to one service and request 100 would be sent to the other. If this is acceptable for the application, this can be achieved today.
Since NGINX Ingress Controller is continuously updating the Upstream server list, it is necessary to represent this concept in YAML.
What I am proposing is this:
In this example the backup is another service endpoint that is represented by an ExternalName service. It only has to adhere to the limitation of ExternalName service.
I am also limiting the target, because it is a backup, to one service target. Therefore if the Service was some secondary service int he cluster, its Service name would be resolved and the Service cluster IP would be the target for backup.
Beta Was this translation helpful? Give feedback.
All reactions