-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix defaults for node_selector and tolerations #205
fix defaults for node_selector and tolerations #205
Conversation
@dmarav early on, in the awx-operator, we naively used a string value for this and documented specifying the values like this: Which should also work for the eda-server-operator. We plan to cut a new apiVersion for the awx-operator with improvements like these in the coming year. I think it we change it now without backwards compat, it may break users who have been defining it as a string on the CR spec... I think we should probably leave this PR open until we do the new apiVersion for both AWX and EDA... cc @TheRealHaoLiu @rcarrillocruz re: new apiVersion |
Hi @rooftopcellist! Thanks for the quick response!
This was my first approach, to set the tolerations and node_selector as string, since that's how it was defined in the awx-operator, but in the CRD node_selector is defined as a
It doesn't because the CRD expects one type, and the defaults set in the roles is With this manifest:
I get this response from kubernetes
|
@dmarav you are absolutely right. The CRD schema expects object/dict for these settings, which does not line up with how that string is later templated into the deployment yaml. I agree with your approach here and believe that we should standardize all of the ansible related operator around having node_selector etc. be a dict rather than a string (which necessitated the confusing I plan to test this out this week and get it merged. For awx-operator, we'll need to wait until we cut a new apiVersion, which is something we are planning to tackle in the coming months. Thanks for the contribution! |
It would be great to have some docs for how to use these in this repo, particularly because it will be different from the awx-operator for a time. Help appreciated there, but I won't let that block this PR from merging. |
Hi @rooftopcellist! Should I create a separate PR for updating the docs and link to this one, or just update the docs in this one? |
@dmarav I just merged, sorry for the delay. If you can open a separate PR for docs on how to use this, that would be wonderful! |
@rooftopcellist I just created PR #214 with the documentation. I copied the same format/structure as in the AWX operator. |
When setting
node_selector
andtolerations
values for all deployments/staefulsets, the playbook in the operator fails with the following error:The CRD defines the tolerations as an array, and the node_selector as an object.
The defaults for the roles are empty strings, so when trying to combine the
<component>
and_<component>
dictionaries to render the final configuration, a string is added to an array/dict and I get the aforementioned error.It can be reproduced with this manifest using operator version 1.02: