-
Notifications
You must be signed in to change notification settings - Fork 398
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
APIExport consumer can't wildcard list/watch its schemas until the first APIBinding is created #1183
Comments
workaround: create an APIBinding in the same workspace to itself (we do the same in compute workspaces). |
cc @davidfestal |
I'm working on a fix |
Would it make sense to create a new controller for apiresourceschema to create bound CRDs? |
@sttts ^? |
Actually I want to go back and look at the vw and see if I can fix it there |
I don't think we want a copy of every schema in every cluster. |
Also my intuition. |
there is a problem though with the vw solution: what about watches? They have to start and then eventually show objects when the first APIBinding is created on that shard. That's tricky. We could have a fake storage for identity based requests always returning empty, or a watch without events. When an APIBinding is added, we would have to terminate the old fake storage (including the fake watch) and swich over to the bound CRD based storage. Does that make sense? |
Yeah, I'll look into it |
Our custom apiextensions logic to get CRDs looks for a CRD matching |
Chatted with @sttts and here's what we want to do:
|
cc @p0lyn0mial |
DX of a crash-looping controller until an APIBinding exists is ... not ideal? :) |
Or even ops-X - that will likely trigger alerts on any/all clusters |
They shouldn't be crash-looping, but just notice the URL list is empty and keep watching it until some shard (in their topology partition) shows up. |
I was responding to:
We likely want some user-facing way to expose this waiting state, ultimately. |
We can adjust that bit to not do the termination |
Just sit there and wait until a shard appears, like a controller not seeing any object in a watch. |
I think the same issue applies to the kcp server, not only to the vw server.
is this due to some performance issue? having a single CRD object per shard doesn't sound too heavy. btw: do we want to change the reply from the server to something like |
Yes, this is for APIExports in general, so it's not specific to the vw server.
It's 1 CRD per APIResourceSchema. An APIExport can export 1..n APIResourceSchemas.
Maybe? |
There can be many. And there is just no need to tell controllers to list/watch shards without bindings. |
also creating APIExports could create a storm of storage creations and list/watches. Doing that on demand when a binding shows up is much much better. |
And we can safely assume that only very very few APIExports will actually be bound to more than one workspace. |
@sttts & I chatted a couple of weeks ago about what to do about this. We decided that the APIExport status should only get virtual workspace URL(s) set if and only if there is at least 1 APIBinding referencing the APIExport. |
Describe the bug
A controller using APIExports can't successfully start up and wildcard list/watch the APIs it's exporting until the first APIBinding is created.
To Reproduce
Steps to reproduce the behavior:
In a controller-runtime app, you'd see something like this:
Expected behavior
The controller should be able to start listing/watching its APIs even without any APIBindings for it
Additional context
None
The text was updated successfully, but these errors were encountered: