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 2021/04/14 11:02:38 UTC

[GitHub] [apisix-dashboard] Firstsawyou opened a new issue #1770: there is no default status code when configuring the health check through the Dashboard

Firstsawyou opened a new issue #1770:
URL: https://github.com/apache/apisix-dashboard/issues/1770


   # Feature request
   
   ## Please describe your feature
   
   When configuring the health check in the Dashboard, if the status code information is not set, there is no default status code. When configuring the health check through the `Admin API`, there will be a status code by default.
   
   1. Configure the health check through the Dashboard
   Create a route and do not set the `HTTP Status` in the passive health check:
   
   <img width="875" alt="截屏2021-04-14 下午6 47 45" src="https://user-images.githubusercontent.com/52862365/114699995-9013df80-9d53-11eb-997f-e2e5147b4f4a.png">
   
   
   The etcd data is as follows:
   
   ```yaml
   {
       "id":"350421980362573985",
       "create_time":1618397376,
       "update_time":1618397376,
       "uris":[
           "/*"
       ],
       "name":"dashboard-healthcheck",
       "methods":[
           "GET",
           "HEAD",
           "POST"
       ],
       "upstream":{
           "nodes":[
               {
                   "host":"127.0.0.1",
                   "port":80,
                   "weight":1
               }
           ],
           "timeout":{
               "connect":6,
               "read":6,
               "send":6
           },
           "type":"roundrobin",
           "checks":{
               "active":{
                   "healthy":{
                       "interval":10,
                       "successes":5
                   },
                   "host":"localhost",
                   "http_path":"/hello",
                   "port":1980,
                   "timeout":2,
                   "unhealthy":{
                       "http_failures":3,
                       "interval":10
                   }
               },
               "passive":{
                   "healthy":{
                       "successes":3
                   },
                   "unhealthy":{
                       "http_failures":3,
                       "tcp_failures":3
                   }
               }
           },
           "pass_host":"pass"
       },
       "status":1
   }
   ```
   
   2. Configure the health check through the `Admin API`, and do not set the `HTTP Status` in the passive health check.
   
   Create a route:
   
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/admin-api",
       "upstream": {
            "nodes": {
               "127.0.0.1:1980": 1,
               "127.0.0.1:1970": 1
           },
           "type": "roundrobin",
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/status",
                   "host": "foo.com",
                   "healthy": {
                       "interval": 2,
                       "successes": 1
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   }
               },
               "passive": {
                   "healthy": {
                       "successes": 3
                   },
                   "unhealthy": {
                       "http_failures": 3,
                       "tcp_failures": 3
                   }
               }
           }
       }
   }'
   ```
   
   The etcd data is as follows:
   
   ```json
   {
       "update_time":1618397719,
       "id":"1",
       "create_time":1618394497,
       "uri":"/admin-api",
       "status":1,
       "priority":0,
       "upstream":{
           "type":"roundrobin",
           "scheme":"http",
           "checks":{
               "active":{
                   "healthy":{
                       "interval":2,
                       "successes":1,
                       "http_statuses":[
                           200,
                           302
                       ]
                   },
                   "concurrency":10,
                   "http_path":"/status",
                   "https_verify_certificate":true,
                   "timeout":5,
                   "unhealthy":{
                       "http_failures":2,
                       "tcp_failures":2,
                       "interval":1,
                       "timeouts":3,
                       "http_statuses":[
                           429,
                           404,
                           500,
                           501,
                           502,
                           503,
                           504,
                           505
                       ]
                   },
                   "type":"http",
                   "host":"foo.com"
               },
               "passive":{
                   "healthy":{
                       "http_statuses":[
                           200,
                           201,
                           202,
                           203,
                           204,
                           205,
                           206,
                           207,
                           208,
                           226,
                           300,
                           301,
                           302,
                           303,
                           304,
                           305,
                           306,
                           307,
                           308
                       ],
                       "successes":3
                   },
                   "unhealthy":{
                       "timeouts":7,
                       "http_statuses":[
                           429,
                           500,
                           503
                       ],
                       "http_failures":3,
                       "tcp_failures":3
                   },
                   "type":"http"
               }
           },
           "nodes":{
               "127.0.0.1:1980":1,
               "127.0.0.1:1970":1
           },
           "pass_host":"pass",
           "hash_on":"vars"
       }
   }
   ```
   ## Describe the solution you'd like
   
   I think that when configuring the health check through the Dashboard, there should be a default status code. Keep consistent with `Admin API`.
   
   


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

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



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #1770: there is no default status code when configuring the health check through the Dashboard

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


   PR #1764  will fix this issue.


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

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



[GitHub] [apisix-dashboard] Firstsawyou commented on issue #1770: there is no default status code when configuring the health check through the Dashboard

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #1770:
URL: https://github.com/apache/apisix-dashboard/issues/1770#issuecomment-819441833


   > PR #1764 will fix this issue.
   
   Got 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.

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