Score:0

Custom CRDs not getting deleted in aks cluster, how to delete that?

uz flag

I have installed consul helm repository to default namespace. Now, want to change it to a custom namespace.

So, deleted the help chart using helm uninstall command. Now, when I try to install again, getting error as CRDs are already configured earlier, need to cleanup them.

So, ran the below command to check the CRDs.

kubectl get CustomResourceDefinition --all-namespaces
NAME                                     CREATED AT
healthstates.azmon.container.insights    2021-09-24T14:19:01Z
ingressgateways.consul.hashicorp.com     2021-09-26T13:17:13Z
servicedefaults.consul.hashicorp.com     2021-09-26T13:17:13Z
serviceintentions.consul.hashicorp.com   2021-09-26T13:17:13Z
servicerouters.consul.hashicorp.com      2021-09-26T13:17:13Z

The above CRDs, I need to cleanup all with consul as subtext.

So, I tried deleting one by one.But it got stuck there without deleting them when I ran any command below.

kubectl delete crd serviceintentions.consul.hashicorp.com
customresourcedefinition.apiextensions.k8s.io "serviceintentions.consul.hashicorp.com" deleted

I waited for 1 hour, but no response so entered ctrl+c to cancel and ran get command again, seems they are not deleted.

Please suggest how to fix this?

moonkotte avatar
in flag
How exactly did you install `consul` using `helm`? Which exact command did you use? When I installed `consul` from `hashicorp` via helm chart, there's no `crd`s at all.
Score:0
uz flag

Reference link

Can you please perform a kubectl get crd -A -o yaml | grep -i finalizers to check if the delete operation is in deadlock with finalizers set on the CRDs?

In that case, you can perform the following:

 kubectl patch crd <custome-resource-definition-name> -n <namespace> -p '{"metadata":{"finalizers":[]}}' --type=merge
 kubectl delete crd <custome-resource-definition-name> -n <namespace>

Above is the response I got in the MSDN forum. But that didn't work for me. So, I manually edited the CRD by using below command and deleted the finalizer section fromt he CRDs, then it got deleted directly.

kubectl edit crd <CRD-Name>

Thank you very much for your reply.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.