-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Clusterctl upgrade fails due to cert-manager CRDs #6674
Comments
Hey, I was not able to reproduce the issue and was able to upgrade cert-manager successfully from v1.5.3 to v1.7.2 via clusterctl: $ clusterctl-v1.1.4 upgrade apply --contract v1beta1
Checking cert-manager version...
Deleting cert-manager Version="v1.5.3"
Installing cert-manager Version="v1.7.2"
Waiting for cert-manager to be available...
Performing upgrade... could you please provide some more information?
|
The k8s version is 1.21.11, capi is now current (as clusterctl 1.1.3 still works)
and cert-manager is clusterctl managed |
I think this is unrelated to "skipping cert-manager v1.6".
The root cause for me seems to be that there are still resources stored in the old These stored versions were deprecated already in cert-manager v1.4. They also provide a guide how to migrate: https://cert-manager.io/docs/installation/upgrading/remove-deprecated-apis/#upgrading-existing-cert-manager-resources Could you try to go through this guide and retry the upgrade using clusterctl I think this may happen to more users of cluster-api, especially ones which migrated over from older versions (including older cert-managers). Because of that we may have to at least add some more information to our docs. |
did the trick, and yeah, i guess a lot of people will run into that, if they have old mgmt clusters and upgrade to 1.1.4 or later |
Interesting issue. Some observations:
@MaxRink from which version did you upgrade? I would assume for v0.3 => (v0.4 | v1.0.x) => v1.1.x it should be fine as I would expect old CertificateRequests to be deleted when we re-create the Certificates during clusterctl upgrade. For v0.3=>v1.1.x I would expect this to be always an issue, but somehow our e2e test v0.3=>v1.1 works:
|
Our tests use cert-manager verison v1.1.0 -> v1.7.2 in this test and the storageVersion in cert-manager crds for v1.1.0 was already Because of that there is never a resource created having storageVersion < I assume as soon as the cluster did use cert-manager version < 1.1 , the storageVersion contains an entry for an old version (at latest v1beta1, because v1.1 introduced the v1 CRDs and did set a storageVersion the first time). I would propose to add a warning at the end of https://cluster-api.sigs.k8s.io/clusterctl/commands/upgrade.html at least for cert-manager including a link to the upstream docs for the workaround? |
@sbueringer The mgmt cluster has been around since capi alpha3, got upgraded to alpha4 and now beta1. |
Yup. It's just that clusterctl upgrade deletes/creates all Certificates during an upgrade.
I think that makes sense, even if we don't 100% know in which cases this issue occurs / doesn't occur. |
Issue should be reproducible for cluster-api users which started using CAPI <= v0.3.14 and are now upgrading to v1.1.4 (using clusterctl CAPI To be verified via https://github.com/kubernetes-sigs/cluster-api/pull/6699/files |
/assign |
We implemented a CRD migration in #6749. It works but there are some exceptions. The logic is:
This works, but there is the fundamental limitation that a storage version cannot be immediately dropped. A version overview: 1. cert-manager v0.11.0: v1alpha2 (storage)ClusterAPI v0.3.4 - v0.3.8 => cert-manager v0.11.0 2. cert-manager v0.16.1: v1alpha2 (storage), v1alpha3, v1beta1ClusterAPI v0.3.9 - v0.3.14 => cert-manager v0.16.1 3. cert-manager v1.0.0 => v1.6.x: v1alpha2, v1alpha3, v1beta1, v1 (storage)ClusterAPI v0.3.15 - => cert-manager v1.1.0 4. cert-manager >= v1.7.0 v1 (storage)ClusterAPI v1.1.4 => cert-manager v1.7.2 The limitation above means:
|
What steps did you take and what happened:
When trying to upgrade our clusters to the latest capi version ( 1.1.4 ) we noticed that the upgrade fails
After closer inspection that seems to be an issue caused by #6432 , as v1.6 got skipped.
1.6 marked alpha2 as not served, so only after applying 1.6 crds the upgrade to 1.7 is possible
cert-manager/cert-manager@c6896b2
What did you expect to happen:
Clusterctl correctly upgrades cert-manager
Environment:
kubectl version
):/etc/os-release
):/kind bug
The text was updated successfully, but these errors were encountered: