-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: dns service discovery upstreams are not working in GKE #6732
Comments
I guess GKE's SRV record is an SRV with port zero. Would you provide a packet capture file to prove it? Thanks! |
In the GKE dashboard, Target Port is shown as 0 and in the service config it is http. Could this mean that SRV record has port zero? |
|
Checking only SRV records can also use |
As a workaround, you can add the port to the "service_name" ("apisix-dashboard.ingress-apisix.svc.cluster.local"). |
It makes the workaround in apache#6732 (comment) work. Signed-off-by: spacewander <spacewanderlzx@gmail.com>
It makes the workaround in apache#6732 (comment) work. Signed-off-by: spacewander <spacewanderlzx@gmail.com>
It makes the workaround in #6732 (comment) work. Signed-off-by: spacewander <spacewanderlzx@gmail.com>
…he#6764) It makes the workaround in apache#6732 (comment) work. Signed-off-by: spacewander <spacewanderlzx@gmail.com>
It makes the workaround in #6732 (comment) work. Signed-off-by: spacewander <spacewanderlzx@gmail.com>
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
{ "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
): 2.12.1uname -a
): kubernetes (GKE)Rest of the values are whatever is bundled in apisix/apisix version 0.8.4 helm chart.
openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: