Closed arundeepkurni closed 6 years ago
A finalizer is added to domain resources, which blocks the removal until all the kong API resources are wiped out. If the controller is having problems to wipe the resources (e.g.: usually problems on connecting to Kong API) you could check it out the events of Kubernetes:
kubectl get events -n <namespace-of-domain>
If nothing has showed up, you could check the logs from the controller.
If you want to remove the resource manually you could edit the domain and clean the finalizer:
(...)
metadata:
clusterName: ""
creationTimestamp: 2017-11-29T19:28:13Z
finalizers:
- kolihub.io/kong
(...)
Be aware that this may leave unwanted routes in Kong
editing domain didn't hep me, but editing CSD and commenting finalize stopped CSD and domains.
Trying to delete CSD (domains.platform.koli.io) and domains ("acme-org") by using below commands: kubectl delete domain acme-org --force kubectl delete customresourcedefinition domains.platform.koli.io --force
Some how, these are not deleting, kubectl describe csd domains.platform.koli.io gives below information,
$ kubectl describe customresourcedefinition domains.platform.koli.io Name: domains.platform.koli.io Namespace: Labels:
Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"name":"domains.platform.koli.io","namespac...
API Version: apiextensions.k8s.io/v1beta1
Kind: CustomResourceDefinition
Metadata:
Creation Timestamp: 2017-12-02T20:50:19Z
Deletion Grace Period Seconds: 0
Deletion Timestamp: 2017-12-03T17:10:37Z
Finalizers:
customresourcecleanup.apiextensions.k8s.io
Generation: 1
Resource Version: 225770
Self Link: /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/domains.platform.koli.io
UID: 689e052b-d7a2-11e7-9912-fa163ee34aab
Spec:
Group: platform.koli.io
Names:
Kind: Domain
List Kind: DomainList
Plural: domains
Singular: domain
Scope: Namespaced
Version: v1
Status:
Accepted Names:
Kind: Domain
List Kind: DomainList
Plural: domains
Singular: domain
Conditions:
Last Transition Time:
Message: no conflicts found
Reason: NoConflicts
Status: True
Type: NamesAccepted
Last Transition Time: 2017-12-02T20:50:19Z
Message: the initial names have been accepted
Reason: InitialNamesAccepted
Status: True
Type: Established
Last Transition Time:
Message: could not confirm zero CustomResources remaining: timed out waiting for the condition
Reason: InstanceDeletionCheck
Status: True
Type: Terminating
Events:
Am I doing anything wrong here, how to cleanup these CSD's ? any best practices?