aws-ebs-csi-driver icon indicating copy to clipboard operation
aws-ebs-csi-driver copied to clipboard

helm fsGroupPolicy patch fails with immutable field

Open bcha opened this issue 2 years ago • 3 comments

/kind bug

What happened?

Upgrading with helm..

-     helm.sh/chart: aws-ebs-csi-driver-2.10.1
-     app.kubernetes.io/version: "1.11.2"
+     helm.sh/chart: aws-ebs-csi-driver-2.11.0
+     app.kubernetes.io/version: "1.11.3"

...results in Error: UPGRADE FAILED: cannot patch "ebs.csi.aws.com" with kind CSIDriver: CSIDriver.storage.k8s.io "ebs.csi.aws.com" is invalid: spec.fsGroupPolicy: Invalid value: "File": field is immutable

What you expected to happen? Smooth upgrade.

How to reproduce it (as minimally and precisely as possible)? Upgrade from helm chart 2.10.1 to 2.11.0

Anything else we need to know?:

Environment

  • Kubernetes version (use kubectl version): 1.21
  • Driver version: 1.11.3

bcha avatar Sep 16 '22 08:09 bcha

Caused by https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/1377

z0rc avatar Sep 16 '22 11:09 z0rc

Hi all, sorry we didn't catch this!

Firstly, if you want to upgrade to helm chart 1.11.0, you can do so by pre-deleting the CSIDriver object, for example with kubectl delete csidriver ebs.csi.aws.com. This won't affect existing volumes, but it will prevent the driver from responding to future requests (similar to if the driver container had crashed), so follow it with an upgrade.

If you can't delete the CSIDriver object for any reason, I'm pushing an additional parameter useOldCSIDriver that can be set to true to use the old object. This will allow an upgrade from an old version without needing to recreate the CSIDriver object. You can track that change in #1391. That PR also adds a note to the helm chart changelog about this issue.

ConnorJC3 avatar Sep 16 '22 12:09 ConnorJC3

cc @olemarkus I know you were going to update the kops version of the addon soon, you'll either need custom logic to replace the CSIDriver or opt to use the old version on existing clusters.

ConnorJC3 avatar Sep 16 '22 12:09 ConnorJC3

If you run into this while upgrading please read @ConnorJC3's comment above and take a look at the Helm chart release notes, thanks.

torredil avatar Oct 17 '22 16:10 torredil