cilium / cilium-cli

CLI to install, manage & troubleshoot Kubernetes clusters running Cilium
https://cilium.io
Apache License 2.0
417 stars 210 forks source link

uninstall may not cleanup old crd resources #711

Open ysicing opened 2 years ago

ysicing commented 2 years ago

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

root@kubeapi.internal-dev.ops.net:~$ kubectl get ciliumnodes
NAME                               AGE
kubeapi.internal-dev.ops.net   5h29m
aanm commented 2 years ago

@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.

ysicing commented 2 years ago

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

aanm commented 2 years ago

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?

ysicing commented 2 years ago

@aanm

 cilium uninstall
aanm commented 2 years ago

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.

ysicing commented 2 years ago

Ok,I'll try to submit a PR

ydp commented 1 year ago

Hi, is there anyone working on this?

cccsss01 commented 5 months ago

still seems to be a problem

github-actions[bot] commented 3 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.