Skip to content

Creating CR objects #1588

Answered by metacosm
TheCodeAddiction asked this question in Q&A
Discussion options

You must be logged in to vote

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 a Joke CR on the cluster. If you have a CRD for your bar 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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TheCodeAddiction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants