rancher: helm upgrade is broken - certmanager.version is needed but can't be parsed.
I tried to update today again on another system. But it seems to be broken by now. I upgraded to helm3 as well as the docs suggest.
When upgrading you will stumble first over this.
Error: UPGRADE FAILED: template: rancher/templates/issuer-letsEncrypt.yaml:3:45: executing "rancher/templates/issuer-letsEncrypt.yaml" at <.Values.certmanager.version>: nil pointer evaluating interface {}.version
Having a look here:
I added --set certmanager.version=“0.12” to the command, however this is not working…
Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: unable to recognize "": no matches for kind "Issuer" in version "certmanager.k8s.io/v1alpha1"
As you can see it always resolves to the old version prio 0.11 no matter what you enter… .
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (1 by maintainers)
Know this an old post but this might be a less hacky approach If anyone runs into this another solution that resolved it for us is using helm plugin mapkubeappis
helm plugin install https://github.com/helm/helm-mapkubeapis
create a map.yaml file with the troublesome api
then upgrade the api example:
helm mapkubeapis rancher --namespace cattle-system --mapfile map.yaml
Fix https://exploit.cz/rancher-upgrade-failed-cert-manager-io-v1beta1/
if you have certmanager.k8s.io/v1alpha1
replace cert-manager.io\/v1beta1 with certmanager.k8s.io\/v1alpha1 in step 3 in sed replace
Following up on my own post, I was able to resolve my upgrade issue (upgrading from Rancher 2.3 to 2.4 with Helm 3) by doing the following after getting the error:
I think this is essentially what @ebauman did. Step 1, download an old CRD with matching API:
wget -O crds.yaml https://github.com/jetstack/cert-manager/releases/download/v0.10.1/cert-manager.yaml
Step 2. Edit crds.yaml and remove all entries except the one that matcheskind: Issuer
Step 3. Apply the CRD:kubectl apply -f crds.yaml
At this point if you attempt to do the upgrade again with:
helm upgrade rancher rancher-latest/rancher --namespace cattle-system --set hostname=xxxx --set certmanager.version="0.15"
You may come across the following errors:To fix the above, edit the resource:
kubectl get edit ingress rancher -n cattle-system
and add the missing labels and annotations.To fix the above, edit the resource:
kubectl edit issuer.cert-manager.io/rancher -n cattle-system
and add the missing labels and annotations.Now attempt to upgrade again with Helm, and it should work.
You may then need to remove the old CRDs:
kubectl delete -f crds.yaml
In my case, I also had to edit the rancher ingress to use my letsencrypt production issuer.
I worked my way out of this, but it wasn’t pretty. First, to solve the missing CRD issue, I re-created the cert-manager CRDs using https://raw.githubusercontent.com/jetstack/cert-manager/v0.10.0/deploy/manifests/00-crds.yaml.
Then, I was faced with this error:
I attemped to set those values on the issuer in question (
issuer.cert-manager.io/rancher
) but they did help matters. I ended up removing that issuer, and re-running helm upgrade. This resulted in a successful upgrade.