Skip to content
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

Restart XR and claim controllers when XRDs are updated #288

Closed
muvaf opened this issue Nov 7, 2022 · 3 comments
Closed

Restart XR and claim controllers when XRDs are updated #288

muvaf opened this issue Nov 7, 2022 · 3 comments
Assignees
Labels

Comments

@muvaf
Copy link
Member

muvaf commented Nov 7, 2022

What problem are you facing?

I might be the only one who knows about this since I did the initial implementation so we need to document it. The reason is that we spin up a new controller for every CRD we produce but those controllers work on the cached schema, so the schema cache needs to be refreshed and that doesn't happen unless you restart the pod (the last I checked).

How could Crossplane help solve your problem?

Add this to composition reference doc.

@muvaf muvaf added the enhancement New feature or request label Nov 7, 2022
@jbw976
Copy link
Member

jbw976 commented Nov 8, 2022

@muvaf is there not a programmatic way to invalidate the cache, or perform a new discovery or something? If folks have to manually restart the crossplane pod when making an update to a XRD then lots of people are going to get bit by then, even if it is documented 😇

@negz
Copy link
Member

negz commented Dec 2, 2022

I believe deleting and recreating the XRD will work too.

I could imagine it's possible for us to notice when the XRD has changed and restart the controller. For example we could update controller.Start to take a "configuration id" argument as well as the unique name of the controller. Today if you try to start a controller that is already started it's a no-op. We could update that such that starting a controller with the same configuration would be a no-op, but starting a controller with a new configuration would cause it to be restarted. We could just use a hash of the XRD spec as the configuration id.

https://github.com/crossplane/crossplane/blob/423fc6/internal/controller/apiextensions/definition/reconciler.go#L458
https://github.com/crossplane/crossplane-runtime/blob/65044f0/pkg/controller/engine.go#L167

@negz negz changed the title Document the fact that XRD updates require Crossplane restart Restart XR and claim controllers when XRDs are updated Dec 2, 2022
@jbw976 jbw976 transferred this issue from crossplane/crossplane Jan 15, 2023
@plumbis
Copy link
Collaborator

plumbis commented Jul 26, 2023

Fixed in #475

@plumbis plumbis closed this as completed Jul 26, 2023
@plumbis plumbis self-assigned this Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants