Refactor flux uninstall command
- deletes Flux components (deployments and services) - deletes Flux RBAC (service accounts, cluster roles and cluster role bindings) - removes the Kubernetes finalizers from Flux custom resources - deletes Flux custom resource definitions and custom resources - deletes the namespace where Flux was installed - preserves the Kubernetes objects and Helm releases that were reconciled on the cluster by Flux Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
@@ -608,11 +608,27 @@ kustomize build https://github.com/fluxcd/flux2/manifests/install?ref=main | kub
|
||||
|
||||
## Uninstall
|
||||
|
||||
You can uninstall the Flux components with:
|
||||
You can uninstall Flux with:
|
||||
|
||||
```sh
|
||||
flux uninstall --crds
|
||||
flux uninstall --namespace=flux-system
|
||||
```
|
||||
|
||||
The above command will delete the custom resources definitions, the
|
||||
controllers, and the namespace where they were installed.
|
||||
The above command performs the following operations:
|
||||
|
||||
- deletes Flux components (deployments and services)
|
||||
- deletes Flux RBAC (service accounts, cluster roles and cluster role bindings)
|
||||
- removes the Kubernetes finalizers from Flux custom resources
|
||||
- deletes Flux custom resource definitions and custom resources
|
||||
- deletes the namespace where Flux was installed
|
||||
|
||||
If you've installed Flux in a namespace that you wish to preserve, you
|
||||
can skip the namespace deletion with:
|
||||
|
||||
```sh
|
||||
flux uninstall --namespace=infra --keep-namespace
|
||||
```
|
||||
|
||||
!!! hint
|
||||
Note that the `uninstall` command will not remove any Kubernetes objects
|
||||
or Helm releases that were reconciled on the cluster by Flux.
|
||||
|
||||
Reference in New Issue
Block a user