Creating CR objects #1588
-
Hey! I am trying to create an operator that is quite simple, but I am have some questions. What I am trying to do is quite simple:
Insides foo's reconcile method, how do I apply a bar CR to my cluster? Could someone give me a quick demo on how to deploy a CR with the operator_sdk framework? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Take a look at: https://github.com/quarkiverse/quarkus-operator-sdk/tree/main/samples/joke. This sample operator does the same kind of thing you're trying to do: when a |
Beta Was this translation helpful? Give feedback.
Take a look at: https://github.com/quarkiverse/quarkus-operator-sdk/tree/main/samples/joke. This sample operator does the same kind of thing you're trying to do: when a
JokeRequest
CR is applied to the cluster, it queries an external joke API and uses the retrieved information to create aJoke
CR on the cluster. If you have a CRD for yourbar
CR, you could generate the Java code for it using Fabric8's client java code generator as well. Take a look at https://github.com/java-operator-sdk/java-operator-sdk/tree/main/sample-operators/leader-election which demonstrates this contract-first approach.