You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/08/25 05:54:11 UTC

[GitHub] [apisix] wolgod opened a new issue, #7791: help request: apisix discovery with kubernetes

wolgod opened a new issue, #7791:
URL: https://github.com/apache/apisix/issues/7791

   ### Description
   
   I want to use the kubernetes  service discovery function of apisix, and now the demo has been run through, there are two questions
   
   1. If I use the kubernetes  service discovery function, is there an interface to get the real Upstream information on the backend of the service, or is this information just cached in the apisix instance and cannot be viewed?
   
   2.  in the documentation, it is said that the data exists in ngx.shared.kubernetes. If my apisix instance is restarted, how can I ensure that all Upstreams have been re-acquired before processing the request?
   
   ### Environment
   
   - APISIX version (run `apisix version`):2.13.2
   - Operating system (run `uname -a`):centos7
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):1.9.19
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #7791: help request: apisix discovery with kubernetes

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #7791:
URL: https://github.com/apache/apisix/issues/7791#issuecomment-1229691117

   > here is another question. Due to historical reasons, I can only use the 2.13 version of apisix. I think 2.15 has fixed a bug. I don’t know how much this bug affects. If I don’t upgrade, will there be a big problem?
   
   Please open a new issue to describe the new problem. I will close the current issue first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zhixiongdu027 commented on issue #7791: help request: apisix discovery with kubernetes

Posted by GitBox <gi...@apache.org>.
zhixiongdu027 commented on issue #7791:
URL: https://github.com/apache/apisix/issues/7791#issuecomment-1227046441

   Hi , @wolgod 
   
   > If I use the kubernetes service discovery function, is there an interface to get the real Upstream information on the backend of the service, or is this information just cached in the apisix instance and cannot be viewed?
   
   there is no interface for dump now ,welecom PR .
   
   > in the documentation, it is said that the data exists in ngx.shared.kubernetes. If my apisix instance is restarted, how can I ensure that all Upstreams have been re-acquired before processing the request?
   
   kubernetes discovery uses List-Watch to get endpoint information .
   
   upstreams information is empty until the first "List" complete .
   If there is a querying before completed, it will get an "nil" result
   
   If you cannot accept this, you may need some way to ensure that apisix only accepts client requests after kubernetes discovery 
   completing first "List". 
   ApiSix can't do this by its own
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zhixiongdu027 commented on issue #7791: help request: apisix discovery with kubernetes

Posted by GitBox <gi...@apache.org>.
zhixiongdu027 commented on issue #7791:
URL: https://github.com/apache/apisix/issues/7791#issuecomment-1227912215

   >1.  In my understanding, the list-watch should be in the master worker. If I execute apisix reload, it should not cause the list-watch to be re-listed. I don’t know if it is correct.
   
     Yes,  it is correct.
   
   
   > 2.  After the first list in k8s is completed, all endpoints will be obtained. At this time, the service should be able to obtain upstreams, but when will the first list be completed, there will be log printing or is there any other way to obtain it
   
   ![image](https://user-images.githubusercontent.com/4032302/186795388-796ee3b1-afe3-45db-ba48-48fe0396f04e.png)
   
   There is no interface to show get the state of List-Watch 
   
   Maybe you can sense this by log "list failed " or log "begin to watch ",
   If you are willing to modify the source code, you can add an interface to read the value of informer.fetch_state
   
   
   > 3. because the list-watch is performed on apisix, whether there are multiple apisix instances in theory, the Upstream of the same service may be differen
   
   exactly as you said, but I think it's the price of multiple apisix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] wolgod commented on issue #7791: help request: apisix discovery with kubernetes

Posted by GitBox <gi...@apache.org>.
wolgod commented on issue #7791:
URL: https://github.com/apache/apisix/issues/7791#issuecomment-1228363485

   Thank you very much, there is another question. Due to historical reasons, I can only use the 2.13 version of apisix. I think 2.15 has fixed a bug. I don’t know how much this bug affects. If I don’t upgrade, will there be a big problem?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass closed issue #7791: help request: apisix discovery with kubernetes

Posted by GitBox <gi...@apache.org>.
tzssangglass closed issue #7791: help request: apisix discovery with kubernetes
URL: https://github.com/apache/apisix/issues/7791


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] wolgod commented on issue #7791: help request: apisix discovery with kubernetes

Posted by GitBox <gi...@apache.org>.
wolgod commented on issue #7791:
URL: https://github.com/apache/apisix/issues/7791#issuecomment-1227122950

   > Hi , @wolgod
   > 
   > > If I use the kubernetes service discovery function, is there an interface to get the real Upstream information on the backend of the service, or is this information just cached in the apisix instance and cannot be viewed?
   > 
   > there is no interface for dump now ,welecom PR .
   > 
   > > in the documentation, it is said that the data exists in ngx.shared.kubernetes. If my apisix instance is restarted, how can I ensure that all Upstreams have been re-acquired before processing the request?
   > 
   > kubernetes discovery uses List-Watch to get endpoint information .
   > 
   > upstreams information is empty until the first "List" complete . If there is a querying before completed, it will get an "nil" result
   > 
   > If you cannot accept this, you may need some way to ensure that apisix only accepts client requests after kubernetes discovery completing first "List". ApiSix can't do this by its own
   
   thanks for answer, about second problem 
   1. In my understanding, the list-watch should be in the master worker. If I execute apisix reload, it should not cause the list-watch to be re-listed. I don’t know if it is correct.
   2. After the first list in k8s is completed, all endpoints will be obtained. At this time, the service should be able to obtain upstreams, but when will the first list be completed, there will be log printing or is there any other way to obtain it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org