ukanwat opened a new issue #6732:
URL: https://github.com/apache/apisix/issues/6732


   ### Current Behavior
   
   APISIX is throwing an error related to port being 0 when upstream has 
discovery_type "dns".
   same exact setup works fine with clusters from other kubernetes providers.
   
   ### Expected Behavior
   
   Should not throw the error `http_access_phase(): failed to set upstream: 
invalid nodes format: failed to validate item 1: property "port" validation 
failed: expected 0 to be at least 1`
   
   ### Error Logs
   
   in web response -
   503 Service Temporarily Unavailable
   in apisix pod -
   init.lua:520: http_access_phase(): failed to set upstream: invalid nodes 
format: failed to validate item 1: property "port" validation failed: expected 
0 to be at least 1
   
   ### Steps to Reproduce
   
   1. Create a standard Google Kubernetes Engine cluster.
   2. Install APISIX with ingress controller and dashboard via api7 helm chart 
version 0.8.4 using this 
[values.yaml](https://gist.githubusercontent.com/ukanwat/46b505edccf4d10f7241042815f72f72/raw/8f8af4ca5803a4b60e780e281a5c7609731877de/apisix-values.yaml)
 file (in ingress-apisix namespace).
   3. create this upstream via admin api  - `    {
         "id": "398808046194655761",
         "create_time": 1647237719,
         "update_time": 1647237719,
         "timeout": {
           "connect": 6,
           "send": 6,
           "read": 6
         },
         "type": "roundrobin",
         "scheme": "http",
         "discovery_type": "dns",
         "pass_host": "node",
         "name": "apisix-dashboard",
         "service_name": "apisix-dashboard.ingress-apisix.svc.cluster.local",
         "keepalive_pool": {
           "idle_timeout": 60,
           "requests": 1000,
           "size": 320
         }
       }`
       4. create this route via admin api - 
`{"id":"398808266596942353","create_time":1647237850,"update_time":1647441243,"uri":"/*","name":"apisix-dashboard","priority":50,"methods":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"],"host":"apisix-dashboard.example.com","plugins":{"redirect":{"http_to_https":true}},"upstream_id":"398808046194655761","labels":{"API_VERSION":"v1"},"status":1}`
       5. visit the host in the route and then check the logs in the apisix pod.
   
   ### Environment
   
   - APISIX version (run `apisix version`): 2.12.1
   - Operating system (run `uname -a`): kubernetes (GKE)
   Rest of the values are whatever is bundled in apisix/apisix version 0.8.4 
helm chart.
   - 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to