COnsul is not cleaning up

We deleted consul namespace but the CRDs exists still.

Similarly we deleted application namespace, but CRDs resources linked all still exists and not getting deleted.


C:\Users\UReddy>kubectl get crds -n consul
NAME                                             CREATED AT
healthstates.azmon.container.insights            2022-04-01T10:11:46Z
ingressgateways.consul.hashicorp.com             2021-12-29T08:11:43Z
meshes.consul.hashicorp.com                      2021-12-29T08:11:43Z
prometheusrules.monitoring.coreos.com            2022-03-24T12:22:17Z
proxydefaults.consul.hashicorp.com               2021-12-29T08:11:43Z
servicedefaults.consul.hashicorp.com             2021-12-29T08:11:43Z
serviceintentions.consul.hashicorp.com           2021-12-29T08:11:43Z
servicemonitors.monitoring.coreos.com            2022-03-24T12:22:18Z
servicerouters.consul.hashicorp.com              2021-12-29T08:11:43Z
volumesnapshotclasses.snapshot.storage.k8s.io    2022-04-01T10:11:46Z
volumesnapshotcontents.snapshot.storage.k8s.io   2022-04-01T10:11:46Z
volumesnapshots.snapshot.storage.k8s.io          2022-04-01T10:11:46Z

Individual resources also stuck at deletion.


C:\Users\UReddy>kubectl delete -n martserver serviceintentions frontend
serviceintentions.consul.hashicorp.com "frontend" deleted
C:\Users\UReddy>kubectl delete -n martserver serviceintentions vaultservice
serviceintentions.consul.hashicorp.com "vaultservice" deleted

But not getting deleted as it stuck there.

Hi @ukreddy-erwin,

Just to clarify, I have a couple of questions so we can best help you.

  1. Is there a reason you are cleaning up via deleting namespaces rather than doing a helm delete or helm uninstall?

  2. Which namespace did you delete? You are showing CRDs from the consul namespace, but running delete commands for the martserver namespace. Have you run the delete crd commands on the consul namespace?

THanks for the reply.

For question 1, I did helm uninstall but these are not cleaned up, so did delete the namespace consul. But, the application specific namespace is having these CRDs related resources visible along with consul namespace.

See the output carefully below.

image
No namespace related to consul or martserver.

But, see the below output.
image

And below output.

image

with get ns martserver and consul namespaces are not showing but with get crds it is showing.

Also, look below few outputs, which resources are not getting deleted also.

image

The delete CRDs is not deleting them, nor the resources as they stuck in deletion page like below.
image

Same with other resources also

Let me know how to cleanup atleast.

ok, CRDs are non-namespaced, so when you run kubectl get crd -n martserver, I don’t think the -n flag actual does anything. It looks like you are deleting the objects. I am not sure why they would stick around or get stuck. Have you tried deleting the CRDs themselves and not the objects? Namely running
kubectl delete crd ingressgateways.consul.hashicorp
kubectl delete crd meshes.consul.hashicorp

…etc going through the list from kubectl get crd | grep hashicorp

they also got stuck like this