kubesphere-sigs / ks

ks is a tool that makes it be easy to work with KubeSphere.
MIT License
22 stars 16 forks source link

Request to support component uninstallation feature #246

Open JohnNiang opened 2 years ago

JohnNiang commented 2 years ago

At present, official website has provided a document about how to uninstall each component.

But it's not very friendly for end users to execute so many command at the same time.

Therefore, I request to support component uninstallation in ks command. e.g.:

ks uninstall devops
ks uninstall logging
ks uninstall alerting
...

# Or uninstall all component but basic component
ks uninstall all

/kind feature

ks-ci-bot commented 2 years ago

@JohnNiang: The label(s) kind/feature cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/kubesphere-sigs/ks/issues/246): >At present, official website has provided a document about [how to uninstall each component](https://kubesphere.io/docs/pluggable-components/uninstall-pluggable-components/). > >But it's not very friendly for end users to execute so many command at the same time. > >Therefore, I request to support component uninstallation in `ks` command. e.g.: > >```bash >ks uninstall devops >ks uninstall logging >ks uninstall alerting >... > ># Or uninstall all component but basic component >ks uninstall all >``` >/kind feature Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
JohnNiang commented 2 years ago

/cc @kubesphere-sigs/sig-devops

LinuxSuRen commented 2 years ago

hi @JohnNiang , this is great. Currently, the command ks install xxx --components devops,logging be able to install KubeSphere (with Kubernetes). So, I prefer to uninstall a component with the following command:

ks uninstall --components xxx

mangoGoForward commented 2 years ago

I'd like to work on this issue. /assign

LinuxSuRen commented 2 years ago

hi @mangoGoForward thanks for helping on this issue. Before you get started, you can share your idea of the command usage.

JohnNiang commented 2 years ago

For DevOps uninstallation, @mangoGoForward could refer to https://github.com/kubesphere/website/issues/2155#issuecomment-982487406.

mangoGoForward commented 2 years ago

Thanks, the comment of kubesphere/website#2155 and the document of how to uninstall each component help me a lot. The operation of change the value of enabled from true to false in ks-installer of the CRD ClusterConfiguration seems to be reusable, but remove related resource with each component is different, could we use switch flow to process?

LinuxSuRen commented 2 years ago

We can define an interface for the component. Such as:

type component interface {
  install() error
  uninstall() error
  status()
  name()
}

then, provide the implements for the different components.

mangoGoForward commented 2 years ago

We can define an interface for the component. Such as:

type component interface {
  install() error
  uninstall() error
  status()
  name()
}

then, provide the implements for the different components.

Got it, thanks.