Pattern for creating a long running k8s custom resource using fabric8.io

Viewed 20

How to controller for a Custom Resource relating to an external resource which takes a while to create?

I'm working on a creating a custom resource for standing up a CockroachLabs cloud database cluster, an operation which is kicked off via an API and takes 5+ minutes to complete.

Using the fabric8.io java library we have the CR created and working properly w.r.t. kicking-in when a CR is created or deleted. But we have not yet figured out how to e.g. set a PENDING status on the CR and trigger a "re-try" where we can check the CockroachLabs API again to see if the DB cluster is ready or not to mark the CR status as successfully created.

We currently create a Watch from a MixedOperation for our CRD.

Any pointers to guides, docs or tutorials on how to achieve this will be greatly appreciated.

Thanks, Mike

0 Answers
Related