-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: As a user, I want kubernetes service discovery to support more configuration items #8311
Comments
The current watch timeout is hard coded with a built-in sample algorithm. I think we can add a new field for users to configure the watch timeout. |
I think the goal is to avoid "re list-watch". |
Any suggestions? |
In order to solve the problem, |
How about making |
Too short watchSeconds value will produce many "re list-watch" do we have to use an proxy before apiserver ? |
In actual usage scenarios, such as Alibaba Cloud, AWS, Azure, etc., the apiserver will have a proxy |
In fact, if you use |
The problem is not here, and in the code it is already set apisix/apisix/discovery/kubernetes/informer_factory.lua Lines 199 to 206 in 288708c
The problem is that in a network topology like the following Position(1) does not match timeout policy for Position(2) |
@crazyMonkey1995 @tokers @tzssangglass I would like to make a PR for "support configuration watchSeconds and retryInterval" latter |
we can make
As described here, the user needs to configure the timeout to be smaller than the proxy. |
I tend to use a config in the following format, or any other suggestions ? kubernetes:
service: ...
client: ...
retry_interval: 30
min_watch: 1800
max_watch: 2000 @crazyMonkey1995 @tokers @tzssangglass @spacewander |
what about kubernetes:
service: ...
client: ...
retry_interval: 30
watch:
connect:
send:
read: |
Hello @spacewander @tokers @tzssangglass @crazyMonkey1995 if this issue is still open, please assign it to me: To solve this issue, we can add some configuration items to the Kubernetes service discovery such as the duration of a watch, retry time, or strategy, as shown below:
In this configuration, the duration of a watch is set to 60 seconds, and the retry strategy is set to exponential backoff. The retry interval is set to 30 seconds, which means that the client will retry connecting to the service after 30 seconds if the initial connection attempt fails. |
Description
Recently, we deployed apisix on different clouds and used the feature of kubernetes service discovery. The problem is that on different clouds, the proxy layer (LB) in front of apiserver has different idle timeouts. However, in apisix's kubernetes service discovery, The time of a watch is fixed, which will cause a problem: when there is no endpoints event in the cluster for a long time, the server will time out instead of the client, and then the service discovery will restart the list-watch after a fixed 40 seconds , so if you can add some configuration items, such as the duration of a watch, retry time or strategy, etc., thank you!
The text was updated successfully, but these errors were encountered: