Kubernetes API for CustomResourceDefinition to perform CRUD methods

8/9/2018

How can I perform CRUD methods on CustomResourceDefinition

I've tried doing like below but it's not working

$ curl -s http://localhost:8080/api/v1/namespaces/test/CustomResourceDefinition

Error:

{  
   "kind":"Status",
   "apiVersion":"v1",
   "metadata":{  

   },
   "status":"Failure",
   "message":"the server could not find the requested resource",
   "reason":"NotFound",
   "details":{  

   },
   "code":404
}
-- Gopikrishna
kubernetes

1 Answer

8/9/2018

Try this one.

$ curl -s http://localhost:8080/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{crd-name}

If you have a CRD named database.eloquent.com, replace {crd-name} with database.eloquent.com

To get all CRDs,

$ curl -s http://localhost:8080/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions
-- Mir Shahriar Sabuj
Source: StackOverflow