envoyproxy/envoy

Unable to drain endpoints before removal

Open

#7218 aperta il 9 giu 2019

Vedi su GitHub
 (13 commenti) (5 reazioni) (0 assegnatari)C++ (5373 fork)batch import
design proposalhelp wanted

Metriche repository

Star
 (27.997 star)
Metriche merge PR
 (Merge medio 8g) (378 PR mergiate in 30 g)

Descrizione

Title: Unable to drain endpoints before removal

Description: I'm trying to implement endpoint connection draining (and not draining envoy itself) with sticky sessions configured.

At t=0, there are 5 endpoints configured in my envoy cluster with cookie based sticky sessions configured. At t=10, I wish to drain 1 out of the 5 endpoints I have i.e. I do not want any new connections to be routed to that endpoint, but I want the current sessions to persist before I remove the endpoint from the list.

In order to drain an endpoint, I've tried 2 approaches -

  1. Set 'health_status': 'DRAINING' in the endpoint (See https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/health_check.proto#envoy-api-enum-core-healthstatus) This takes care of not sending any new connections to the endpoint, but does not allow older sticky sessions to persist and they're broken off. I got leads for this from https://github.com/envoyproxy/envoy/issues/2920#issuecomment-388123100, but doesn't seem to work :man_shrugging:

  2. Set load_balancing_weight: 1 in the endpoint in the hope that a lower weight will not route any new requests to the endpoint but the sticky sessions will persist, but that didn't happen.

So, what am I missing here? Any pointers are appreciated! Thanks :)

Config: This is how the endpoint configuration looks when I'm trying to drain it -

                                {
                                    "endpoint": {
                                        "address": {
                                            "socket_address": {
                                                "address": "172.17.0.9",
                                                "port_value": 8080
                                            }
                                        }
                                    }
                                },
                                {
                                    "endpoint": {
                                        "address": {
                                            "socket_address": {
                                                "address": "172.17.0.14",
                                                "port_value": 8080
                                            }
                                        }
                                    },
                                    "health_status": "DRAINING"
                                },

Guida contributor