After an apiserver restart, LIST requests on CRD-backed resources return 404 (NotFound) for a brief window, even though:
- The CRD itself is visible via
kubectl get crd
api-resources shows the resource
- GET on a specific resource by name works
- Subsequent LIST requests succeed after a short delay
Reproduction:
- Create a CRD and an instance of it in a VCP
- Restart the apiserver (
rollout restart)
- Immediately LIST the CRD resources → 404
- GET by name → works
- LIST again after a few seconds → works
Impact: If a controller or client caches the 404 discovery response, the resource appears permanently missing until the cache expires. This caused issues in staging where project resources were invisible after apiserver restarts.
Likely cause: Race between CRD controller registering the API handler and the handler being ready to serve LIST requests. GET may use a different code path that bypasses this.
After an apiserver restart, LIST requests on CRD-backed resources return 404 (NotFound) for a brief window, even though:
kubectl get crdapi-resourcesshows the resourceReproduction:
rollout restart)Impact: If a controller or client caches the 404 discovery response, the resource appears permanently missing until the cache expires. This caused issues in staging where project resources were invisible after apiserver restarts.
Likely cause: Race between CRD controller registering the API handler and the handler being ready to serve LIST requests. GET may use a different code path that bypasses this.