kubernetes-sigs / node-feature-discovery

Node feature discovery for Kubernetes
Apache License 2.0
800 stars 245 forks source link

labels stay on nodes after I deleted the all plain NFD manifests #1896

Open jz543fm opened 1 month ago

jz543fm commented 1 month ago

I've tried to apply by doc NFD manifest with kubectl apply -k '<url>', but when I tried to use kubectl delete -k '<url>' for the removing deployment of NFD, labels that are generated with NFD deployments are deleted after kubectl delete -k '' , when I've downloaded plain manifests and I am tryning to deploy (I've get all manifests with the kubectl.... -o yaml option ), deploy works, adds labels but when I tried the kubectl delete -f it can not remove labels from nodes, but when I try to delete it with kubectl delete -k '<url>' that works and removes labels

jz543fm commented 1 month ago

It looks like the daemonset.apps/nfd-worker created should be deleted first, when I try to delete the all manifest with kubectl delete -f dir/ it deletes all manifests but labels stays, when I tried to delete the daemonset nfd-worker first, it deletes the labels

marquiz commented 1 month ago

Unfortunately there is not enough detailed control of (un)deployment of objects with kustomize.

If you want to cleanup the nodes, see https://kubernetes-sigs.github.io/node-feature-discovery/v0.16/deployment/uninstallation.html

Another solution is to manually delete the nfd-worker daemonset manually (like you did), wait for all nodes to be updated and then do kubectl delete -k that will remove the other stuff.