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/06/02 08:50:10 UTC

[GitHub] [apisix] liangyawang opened a new issue, #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   ### Current Behavior
   
   I'm on the official website at: https://apisix.apache.org/docs/apisix/discovery/kubernetes Apifix is configured for automatic discovery based on kubernetes in the boot of, but errors are always reported in the process, as shown in the following figure
   In the following two figures, one is my configuration and the other is my error message. My apifix version is 2.14.1
   ![image](https://user-images.githubusercontent.com/43343906/171592363-4cdecc83-ae0a-462d-af7c-4fb846b9ee4a.png)
   
   
   
   ### Expected Behavior
   
   According to the document on the official website, do automatic discovery directly through kubernetes rather than through Nacos or other registration centers
   
   ### Error Logs
   
   ![image](https://user-images.githubusercontent.com/43343906/171592423-b55e06a8-6fed-48bf-aa92-e6f0b7d80923.png)
   
   ### Steps to Reproduce
   
   1. 通过裸机部署apisix
   2. 在配置文件中按照https://apisix.apache.org/docs/apisix/discovery/kubernetes配置
   3. 重启apisix 观察error.log
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - 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] spacewander commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   Could you add a log 
   ```
       local cjson = require("cjson.safe"); ngx.log(ngx.EMERG, "AA", cjson.encode(apiserver))
   ```
   in https://github.com/apache/apisix/blob/4562875348fdaab3cb05e6df8aecf0604fa6e157/apisix/discovery/kubernetes/informer_factory.lua#L48?


-- 
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 commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   > 您好 请问您会讲中文吗 如果会的话 我向您提问一下 这行代码加在lua文件的什么位置?
   
   In the line above this line of code: https://github.com/apache/apisix/blob/4562875348fdaab3cb05e6df8aecf0604fa6e157/apisix/discovery/kubernetes/informer_factory.lua#L48
   
   The new code was added to print what `apiserver ` is.
   
   


-- 
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] liangyawang commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   Dear team member
   Do you have any examples about the configuration of automatic discovery by APIs through kubernetes and the creation of routes with kubernetes as the type of automatic discovery through APIs? If yes, please send me examples for other types of automatic discovery in the official website, except kubernetes. I think I may have used them incorrectly, so please give me two examples to try. Thank you very much
   
   > 2022年6月4日 下午3:56,tzssangglass ***@***.***> 写道:
   > 
   > 
   > 2022/06/03 19:25:53 [error] 3135#3135: *10445111 [lua] init.lua:517: http_access_phase(): failed to set upstream: no valid upstream node: nil, client: 100.100.100.100, server: _, request: "GET /actuator/health HTTP/1.1", host: "teacher-test.xxxx.cn”
   > 
   > This log indicates that APISIX was unable to query valid IP from kubernates based on service_name. From the information you provided it is hard to tell where the problem is.
   > 
   > 官网中没有对kubernetes的自动发现做详细的描述 所以此刻 我不清楚问题出在了哪里
   > 
   > I didn't find an article describing this in detail either.
   > 
   > You can choose to read the source code to understand it.
   > 
   > Or you can try the suggestion above to add log output and let's locate the problem together.
   > 
   > —
   > Reply to this email directly, view it on GitHub <https://github.com/apache/apisix/issues/7185#issuecomment-1146562338>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKKWAITVGJZQTT7AKVU2QPLVNMD2DANCNFSM5XUHQVKQ>.
   > You are receiving this because you authored the thread.
   > 
   
   


-- 
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] liangyawang commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   请回复一下这个问题
   
   > 2022年6月3日 下午7:35,梁亚旺 ***@***.***> 写道:
   > 
   > 我尝试通过api创建一个路由 因为dashboard还没办法创建 命令如下
   > <粘贴的图形-1.tiff>
   > 
   > 但是 当我尝试通过apisix访问域名时 发现apisix报错如下
   > 2022/06/03 19:25:53 [error] 3135#3135: *10445111 [lua] init.lua:517: http_access_phase(): failed to set upstream: no valid upstream node: nil, client: 100.100.100.100, server: _, request: "GET /actuator/health HTTP/1.1", host: "teacher-test.xxxx.cn <http://teacher-test.xxxx.cn/>”
   > 
   > 官网中没有对kubernetes的自动发现做详细的描述 所以此刻 我不清楚问题出在了哪里 
   > 上图中 service_name字段 yace是我k8s中的namespace teacher-app是我的endpoints名称 
   >> 2022年6月2日 下午5:45,罗泽轩 ***@***.*** ***@***.***>> 写道:
   >> 
   >> local cjson = require("cjson.safe"); ngx.log(ngx.EMERG, "AA", cjson.encode(apiserver))
   > 
   
   


-- 
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] liangyawang closed issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

Posted by GitBox <gi...@apache.org>.
liangyawang closed issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers
URL: https://github.com/apache/apisix/issues/7185


-- 
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] liangyawang commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   我尝试通过api创建一个路由 因为dashboard还没办法创建 命令如下
   
   
   但是 当我尝试通过apisix访问域名时 发现apisix报错如下
   2022/06/03 19:25:53 [error] 3135#3135: *10445111 [lua] init.lua:517: http_access_phase(): failed to set upstream: no valid upstream node: nil, client: 100.100.100.100, server: _, request: "GET /actuator/health HTTP/1.1", host: "teacher-test.xxxx.cn”
   
   官网中没有对kubernetes的自动发现做详细的描述 所以此刻 我不清楚问题出在了哪里 
   上图中 service_name字段 yace是我k8s中的namespace teacher-app是我的endpoints名称 
   > 2022年6月2日 下午5:45,罗泽轩 ***@***.***> 写道:
   > 
   > local cjson = require("cjson.safe"); ngx.log(ngx.EMERG, "AA", cjson.encode(apiserver))
   
   


-- 
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 commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   > 请问一下是否能够提供一个通过api创建自动发现类型为kubernetes的路由的例子
   > […](#)
   > 2022年6月4日 下午6:29,梁亚旺 ***@***.***> 写道: Dear team member Do you have any examples about the configuration of automatic discovery by APIs through kubernetes and the creation of routes with kubernetes as the type of automatic discovery through APIs? If yes, please send me examples for other types of automatic discovery in the official website, except kubernetes. I think I may have used them incorrectly, so please give me two examples to try. Thank you very much
   
   hi @zhixiongdu027 , can you provide some examples?


-- 
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] liangyawang commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   您好 请问您会讲中文吗 如果会的话 我向您提问一下 这行代码加在lua文件的什么位置?
   还有个问题,当我把配置中的token_file改位token时它不再出现报错 但是我也不能确定它是否获取到了对应的endpoints
   
   > 2022年6月2日 下午5:45,罗泽轩 ***@***.***> 写道:
   > 
   > local cjson = require("cjson.safe"); ngx.log(ngx.EMERG, "AA", cjson.encode(apiserver))
   
   


-- 
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 #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   I'm sorry, I've done several scene simulations locally and can't reproduce the situation in the picture.
   
   Maybe the problem is related to the cluster configuration,
   
   Is it convenient for me to communicate quickly through Im (wechat ,qq, mail) to solve this problem?
   You can send your qq,wechart to my mail (root@libssl.com)
   @liangyawang 


-- 
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 commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   > 2022/06/03 19:25:53 [error] 3135#3135: *10445111 [lua] init.lua:517: http_access_phase(): failed to set upstream: no valid upstream node: nil, client: 100.100.100.100, server: _, request: "GET /actuator/health HTTP/1.1", host: "teacher-test.xxxx.cn”
   
   This log indicates that APISIX was unable to query valid IP from kubernates based on `service_name`. From the information you provided it is hard to tell where the problem is.
   
   > 官网中没有对kubernetes的自动发现做详细的描述 所以此刻 我不清楚问题出在了哪里
   
   I didn't find an article describing this in detail either.
   
   You can choose to read the source code to understand it.
   
   Or you can try the suggestion above to add log output and let's locate the problem together.


-- 
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] juzhiyuan commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   Updated: https://the-asf.slack.com/archives/CUC5MN17A/p1654503566448579?thread_ts=1654480287.905789&cid=CUC5MN17A


-- 
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] liangyawang commented on issue #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   请问一下是否能够提供一个通过api创建自动发现类型为kubernetes的路由的例子
   
   > 2022年6月4日 下午6:29,梁亚旺 ***@***.***> 写道:
   > 
   > Dear team member
   > Do you have any examples about the configuration of automatic discovery by APIs through kubernetes and the creation of routes with kubernetes as the type of automatic discovery through APIs? If yes, please send me examples for other types of automatic discovery in the official website, except kubernetes. I think I may have used them incorrectly, so please give me two examples to try. Thank you very much
   
   


-- 
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 #7185: bug: Independent external APIs cannot be automatically discovered by linking APIs servers

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

   抱歉抱歉,我现在才看到此信息。
   我将在今晚尝试复现和修复此问题,
   
   根据报错信息显示,我初步怀疑跟
   apiserver 的初始化有关。


-- 
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