CRD not being deleted even though the namespace is deleted

5/21/2019

I have the attached CRD in some namespaces. My issue is that the CRD persists even though the namespace in which it lives is deleted!

> oc project
error: the project "uhc-development-15o4llu96oe7rftq8nms5t99djl3cnmh" specified in your config does not exist.

Please note there are no finelizers on the CRD:

> oc get accountclaim managed-test2005 -o yaml
apiVersion: aws.managed.openshift.io/v1alpha1
kind: AccountClaim
metadata:
  creationTimestamp: 2019-05-20T12:38:35Z
  generation: 1
  labels:
    api.openshift.com/id: 15o4llu96oe7rftq8nms5t99djl3cnmh
    api.openshift.com/name: managed-test2005
  name: managed-test2005
  namespace: uhc-development-15o4llu96oe7rftq8nms5t99djl3cnmh
  resourceVersion: "13051561"
  selfLink: /apis/aws.managed.openshift.io/v1alpha1/namespaces/uhc-development-15o4llu96oe7rftq8nms5t99djl3cnmh/accountclaims/managed-test2005
  uid: 2f719fc0-7afc-11e9-964f-001a4a162604
spec:
  accountLink: ""
  aws:
    regions:
    - name: us-east-1
  awsCredentialSecret:
    name: aws
    namespace: uhc-development-15o4llu96oe7rftq8nms5t99djl3cnmh
  legalEntity:
    id: 0
    name: 
status:
  conditions:
  - lastProbeTime: 2019-05-20T12:38:35Z
    lastTransitionTime: 2019-05-20T12:38:35Z
    message: Attempting to claim account
    reason: AccountClaimed
    status: "True"
    type: Unclaimed
  state: Ready

Has anyone encountered this issue before? Any help will be much appreciated.

-- Nimrodshn
kubernetes
kubernetes-custom-resources
namespaces

2 Answers

5/21/2019

What is the scope of your CRD? Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced, but if you defined it at cluster scope then what you're describing makes sense.

-- antweiss
Source: StackOverflow

9/10/2019

Shot in the dark... If you're able to get at the CRD itself - then it may have some finalisers against it which stop it getting deleted. If you edit the crd and remove those finalisers you may find the CRD will get deleted.

-- welshstew
Source: StackOverflow