k8s-controller-custom-resource icon indicating copy to clipboard operation
k8s-controller-custom-resource copied to clipboard

Question regarding custom resource controller

Open 0xsubi opened this issue 5 years ago • 1 comments

@trstringer Is it possible to create a custom resource controller based off of a separate API? For example, let's say I want to have an object similar to replicaset in that I want to have 3 instances of my application up and running in a GCP VM? Is it possible to create a custom resource and controller that gets the state from GCP APIs (in this case) but leverages custom controller to provide a declarative state.

0xsubi avatar May 29 '20 07:05 0xsubi

@sudhabindu1 I think it is doable though not straight forward. In your GCP VM case, you can use k8s(etcd) as the datastore to store the VM info, and use the CRD controller calling GCP API to manage the lifecycle of the VM. The tricky part I think is how to update the controller if there is any status update of the VM from the GCP side.

You can take a look at the KubeVirt project as it related to your though.

Cheers

jianz avatar Jul 09 '20 14:07 jianz