-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add --uninstall
and --preserve-uninstall-namespace
option to velero install
#6155
base: main
Are you sure you want to change the base?
Conversation
4a296e5
to
797a4c6
Compare
Codecov Report
@@ Coverage Diff @@
## main #6155 +/- ##
==========================================
- Coverage 41.28% 41.05% -0.24%
==========================================
Files 251 252 +1
Lines 23399 23724 +325
==========================================
+ Hits 9661 9740 +79
- Misses 12979 13210 +231
- Partials 759 774 +15
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
51805e5
to
cad7e8e
Compare
--uninstall
and --preserve-uninstall-namespace
option to velero install
…ero install` Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai
The implementation for 1 is clear.
Comparing to 1, 2 is more useful because along with the evolution of Velero, objects may be quite complex and their lifecycle may be better to match the cluster instead of Velero installation, i.e., the schedules and polices. Therefore, would you like to create a design doc to cover both 1 and 2 and make an overall advanced uninstallation feature? For 1, personally I would rather regard it as a corner case -- someone has installed Velero into an existing namespace, though the consequence of uninstallation in this case is severe. Once we have the design doc, we can discuss this further. |
Sure thing. Design doc for 1 and 2. For 2. I think we only have to deal with it at reinstall time so we can check for outdated velero resources if namespace exist already. Tho I'm not sure if 2 is possible because 1 deletes CRD right now. Maybe I need to add 1 more flag, |
Things may be more complicated:
Yes, for some CRs, if we want to preserve it, the CRD will also be required. However, from users perspective, they don't case about CRDs, they only care whether their defined data along with the CRs have been preserved or not. For sure, we need to design this from users perspective. |
@@ -118,6 +120,8 @@ func (o *InstallOptions) BindFlags(flags *pflag.FlagSet) { | |||
flags.StringVar(&o.Features, "features", o.Features, "Comma separated list of Velero feature flags to be set on the Velero deployment and the node-agent daemonset, if node-agent is enabled") | |||
flags.BoolVar(&o.DefaultVolumesToFsBackup, "default-volumes-to-fs-backup", o.DefaultVolumesToFsBackup, "Bool flag to configure Velero server to use pod volume file system backup by default for all volumes on all backups. Optional.") | |||
flags.StringVar(&o.UploaderType, "uploader-type", o.UploaderType, fmt.Sprintf("The type of uploader to transfer the data of pod volumes, the supported values are '%s', '%s'", uploader.ResticType, uploader.KopiaType)) | |||
flags.BoolVar(&o.Uninstall, "uninstall", o.Uninstall, "Uninstall Velero from the cluster. Optional.") |
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.
Why do we add a --uninstall
flag under velero install
instead of under velero uninstall
?
It is hard to understand if the command is like "velero install --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.
Because uninstall command do not have the install options.
If we want this functionality in uninstall cmd then the installOptions fields will have to be included with uninstall cmd.
This makes it clear that it'll only work if you know how you installed it.
Perhaps even lookup your bash history and just add --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.
Because uninstall command do not have the install options
I thinks this is a problem of the code organization, we have multiple ways to solve it. i.e., Add a new UninstallOption struct.
This makes it clear that it'll only work if you know how you installed it.
Maybe, but this will confuse others who don't know the details.
Anyway, as mentioned about, I think even the flag --preserve-uninstall-namespace
is unnecessary if we want to fix requirement 1 only.
Todo
If you remember the options you used to install, this PR allows you to use the same options with the addition of
--uninstall
and--preserve-uninstall-namespace
to undo the install.We are explicitly not calling delete on anything created outside install command, that includes BSL/VSL created outside install command defaults. Depending on feedback, this can be added via another flag.
In addition, the normal uninstall command prompt message is now more informative
Does your change fix a particular issue?
Fixes #5433
Please indicate you've done the following:
/kind changelog-not-required
as a comment on this pull request.site/content/docs/main
.