Skip to content

feat: remove Azure CSI driver resize workaround - #7297

Merged
mnencia merged 3 commits into
mainfrom
dev/remove-azure-workaround
Apr 9, 2025
Merged

mnencia merged 3 commits into
mainfrom
dev/remove-azure-workaround

Conversation

@armru

@armru armru commented Apr 7, 2025 •

Copy link
Copy Markdown
Member

This commit removes ENABLE_AZURE_PVC_UPDATES configuration and the related
status field.

The configuration is no longer needed for the operator to resize Azure volumes correctly. This change has been incorporated in the Azure CSI driver since version 1.11.0.

Closes #7296

Release notes

Support for `ENABLE_AZURE_PVC_UPDATES` configuration has been removed, as it is no longer needed for the operator to resize Azure volumes correctly. The fix is included in the Azure CSI driver since version [1.11.0](https://github.com/kubernetes-sigs/azuredisk-csi-driver/releases/tag/v1.11.0).

@armru armru added the do not backport This PR must not be backported - it will be in the next minor release label Apr 7, 2025
@armru
armru requested a review from jsilvela as a code owner April 7, 2025 12:36
@armru
armru requested a review from a team April 7, 2025 12:36
Comment thread api/v1/cluster_types.go Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is part of the status and not the specification, it should be safe to remove.

@armru

armru commented Apr 7, 2025

Copy link
Copy Markdown
Member Author

/test limit=local

@github-actions

github-actions Bot commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

@jsilvela

jsilvela commented Apr 7, 2025 •

Copy link
Copy Markdown
Contributor

There's a whole section of the documentation that we need to rethink.

### Expanding PVC volumes on AKS

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Apr 7, 2025
@nfaust-edb

Copy link
Copy Markdown

When triggering two operations (VM +disk update) at the same time, the operator asks the pod restart for VM upgrade to complete. Azure preserves both PVC conditions at the same time, while AWS & GCP removes the Resizing one when it adds the FileSystemResizePending. This will force the operator to wait and not recreate the pod on the new VM.

diff --git a/pkg/reconciler/persistentvolumeclaim/resources.go b/pkg/reconciler/persistentvolumeclaim/resources.go
index 1ca30256f..bcaaef34a 100644
--- a/pkg/reconciler/persistentvolumeclaim/resources.go
+++ b/pkg/reconciler/persistentvolumeclaim/resources.go
@@ -65,15 +65,21 @@ external:
        return true
 }

-// isResizing returns true if PersistentVolumeClaimResizing condition is present
+// isResizing returns true if PersistentVolumeClaimResizing condition is present and not PersistentVolumeClaimFileSystemResizePending
 func isResizing(pvc corev1.PersistentVolumeClaim) bool {
+       isResizing := false
+       isFileSystemResizePending := false
+
        for _, condition := range pvc.Status.Conditions {
                if condition.Type == corev1.PersistentVolumeClaimResizing {
-                       return true
+                       isResizing = true
+               }
+               if condition.Type == corev1.PersistentVolumeClaimFileSystemResizePending {
+                       isFileSystemResizePending = true
                }
        }

-       return false
+       return (isResizing && !isFileSystemResizePending)
 } 

@valeriodelsarto

Copy link
Copy Markdown
Contributor

I agree with @nfaust-edb , this PR is not only about removing support for a feature we don't need anymore due to Azure having improved (finally) the persistent volume expansions not requiring anymore a disk to be in a "detached" state from the node to progress, but also about fixing a corner case in which if both the disk and the node are changed at the same time, we end in a state in which the new pod is not getting created because of the PVC still having the Resizing condition set to true, and this only happens on Azure (not on AWS nor on GCP) of the 3 major CSPs.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 9, 2025
@mnencia
mnencia force-pushed the dev/remove-azure-workaround branch from 44e49d4 to 53d3be3 Compare April 9, 2025 09:06
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 9, 2025
@mnencia

mnencia commented Apr 9, 2025

Copy link
Copy Markdown
Member

@nfaust-edb @valeriodelsarto I see your point about the proposed change, but I believe it deserves its own issue and PR for easier tracking. Could you open a dedicated issue?

@mnencia
mnencia force-pushed the dev/remove-azure-workaround branch from 53d3be3 to b706ce3 Compare April 9, 2025 09:25
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 9, 2025
armru and others added 2 commits April 9, 2025 11:44
@mnencia
mnencia force-pushed the dev/remove-azure-workaround branch from b706ce3 to 57c5db5 Compare April 9, 2025 09:44
@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

2 similar comments
@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@mnencia mnencia changed the title feat: drop AzurePVCUpdateEnabled support feat: remove azuredisk CSI driver workaround Apr 9, 2025
@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@mnencia mnencia changed the title feat: remove azuredisk CSI driver workaround feat: remove Azure CSI driver workaround Apr 9, 2025
@mnencia mnencia changed the title feat: remove Azure CSI driver workaround feat: remove Azure CSI driver resize workaround Apr 9, 2025
@mnencia
mnencia merged commit a24dba3 into main Apr 9, 2025
@mnencia
mnencia deleted the dev/remove-azure-workaround branch April 9, 2025 10:20
@valeriodelsarto

Copy link
Copy Markdown
Contributor

Thanks @mnencia, @mbiagetti created one here #7324. I was hoping that this PR would have also fixed that issue, but needs to be confirmed by doing a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Remove ENABLE_AZURE_PVC_UPDATES configuration parameter

7 participants