-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Removal of old apiVersions in CRDs #11894
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
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
priority/important-soon
Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Comments
cc @fabriziopandini @chrischdi @enxebre @vincepri @JoelSpeed (I'll bring it up on Wednesday in the office hours) |
Thanks for doing the hard work on this issue, +1 for me |
Also +1 from my side. |
This was referenced Mar 3, 2025
I created issues for v1alpha3 / v1alpha4 / v1beta1 removal and updated the task list. I think we can keep this issue closed. Thx everyone for the quick reviews! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
priority/important-soon
Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Problem statement
As we evolve our CRDs over time we regularly bump our apiVersions. While we have an established process to add new apiVersions in Cluster API, removal of apiVersions is still problematic.
Before we can remove an apiVersion from a CRD we have to go through the following steps:
1. Ensure all custom resources can still be read from etcd after the apiVersion is removed ("Storage version migration")
This is typically done by writing all custom resources with the current storage version. More information can be found in Versions in CRDs.
In Cluster API today, this is only implemented as part of the
clusterctl upgrade
command. If clusterctl is not used, folks have to write their own full custom implementation or build on top of the builtin storage migration (alpha since v1.30).Note: Storage version migration should be run as soon as a new apiVersion becomes storage version to minimize conversion webhook calls.
2. Remove the old apiVersion from managedFields of all custom resources ("ManagedField cleanup")
Kubernetes stores field ownership information by apiVersion in managedFields. Unfortunately, there is no builtin logic that removes managedFields of an apiVersion when that apiVersion is removed from the CRD. If there are still managedFields with a removed apiVersion any subsequent apply requests will fail:
request to convert CR to an invalid group/version
errors (see SSA failure after removal of old API versions #10051 & managedField entry for a removed API version prevent further resource updates kubernetes/kubernetes#111937)SHOULD NOT HAPPEN failed to update managedFields
Note: managedField cleanup should be run as soon as an apiVersion is not served anymore to minimize conversion webhook calls. As long as an apiVersion is still served, users can still apply with this apiVersion and then the corresponding managedFields are needed to properly execute the apply.
Why is this important now
Expand for more details
For the following reasons we want to remove old apiVersions as soon as possible:
Maintenance effort
We have to keep the Go types of the old apiVersions around. We also have to adjust the conversion implementation whenever we add a new field to our current API.
Increased resource usage through conversion requests
As long as the old apiVersions are part of our CRDs we will get a significant number of requests on the conversion webhooks:
Implementation
A few notes:
Idea:
For more implementation details, see: #11889
Removal of v1alpha3 & v1alpha4 and v1beta1 apiVersions
Context:
v1alpha3 & v1alpha4
Notes:
v1beta1
Notes:
Tasks:
The text was updated successfully, but these errors were encountered: