cilium-cli icon indicating copy to clipboard operation
cilium-cli copied to clipboard

uninstall may not cleanup old crd resources

Open ysicing opened this issue 3 years ago • 8 comments

Bug report

General Information

~$ cilium version
cilium-cli: v0.10.2 compiled with go1.17.6 on linux/amd64
cilium image (default): v1.11.1
cilium image (stable): v1.11.1
cilium image (running): v1.11.1

~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:25:17Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1+k3s2", GitCommit:"a0cadcd3436745396c82821b4a0803ee460401e1", GitTreeState:"clean", BuildDate:"2022-01-14T08:22:21Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

uname -a
Linux kubeapi.internal-dev.ops.net 5.15.0-0.bpo.2-amd64 #1 SMP Debian 5.15.5-2~bpo11+1 (2022-01-02) x86_64 GNU/Linux

How to reproduce the issue

I adjusted the CRDR of pod and found that it could not be changed, then uninstalled it and found that it was the same, and finally found that it was caused by the CRD resource created the first time

[email protected]:~$ kubectl get ciliumnodes
NAME                               AGE
kubeapi.internal-dev.ops.net   5h29m

ysicing avatar Feb 10 '22 15:02 ysicing

@ysicing that's working as expected, the same away you can't change pod CIDR from Kubernetes nodes without manually deleting them, you can't change the pod CIDR from CiliumNodes without manually deleting them.

aanm avatar Feb 10 '22 15:02 aanm

Normally, I have uninstalled Cilium. Relevant CRD resources should also be cleaned up, not right? @aanm

ysicing avatar Feb 10 '22 15:02 ysicing

Normally, I have uninstalled Cilium. Relevant CRD resources should also be cleaned up, not right? @aanm

Not in this case since there's no way to distinguish between an upgrade and an uninstallation. How did you uninstalled Cilium?

aanm avatar Feb 10 '22 17:02 aanm

@aanm

 cilium uninstall

ysicing avatar Feb 11 '22 01:02 ysicing

Ok in that case I could see that cilium uninstall should have deleted all resources. Feel free to submit a PR that adds a flag cilium uninstall --all that removes all CRDs deployed in the cluster.

aanm avatar Feb 11 '22 01:02 aanm

Ok,I'll try to submit a PR

ysicing avatar Feb 11 '22 01:02 ysicing

Hi, is there anyone working on this?

ydp avatar Dec 15 '22 17:12 ydp

still seems to be a problem

cccsss01 avatar Apr 11 '24 23:04 cccsss01