-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should create operator CRs be done in operators #2304
Comments
FYI @gyliu513 |
Hi @clyang82, I'd recommend follow up the Getting Started and check the blog post. IHMO keep the CR's in the project make easier understand what is expected and as provide features to install/uninstall the operator as standalone via makefile targets. You can see it in the Memcached example. See here the example. Note that its default values are also used to generate the alm-example CSV annotation when the command Hi @joelanford @shawn-hurley, would like to provide any additional information here? |
@camilamacedo86 Thanks for your strongly support always. I will use OLM to manage the operators. Just want to know what is best practice for operator developing. What should be done in operator? Thanks for sharing your points. Should the operator create the corresponding CR in |
@clyang82 There are a few scenarios to consider.
The majority of operators do not need to create a CR for a CRD that they own. If you are able to expand on your use case, we might be able to give you more specific guidance. |
@joelanford Thanks for your great sharing. My case is that I want to create a meta operator to manage some operators. My current think is meta operator creates each CR for each managed operator. That is align with your first point. How to create each CR for each managed operator? It needs some inputs from the user. That is CR-based configuration from the user's input. Any comments? |
So @clyang82, It shows related to the "umbrella operator" ML. Have you been to discuss this topic there or this idea came up when you saw this discussion? Why you need a "meta operator"? Why the umbrella operator needs creates the CR for the others? Why you cannot have an Operator A, B and C where for example B and C are independent and work as standalone but they are required for Operator A works? Could not B and C lookup for the CR/CRDs of A in order to gather the information to create its resources and if not found then use the data in its own? |
Thanks @camilamacedo86 for your comments. I need to have an operator for operators. it can be called The question is still under discussion about Why the umbrella operator needs creates the CR for the others? One of the case in my mind is if my meta operator depends on the third-party operator which do not have ability to create CR by itself (That is less common). How and when to create the CR for this operator. |
Hi @clyang82,
You can use OLM Dependency Resolution and also you can indeed create another Operator which will manage all without OLM as well and can be distributed with too.
Are you asking about some specific project/operator? If yes, in this case, we are not able to speak and/or discuss the reasons and motivations which lead them to do their implementations. In this scenario, I'd suggest you contact who is responsible for them. Regards the framework possibilities Note that when we create an Operator and it's CR/CRD's via the command In this way, you are able to use this API in any other project as any third-party resource. So, you can manage resources, for example, from Operator A in Operator B or C. See here in the user guide how to use third-party API's. NOTES
Important: If you use any third-party API then, before adding the schema and use them is recommended to use the DiscoveryClient to check if the Resource exists in the cluster So, all will be up to the business requirements and how you would like to make it work. My personal POV I as dev personally, I'd choose to you follow up the Getting Started and solve all programmatically and dynamically instead of using the templates approach, and I'd prefer to keep the CR's in each project as well in order to make easier provide as Makefile targets to do a default install/uninstall and run them as standalone and to understand what is required/expected as etc. I think that have one operator which will manage others may make easier work with them locally since is not required have the OLM installed to check all integrated, however, if the go/need is just and only to install many operators locally and not manage them programmatically then it could be solved by using makefile targets, shell scripts to apply all operator's resources and etc. I'd just create an Operator X which will manage others if it could attend business requirements where has its own API and logic to manage the resources would make sense and bring advantages. However, if your motivation to have the "umbrella operator" is just to install them and not to manage them, so it could be solved by using a shell script, makefile, etc, and/or by using OLM Dependency Resolution as described above. But, I also I'd suggest before you take the decision check with the OLM maintainers and/or by doing a POC how its UI and workflow will be deeply in this scenario by using OLM Dependency Resolution and if it will attend your expectations as well. I think that we quite covered the question raised in this issue and indeed get out of its scope :-). So, please, let me know if we could close this one and then, if you have other questions, I'd recommend we keep one subject/closed questions per issue to allow us to address better your concerns. |
Hi @camilamacedo86, thanks for your elaboration and sharing your ideas and suggestions. That is enough for me to build an operator. Let me close this issue. Again, thanks for your support. |
Bug Report
What did you do?
I saw there are some operators are creating CR in operator while others do not create CR.
Create CR in operator
Not create CR in operator
What did you expect to see?
My Question is what is best practice to develop a new operator - create CR in operator or do not create CR in operator? benefit? Thanks.
The text was updated successfully, but these errors were encountered: