Closed fvogl closed 10 months ago
@rangoo94 @ypoplavs anything wrong with ingress spec?
Access-Control-*
headers, it is added on the ingress levelfetch
with default mode: cors, credentials: same-origin
, there were no changes regarding that@vsukhin, considering that, I don't think it's anything related to Testkube changes.
@fvogl, maybe you had some manual ingress changes in the OpenShift previously, that were not preserved after the upgrade?
@fvogl, I've got a suspicion that I know what is wrong - is the testkube-api.ourdomain.com/results/v1/config
the one that should be? I would rather assume that /results/v1
will be below the same domain as the Dashboard (what would solve CORS problem):
testkube.ourdomain.com
pointing to Testkube Dashboardtestkube.ourdomain.com/results/v1
- pointing to Testkube API ServerIf API will be under different domain, you need to add Access-Control-*
headers to its ingress, allowing to access from the Dashboard's domain.
@rangoo94 , the thing is that testkube was working perfectly fine until I've updated it to 1.16.20. When I change the testkube-api image back to 1.16.16 it works fine again. If I change it to anything > 1.16.16 I get what I reported.
The only changes I see between 1.16.16
and 1.16.17
(here) are:
libssl3
installed instead of libssl1.1
on the containerv2.51.0
, FastHTTP updated to v1.50.0
, NATS libraries updated, gRPC updated to v1.60.0
Really nothing that could cause that.
@fvogl, could you go directly to that API URL manually (https://testkube-api.ourdomain.com/results/v1/config)? Maybe it's reporting error (i.e. 502), so the API server is down, or the ingress is not there, or ingress is not adding the Access-Control-*
headers for 5xx?
@rangoo94 , getting a json with 3 fields for 1.16.16 but "Cannot GET /results/v1/config" with 1.16.20
@fvogl I see a few options:
Could you please check API server logs?
@rangoo94 , there is nothing in the logs.
I do have 2 different URLs for testkube-dashboard (with an oauth2-proxy wrapper for authentication) and testkube-api (without that).
API server is up - at least the POD is ready.
That means that the ingress is misconfigured and doesn't point to the API Server. Otherwise, there would be a log, even in case of 404:
{"level":"debug","ts":1704294543.967603,"caller":"server/httpserver.go:45","msg":"request","method":"GET","path":"http://localhost:8088/v1/testing-unknown-url"}
Getting this when accessing the api-server service from a POD within the cluster
/home/abc $ curl -vvv testkube-api-server.abc-testkube:8088/results/v1/config
* Host testkube-api-server.abc-testkube:8088 was resolved.
* IPv6: (none)
* IPv4: 172.30.179.124
* Trying 172.30.179.124:8088...
* Connected to testkube-api-server.abc-testkube (172.30.179.124) port 8088
> GET /results/v1/config HTTP/1.1
> Host: testkube-api-server.abc-testkube:8088
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< date: Wed, 03 Jan 2024 15:26:38 GMT
< content-type: text/plain; charset=utf-8
< content-length: 29
< x-envoy-upstream-service-time: 0
< server: envoy
<
* Connection #0 to host testkube-api-server.abc-testkube left intact
Cannot GET /results/v1/config
No log in the POD.
And this with version 1.16.16.
/home/abc $ curl -vvv testkube-api-server.abc-testkube:8088/results/v1/config
* Host testkube-api-server.abc-testkube:8088 was resolved.
* IPv6: (none)
* IPv4: 172.30.52.88
* Trying 172.30.52.88:8088...
* Connected to testkube-api-server.abc-testkube (172.30.52.88) port 8088
> GET /results/v1/config HTTP/1.1
> Host: testkube-api-server.abc-testkube:8088
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 200 OK
< date: Wed, 03 Jan 2024 15:26:13 GMT
< content-type: application/json
< content-length: 86
< vary: Origin
< access-control-allow-origin: *
< x-envoy-upstream-service-time: 2
< server: envoy
<
* Connection #0 to host testkube-api-server.abc-testkube left intact
{"id":"","clusterId":"cluster4a41c1aa8fe424b0c7e4ab54cb0a1c34","enableTelemetry":true}
and when I try to get a file there which does not exist I get the same error but also no log in the POD (guess I don't have loglevel as debug although I don't know how to change it)
/home/abc $ curl -vvv testkube-api-server.abc-testkube:8088/results/v1/xxx
* Host testkube-api-server.abc-testkube:8088 was resolved.
* IPv6: (none)
* IPv4: 172.30.52.88
* Trying 172.30.52.88:8088...
* Connected to testkube-api-server.abc-testkube (172.30.52.88) port 8088
> GET /results/v1/xxx HTTP/1.1
> Host: testkube-api-server.abc-testkube:8088
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< date: Wed, 03 Jan 2024 15:31:28 GMT
< content-type: text/plain; charset=utf-8
< content-length: 26
< vary: Origin
< access-control-allow-origin: *
< x-envoy-upstream-service-time: 0
< server: envoy
<
* Connection #0 to host testkube-api-server.abc-testkube left intact
Cannot GET /results/v1/xxx
Guess this rules out that it's an ingress issue as I've used the K8s service directly.
Thanks @fvogl! I just noticed what was the reason:
/results/v1
was replaced to be the only prefix by accident (earlier: /v1/
and - I think deprecated - /results/v1/
)/results
group was deleted (leading to only /v1/
prefix being acceptable)I would suggest changing the endpoint/ingress to point to testkube-api-server.abc-testkube:8088/v1
instead of testkube-api-server.abc-testkube:8088/results/v1
.
@vsukhin, should we restore /results/v1
alias for backward compatibility, or we are deprecating it completely?
// mount everything on results
// TODO it should be named /api/ + dashboard refactor
s.Mux.Mount("/results", s.Mux)
guess, it's @exu changes for Fiber upgrade, I would keep it or backward compatibility,
@rangoo94 , I've just changed the config to not have the /results and it works again :)
I would opt for removing this /results
route for now. It introduces unnecessary complexity and confusion.
Looks like Fiber broke it's Mount
api in recent version, and it's not so trivial to duplicate groups anymore.
https://github.com/kubeshop/testkube/pull/4866/files
Added docs section to use /
route instead - closing for now.
For testkube-api > 1.16.16 we get this error on the dashboard
Boxes show just a loading animation
Note: I don't use ingress from the chart, but have my route for openshift created manually. Was working <= 1.16.16