Closed ahjing99 closed 1 year ago
After a second time uninstall, kb can be installed now
➜ kbcli git:(test_kb) ✗ kbcli kubeblocks uninstall
Warning: uninstall will remove all KubeBlocks resources.
Please type "uninstall-kubeblocks" to confirm: uninstall-kubeblocks
Warning: failed to locate KubeBlocks meta, will clean up all KubeBlocks resources.
to find out the namespace where KubeBlocks is installed, please use:
'kbcli kubeblocks status'
to uninstall KubeBlocks completely, please use:
`kbcli kubeblocks uninstall -n <namespace>`
Uninstall KubeBlocks addons OK
Uninstall helm release kubeblocks OK
Remove helm repo kubeblocks OK
Remove built-in custom resources OK
Remove configmaps OK
Uninstall KubeBlocks done.
I reproduce this bug, and found it caused by this code https://github.com/apecloud/kubeblocks/blob/d2d701e37c0f82d6710223fc27cada46eb10a996/internal/cli/cmd/kubeblocks/uninstall.go#L171-L177
If kubeblocks existed, the o.namespace
is "kb-system", kbcli kubeblocks uninstall
only remove the resource in kb-system namespace. (I add a log to show the namespace that will be remove custom resources)
After a second time uninstall, kb can be installed now. Because if kubeblocks don't existed, the o.namespace
is "", kbcli kubeblocks uninstall
remove the resource in all namespace.
kbcli install
or uninstall
KubeBlocks SHOULD NOT touch the helm release manually installed by the user. We should use the specified label to filer these resources.
➜ ~ kbcli version Kubernetes: v1.25.6-gke.1000 kbcli: 0.5.0-beta.0
error: there are resources left by previous KubeBlocks version, try to run "kbcli kubeblocks uninstall" to clean up configmaps: mongodb-metrics-config,mongodb-scripts,mongodb5.0-config-template