New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: treat cluster as not existing if it is allowed to uninstall with volumes #10231
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple issues with this approach if the policy is set to
allowUninstallWithVolumes: false
:So I think we need a different approach in the finalizer for each controller that is concerned about volumes existing. For example, in the pool controller it should block the removal of a pool if there are existing rbd images in that pool. Or in the file controller the removal should be blocked if there are subvolumes in that filesystem, unless
allowUninstallWithVolumes: true
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Also, I am changing how some of this works with #9915, and I will have a follow-up for block pools. Travis and I talked about removing the
allowUninstallWithVolumes
entirely since it will no longer make sense with the dependency scheme.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsReadyToReconcile()
check comes before the dependent check that's being added at #9915 .We should really not be deleting blockpool, cephfs and cephnfs CR without checking for images, subvolumes and exports respectively. This is especially because we have external k8s objects tied to these ceph objects.
I propose we add another bool for
IsReadyToReconcile()
which will still return the cluster when cleanup policy is set and cluster is marked for deletion for the above said CRs.@BlaineEXE @travisn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
allowUninstallWithVolumes
check is currently buggy, and I think it needs to be removed. The user can already remove CephBlockPool and CephFilesystem without checking volumes, which #9915 seeks to fix. The CephCluster will block on deletion until all CephBlockPools and CephFilesystems are deleted. This creates a problem where the only volume checking is done in the CephCluster, which is forced to be the last to be deleted. Thus, theallowUninstallWithVolumes
setting no longer effectively blocks deletion, and we plan to just remove it once #9915 and the follow-up for RBD are finished.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, the check you are adding will never be reached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rakshith-R From Rook's behavior, this is by design. I don't see what Rook should change. To summarize the uninstall scenarios:
So if the non-forced uninstall is desired, the CephCluster CR must be deleted last.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@umangachapagain @Rakshith-R is this the behavior in ocs-operator today for clean uninstall?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCS follows Rook implementation. CephCluster is deleted in the end and cleanup policy is used for other decision making.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that behaviour was changed here red-hat-storage/ocs-operator#1563
This pr together with #9041 caused the issue.
cc @umangachapagain @Madhu-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the point the OCS operator sets the cleanup policy to destroy the cluster, it must be ok with the destruction of the cluster. If it was not intended to force deletion, sounds like red-hat-storage/ocs-operator#1563 needs to be revisited.