-
Notifications
You must be signed in to change notification settings - Fork 39k
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
Race between seeing a CRD added event and being able to select the kind #125471
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/sig api-machinery |
This seems working as intended. The CRD existing does not mean the resource is usable yet. You have to watch the CRD and wait for the status to say that it is established. This means that the CRD controller has seen the new CRD and created the necessary APIService for it. The APIService is then used by the apiserver to know where to route requests for that resource. |
Hi @karlkfi, ah, thanks for clarifying, I was not aware of this! I will go ahead and close the issue. |
What happened?
We have observed a situation that looks to be a race condition whereby we have a watch on
CustomResourceDefinitions
and when we see anadded
event for a new one, we perform a list on theapiVersion
+kind
. When this runs on a pod however we get a 404 when performing the list operation unless we add an arbitrary delay.The context behind this is that we use this as a check to make sure a kind exists before performing other actions, such as creating a watch. We do not expect any resources to be present immediately after adding a CRD.
What did you expect to happen?
We would expect that we would not see an added event for a custom resource before the API server is able to serve the resource.
How can we reproduce it (as minimally and precisely as possible)?
It's hard as it's a bit racey, this is only reproducible from a pod and even then, not always.
CustomResourceDefinitions
ADDED
event is seen it will perform a get for the kind e.g.GET: /apis/GROUP/VERSION/KIND
If the event is received fast enough, the handler will see a 404 for it's GET call.
Anything else we need to know?
We are running a single master, so there is only one
etcd
Kubernetes version
Cloud provider
OS version
No response
Install tools
No response
Container runtime (CRI) and version (if applicable)
No response
Related plugins (CNI, CSI, ...) and versions (if applicable)
No response
The text was updated successfully, but these errors were encountered: