Deploy custom_resource_definition on k8s using API

8/13/2018

How can I deploy a CRD on K8s cluster without using kubectl create -f crd.yaml

-- Gopikrishna
kubernetes

1 Answer

8/13/2018

kubectl is simply a client to the api, so you can do so with any API client, like client libraries for different languages. My choice would be Go as that's kubes native language so it'll always be up to date with latest version.

First create new CRD object in memory, and then use native client with something like

client.ApiextensionsV1beta1().CustomResourceDefinitions().Create(crd)
-- Radek 'Goblin' Pieczonka
Source: StackOverflow