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

Uday Kiran Reddy (ureddy) 96 Reputation points
2021-10-25T08:05:28.787+00:00

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?

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,456 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Uday Kiran Reddy (ureddy) 96 Reputation points
    2021-10-25T09:16:04.867+00:00

    Applying the patch command didn't work.
    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.
    Also, can you suggest, how to rename a cluster in azure kubernetes, either through portal or any API Command, whichever is possible

    2 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.