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/06 10:55:14 UTC

[GitHub] [apisix] liangyawang opened a new issue, #7199: docs: about apisix discovery for kubernetes

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

   ### Current State
   
   
   
   Hello team members, I had the following problems when I made automatic discovery based on apifix and kubernetes according to the official documents
   
   1. use the token file as the interactive voucher between apifix and kuberentes. The missing field in the error header cannot be connected normally, and then replace it with a token string to complete the link
   
   In my token file at that time, only the token string was pasted without any other fields
   
   2. when I call the API to automatically discover the route of type kubernetes, I use curl to request and give an error prompt for the non optional upstream
   
   When I help with troubleshooting through team members, the troubleshooting process is as follows:
   
   1. service_ The name field is incorrectly filled in. For example: /test/test app
   
   2. not in service_ Add the corresponding service port in the name field
   
   3. we mistakenly think that we need to add a service port directly. After troubleshooting, we mapped it through the port name corresponding to the port in the endpoints
   
   The team is expected to automatically find kubernetes in the official document
   
   1. for token_ File problem
   
   2. add a corresponding example in this discovery type document to create an automatic discovery route with kubernetes type through API
   3. the example should give an example and explain the detailed configuration format of each field. For example, today's port will be checked for a while
   4. the detailed information of the corresponding namespace service port shall be displayed during the example for reference
   5. the log should be printed for each environment and adjusted according to the level of the configuration file, because today I want to see if he really gets the data, but I don't know where to add the log to print for users who are unfamiliar with Lua
   
   ### Desired State
   
   - Display service information
   ```
   [root@ ~]# kubectl get pods -n test |grep test-app
   test-app-6f57f6fffb-gfblz                   1/1     Running            0          6d23h
   
   [root@ ~]# kubectl get endpoints -n test test-app
   NAME          ENDPOINTS             AGE
   test-app   10.223.216.201:8080   1d
   
   [root@ ~]# kubectl describe endpoints -n test test-app
   Name:         test-app
   Namespace:    test
   Labels:       app=test-app
   Annotations:  endpoints.kubernetes.io/last-change-trigger-time: 2022-06-02T19:07:21+08:00
   Subsets:
     Addresses:          10.223.216.201
     NotReadyAddresses:  <none>
     Ports:
       Name     Port  Protocol
       ----     ----  --------
       8080tcp  8080  TCP                        #Note the port name here
   
   Events:  <none>
   ```
   
   - Show the route creation method of the corresponding service
   Since the dashboard does not support routes of kubernetes type, it is created by calling API
   ```
   curl http://127.0.0.1:80/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f8sdfcx7ad84b625c8f1sdfagw32' -X PUT -i -d '
   {
       "uri": "/*",                                                         # location path
       "name": "test-test-app-for-kubernetes",     #Name a free reason
       "priority": 100,
       "host": "test.xxxx.cn",                    #Fill in according to your own domain name
       "methods": ["PUT", "GET", "POST", "DELETE", "PATCH", "HEAD", "OPTIONS","CONNECT", "TRACE"],
       "upstream": {
           "timeout": {
             "connect": 6,
             "send": 6,
             "read": 6
           },
           "service_name": "test/test-app:tcp8080",  #Configuration format: namespace/deploy_name:port_name
           "type": "roundrobin",
           "discovery_type": "kubernetes"                   #type use kubernetes
       }
   }'
   ```
   > In addition, I hope to add log configuration. For example, I want to check whether he has obtained the configuration access and reported an error. Why not end without an optional node? This is very difficult to troubleshoot
   Or you can tell people what logs they want to view and in which file the corresponding command can be added to the function


-- 
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] zhixiongdu027 commented on issue #7199: docs: about apisix discovery for kubernetes

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

   不好意思,我现在才来看到信息,
   我将在今晚尝试复现和修复这个问题。


-- 
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] spacewander commented on issue #7199: docs: about apisix discovery for kubernetes

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

   > > use the token file as the interactive voucher between apifix and kuberentes. The missing field in the error header cannot be connected normally, and then replace it with a token string to complete the link
   > > In my token file at that time, only the token string was pasted without any other fields
   > 
   > Maybe this is a bug and should be fixed. cc @tzssangglass @spacewander
   
   There is an issue to track it: https://github.com/apache/apisix/issues/7185
   But we still don't know how to reproduce 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


[GitHub] [apisix] juzhiyuan commented on issue #7199: docs: about apisix discovery for kubernetes

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

   related thread https://the-asf.slack.com/archives/CUC5MN17A/p1654480287905789


-- 
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] github-actions[bot] closed issue #7199: docs: about apisix discovery for kubernetes

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #7199: docs: about apisix discovery for kubernetes
URL: https://github.com/apache/apisix/issues/7199


-- 
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] tokers commented on issue #7199: docs: about apisix discovery for kubernetes

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

   > use the token file as the interactive voucher between apifix and kuberentes. The missing field in the error header cannot be connected normally, and then replace it with a token string to complete the link
   In my token file at that time, only the token string was pasted without any other fields
   
   Maybe this is a bug and should be fixed. cc @tzssangglass @spacewander 


-- 
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 #7199: docs: about apisix discovery for kubernetes

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

   As you can see, this file is my token file, but it contains only token and no other fields
   
   When I annotate the token field, open the token file field, and then restart apisik, an error will be reported in the last screenshot. You can compare the contents of my token field with those in the token file
   
   
   
   
   > 2022年6月7日 上午10:12,罗泽轩 ***@***.***> 写道:
   > 
   > 
   > use the token file as the interactive voucher between apifix and kuberentes. The missing field in the error header cannot be connected normally, and then replace it with a token string to complete the link
   > In my token file at that time, only the token string was pasted without any other fields
   > 
   > Maybe this is a bug and should be fixed. cc @tzssangglass <https://github.com/tzssangglass> @spacewander <https://github.com/spacewander>
   > There is an issue to track it: #7185 <https://github.com/apache/apisix/issues/7185>
   > But we still don't know how to reproduce it.
   > 
   > —
   > Reply to this email directly, view it on GitHub <https://github.com/apache/apisix/issues/7199#issuecomment-1148116242>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKKWAIQH7DQZ7XL7MR74IADVN2VY7ANCNFSM5X7AA6BQ>.
   > 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] zhixiongdu027 commented on issue #7199: docs: about apisix discovery for kubernetes

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

   Hi all:
   
    The cause of the failure mentioned in the #7185 is that:  
    the content of token_file has an extra '\n' character at the end, which causes the ListWatch http request to fail
   
    I will submit a PR to fix this
   
   @liangyawang @tokers @tao12345666333 @spacewander @juzhiyuan


-- 
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 #7199: docs: about apisix discovery for kubernetes

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

   如您所见,此文件是我的令牌文件,但它只包含令牌,不包含其他字段
   
   
   当我注释token字段 打开token_file字段,然后重新启动apisix,就会发生邮件中最后一个截图的报错,你可以看一下我图1和图2中的token是一模一样的只不过 一个是存放在文件中 一个是字符串的形式
   
   
   这是报错
   
   
   > 2022年6月7日 上午11:45,琚致远 ***@***.***> 写道:
   > 
   > 
   > @liangyawang <https://github.com/liangyawang> it's apisix, not apisik.
   > 
   > But we still don't know how to reproduce it.
   > 
   > @liangyawang <https://github.com/liangyawang> Maybe you could use Chinese to write very details steps, and then Zexuan could reproduce.
   > 
   > —
   > Reply to this email directly, view it on GitHub <https://github.com/apache/apisix/issues/7199#issuecomment-1148161266>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKKWAIUPIV2FJZI2PZBB4P3VN3AWJANCNFSM5X7AA6BQ>.
   > You are receiving this because you were mentioned.
   > 
   
   


-- 
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] tao12345666333 commented on issue #7199: docs: about apisix discovery for kubernetes

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

   
   cc @zhixiongdu027 


-- 
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 #7199: docs: about apisix discovery for kubernetes

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

   @liangyawang it's `apisix`, not `apisik`. 
   
   > But we still don't know how to reproduce it.
   
   @liangyawang Maybe you could use Chinese to write very details steps, and then Zexuan could reproduce.


-- 
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] github-actions[bot] commented on issue #7199: docs: about apisix discovery for kubernetes

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7199:
URL: https://github.com/apache/apisix/issues/7199#issuecomment-1560826437

   This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
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] github-actions[bot] commented on issue #7199: docs: about apisix discovery for kubernetes

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7199:
URL: https://github.com/apache/apisix/issues/7199#issuecomment-1582275012

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


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