Skip to content
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

Add containerinfra nodegroup support #1364

Merged

Conversation

MrFreezeex
Copy link
Contributor

@MrFreezeex MrFreezeex commented Apr 7, 2022

This PR adds resource and data source support for OpenStack Magnum node groups.

I added support for zero node_count cluster and nodegroup.
And I also fixed the merge_labels behavior and added it to the nodegroup resource as well

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 7, 2022

@MrFreezeex MrFreezeex marked this pull request as draft April 7, 2022 14:18
@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 7, 2022

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 7, 2022

@MrFreezeex MrFreezeex marked this pull request as ready for review April 8, 2022 08:43
@MrFreezeex MrFreezeex force-pushed the magnum-nodegroup branch 8 times, most recently from 277a23a to c99eea7 Compare April 9, 2022 18:18
@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 9, 2022

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 11, 2022

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 11, 2022

@lukasmrtvy
Copy link

@MrFreezeex ping, is there any progress on this? Thanks

@MrFreezeex
Copy link
Contributor Author

MrFreezeex commented Jun 8, 2022

@MrFreezeex ping, is there any progress on this? Thanks

Well AFAIK it works just fine, but it won't probably be merged anytime soon because of the various pinned issue, including: #1366

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
@MrFreezeex
Copy link
Contributor Author

I also fixed the merge_labels behavior of the cluster resource/added merge_labels support for nodegroup since this gophercloud/gophercloud#2377 was merged and released in 0.25.0.

When you add mergelabels and you actually add labels, the magnum API
will actually return you the complete set of labels under the "labels"
key. It means that if you want to add/override a couple of label while
setting merge_labels the creation will succeed but then terraform will
detect the rest of the labels as changed and will try to rebuid the
cluster.

This commit instead use the keys labels_{added,skipped,overriden}
when merge labels which contains the labels that the user has overriden.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Copy link
Member

@ozerovandrei ozerovandrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I can merge this without running acceptance tests in CI if it's ready and has been manually tested.

@MrFreezeex
Copy link
Contributor Author

MrFreezeex commented Jun 21, 2022

LGTM. I can merge this without running acceptance tests in CI if it's ready and has been manually tested.

Oh ok, thanks! Hmm I didn't look into running the acceptance tests on our openstack cluster so far, let me check how I can do that!

@MrFreezeex MrFreezeex force-pushed the magnum-nodegroup branch 3 times, most recently from 44b7da7 to 9687439 Compare June 22, 2022 16:51
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Previously the code set image_id and flavor_id which doesn't exist
instead of image/flavor. It would be way more meaningful to have argument
image_id and flavor_id instead but for backward compatibility let's not
do that for now.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
As fedora atomic is no more available, we remove it from the code and
add OS_MAGNUM_IMAGE environment variable so that we can a supported
image in the CI later on.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
The node_count returned in magnum for the cluster is the sum of all
nodegroup. So once you add a node_count, the correct value is actually
the node_count of the default worker node.

This commit take the node_count of this default worker node group in
priority and if there are any errors it takes the node_count of the
cluster instead.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
@MrFreezeex
Copy link
Contributor Author

MrFreezeex commented Jun 22, 2022

@ozerovandrei I tested the acceptance tests on our OpenStack cluster and it now works. I had to make a couple of changes including changing the way we get the magnum image as the one that we used was deprecated since a long time and the link was not available anymore. I suspect that the acceptance was not working on the cluster resource also as I fixed a bug there, now everything should be working properly!

@ozerovandrei ozerovandrei merged commit f46b612 into terraform-provider-openstack:main Jun 26, 2022
@ozerovandrei
Copy link
Member

Thank you @MrFreezeex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants