rancher: Rancher not compatible with cert-manager v1.6.0 / Removed API beeing used
Rancher Server Setup
- Rancher version: 2.6.2
- Installation option (Docker install/Helm Chart): Helm-Chart / RKE1
Information about the Cluster
- Cluster Type (Local/Downstream): Local
Describe the bug
To Reproduce
- Upgrade cert-manager to 1.6.0 (or install 1.6.0)
- Install or upgrade Rancher
Result
Error: UPGRADE FAILED: current release manifest contains removed kubernetes api(s) for this kubernetes version and it is therefore unable to build the kubernetes objects for performing the diff. error from kubernetes: unable to recognize "": no matches for kind "Issuer" in version "cert-manager.io/v1beta1"
Expected Result Rancher to be upgraded.
Additional context Rootcause is described here: https://github.com/jetstack/cert-manager/releases/tag/v1.6.0
Following their deprecation in version 1.5, the cert-manager APIVersions v1alpha2, v1alpha3, and v1beta1 are no longer served. This means if your deployment manifests contain any of these API versions, you will not be able to deploy them after upgrading.
Looks like Rancher still using the old API.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 13
- Comments: 35 (7 by maintainers)
Solved with helm-mapkubeapis and this config file (saved as
certmanager.map.yaml)After running it (please use
dry-runto ensure that output is that you want) I was able to upgrade rancher@all4innov Solution: https://exploit.cz/rancher-upgrade-failed-cert-manager-io-v1beta1/
Can confirm, cannot update from Rancher 2.6.0 to Rancher 2.6.3. Downgrading cert-manager to 1.5.3
worked for me with (
helm mapkubeapis --mapfile certmanager.map.yaml rancher -n cattle-system) upgrading 2.7.5 to 2.7.6Helm chart still use the correct apiVersion only as a last resort… (The release notes could be a lot simpler if #36611 is merged)
(And spamming everyone with notifications is necessary to keep the bot overlords happy)
Script updated to include pre-flight check, with a link to your comment in case of failure ! https://gist.github.com/AlexisDucastel/6b5e5cf79c0cd556056408934ff3029b
Thanks a lot @gbarceloPIB 😄
For Mac users, be careful, OSX sed (FreeBSD) is not compatible with GNU sed. I learnt this the hard way. You may rollback with command:
cat $TMP_FILE | kubectl -n cattle-system apply --force -f -Hi everyone, here is a simple gist with a script to help you patch your rancher release to fix cert-manager issue. https://gist.github.com/AlexisDucastel/6b5e5cf79c0cd556056408934ff3029b
It does automatically detect your rancher revision, backup the release secret in a temporary file and patch the secret if needed (so it is safe to start script multiple times).
@throrin19 you have to use correct sed replace. I added alternative sed replace to the article if you use older version than v1beta1
The 2.5.11 to 2.5.12 upgrade is also broken after upgrading cert-manager to 1.6.1 (and following their guide to update the stored versions to v1)
Downgrading cert-manager to v1.5.5 seems to fix that…
(The v1 APIs have been present since cert-manager 1.0 AFAIK) (none of our own stuff ever used them, after going from the alpha APIs on 0.9.1 to v1 on ~1.2) (Rancher seems to have used the intermediate versions with the beta APIs without updating that)
The same problem. Rancher 2.6 doesn’t start with cert-manager 1.6.1. I rolled back to 1.5.0.
Still an issue - the older cert-manager versions are getting scarce though…
Same issue still there… Chart still prefers the older APIs…
@insekticid This solution helped me. Thanks a lot! My last sh.helm.release.v1.rancher.v* was v10 😃
(a bit off-topic) I have all of them. But Catalina’s sed dates back from 2005’s OpenBSD! (no sed -r, out of the box at least). You may check if you do:
sed --versionIf you have output, you may have GNU sed, otherwise check man version:Just a side note:
I have done a fresh install of Cert Manager 1.6.0 + Rancher 2.6.2 and it worked without errors.
From the Cert Manager note I understand that you can not upgrade, since by default you have the alphas and betas deployed and 1.6.0 uses v1.
For Cert Manager 1.5.x + Rancher 2.6.0 I had to modify the Rancher template files manually to contain v1 instead of the v1beta1. Otherwise the Rancher deployment/installation failed.