Related discussion
https://github.com/longhorn/longhorn/discussions/4198
Context: since few customers used our broken chart longhorn 100.2.1+up1.3.1 on Rancher (Now fixed) with the workaround. We would like to verify the future upgrade path for those customers.
Steps
- Set up a cluster of Kubernetes 1.20.
- Adding this repo to the apps section in new rancher UI
- repo: https://github.com/PhanLe1010/charts.git
- branch: release-v2.6-longhorn-1.3.1.
- Access old rancher UI by navigating to
<your-rancher-url>/g
. - Install Longhorn 1.0.2.
- Create/attach some volumes. Create a few recurring snapshot/backup job that run every minutes.
- Upgrade Longhorn to v1.2.4.
- Migrate Longhorn to new chart in new rancher UI https://longhorn.io/kb/how-to-migrate-longhorn-chart-installed-in-old-rancher-ui-to-the-chart-in-new-rancher-ui/.
- Upgrade to longhorn 100.2.1+up1.3.1 in the UI.
- Verify the upgrade would be stuck at with error:
Patch CustomResourceDefinition "volumes.longhorn.io" in namespace error updating the resource "volumes.longhorn.io": cannot patch "volumes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "volumes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true Error: UPGRADE FAILED: cannot patch "engineimages.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "engineimages.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "nodes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "nodes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true && cannot patch "volumes.longhorn.io" with kind CustomResourceDefinition: CustomResourceDefinition.apiextensions.k8s.io "volumes.longhorn.io" is invalid: spec.conversion.strategy: Invalid value: "Webhook": must be None if spec.preserveUnknownFields is true
- Apply the workaround
- Retry upgrade to longhorn 100.2.1+up1.3.1 in the UI.
- Verify the upgrade is ok.
- Verify that the user can successfully upgrade to future chart releases (e.g., Longhorn v1.3.2) from this version longhorn 100.2.1+up1.3.1.