How to list applied Custom Resource Definitions in kubernetes with kubectl

10/22/2019

I recently applied this CRD file

https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml

With kubectl apply to install this: https://hub.helm.sh/charts/jetstack/cert-manager

I think I managed to apply it successfully:

xetra11@x11-work configuration]$ kubectl apply -f ./helm-charts/certificates/00-crds.yaml --validate=false
customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created

But now I would like to "see" what I just applied here. I have no idea how to list those definitions or for example remove them if I think they will screw up my cluster somehow.

I was not able to find any information to that here: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#preparing-to-install-a-custom-resource

-- xetra11
kubernetes
kubernetes-custom-resources

1 Answer

10/22/2019

kubectl get customresourcedefinitions, or kubectl get crd.

You can then use kubectl describe crd <crd_name> to get a description of the CRD. And of course kubectl get crd <crd_name> -o yaml to get the complete definition of the CRD.

To remove you can use kubectl delete crd <crd_name>.

-- t3ng1l
Source: StackOverflow