-
Notifications
You must be signed in to change notification settings - Fork 916
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
feat: add --purge-namespace flags for karmadactl deinit
, and default not delete namespace
#3326
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3326 +/- ##
==========================================
+ Coverage 49.13% 51.69% +2.56%
==========================================
Files 209 210 +1
Lines 18754 18931 +177
==========================================
+ Hits 9214 9787 +573
+ Misses 9039 8618 -421
- Partials 501 526 +25
Flags with carried forward coverage won't be shown. Click here to find out more. see 45 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. |
pkg/karmadactl/deinit/deinit.go
Outdated
@@ -81,6 +82,7 @@ func NewCmdDeInit(parentCommand string) *cobra.Command { | |||
flags.StringVar(&opts.Context, "context", "", "The name of the kubeconfig context to use") | |||
flags.BoolVar(&opts.DryRun, "dry-run", false, "Run the command in dry-run mode, without making any server requests.") | |||
flags.BoolVarP(&opts.Force, "force", "f", false, "Reset cluster without prompting for confirmation.") | |||
flags.BoolVar(&opts.IgnoreNamespace, "ignore-namespace", false, "Reset cluster without delete namespace.") |
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 flag name ignore-namespace
might be ambiguous, since deinit
is going to uninstall/remove components
from a cluster. ignore-namespace
can be misinterpreted as if the component in the namespace, then ignore(cancel the process)
. What do you think?
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.
This is indeed a question, what do you think of the flag name no-delete-namespace
?
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 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.
--preserve-resources ?
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.
For security and more intuitive, I think we could let users determine if remove the namespace. Like
deinit will not delete etcd data, if the etcd data is persistent, please delete it yourself.
the default persistence path for etcd data is '/var/lib/karmada-etcd'
Or we simply don't delete the namespace
A option
seems not to prevent mis-deleting for new users, because it is often missed. Based on this point, we shouldn't delete namespace by default.
What do you think?
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.
Mybe we can not delete namespace by default, and delete namespace by specify options --purge-namespace
?
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 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.
For security and more intuitive, I think we could let users determine if remove the namespace. Like
+1, istio does not delete istio-system
namespace when it is uninstalled by istioctl
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.
Mybe we can not delete namespace by default, and delete namespace by specify options --purge-namespace ?
I think it is ok.
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.
If there are other workloads in the namespace |
karmadactl deinit
karmadactl deinit
, and default not delete namespace
`karmada deinit` default not delete namespace Signed-off-by: xin.li <xin.li@daocloud.io>
/lgtm @lonelyCZ can you approve |
Thanks @my-git9 /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu, lonelyCZ The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
karmadactl deinit
will delete the namespace where karmda components are located.In some cases, this processing is too rough, which may delete other resources created by the user under the namespace (the user does not want to be cleaned up together), such as imagepullsecret, Qos settings, etc.
If the user is given the opportunity to choose whether to clean up the entire namespace, it will have a better experience.
Does this PR introduce a user-facing change?: