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

✨ Support BYO dual-stack Network #1789

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

MaysaMacedo
Copy link
Contributor

@MaysaMacedo MaysaMacedo commented Dec 13, 2023

What this PR does / why we need it:

This commit adds support to specify more than one existent subnet on the OpenStackCluster.

The existent OpenStackClusterSpec.Subnet field that would have the following format:

  subnet:
    id: a532beb0-c73a-4b5d-af66-3ad05b73d063

is removed in favor of the following OpenStackClusterSpec.Subnets:

  subnets:
    - id: a532beb0-c73a-4b5d-af66-3ad05b73d063

conversion from v1 alpha8 clusters that use multiple subnets won't be allowed to older releases.

TODOs:

  • implement conversion
  • includes documentation
  • adds unit tests

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Dec 13, 2023
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 13, 2023
Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
🔨 Latest commit 2ef8ee5
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/65a960a29a821f0008d7fe51
😎 Deploy Preview https://deploy-preview-1789--kubernetes-sigs-cluster-api-openstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 13, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @MaysaMacedo. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 13, 2023
@mdbooth
Copy link
Contributor

mdbooth commented Dec 13, 2023

This looks great. Do you want to consider NodeCIDR -> NodeCIDRs at the same time for non-BYO?

@mdbooth
Copy link
Contributor

mdbooth commented Dec 13, 2023

/ok-to-test

@MaysaMacedo You may want to apply to join the SIG so you don't need this.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 13, 2023
@MaysaMacedo MaysaMacedo marked this pull request as ready for review December 18, 2023 18:38
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 18, 2023
@MaysaMacedo MaysaMacedo force-pushed the experimenting-dualstack branch 2 times, most recently from a47fc3c to 600a05b Compare December 19, 2023 13:25
@MaysaMacedo
Copy link
Contributor Author

/uncc seanschneeweiss

@k8s-ci-robot k8s-ci-robot removed the request for review from seanschneeweiss December 19, 2023 13:27
@MaysaMacedo MaysaMacedo force-pushed the experimenting-dualstack branch 3 times, most recently from a8610cf to 152dfbd Compare December 19, 2023 18:38
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 19, 2023
@@ -383,6 +383,15 @@ func Convert_v1alpha7_OpenStackClusterSpec_To_v1alpha8_OpenStackClusterSpec(in *
}
}

emptySubnet := SubnetFilter{}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's ok but I'll tag @mdbooth on this one, he might think it's not the right way to do it.

@EmilienM
Copy link
Contributor

Also, please run pull-cluster-api-provider-openstack-e2e-full-test job in this PR, so we can check upgrades.
Thanks

@MaysaMacedo MaysaMacedo force-pushed the experimenting-dualstack branch 3 times, most recently from 7006019 to 7f94159 Compare January 18, 2024 01:36
@EmilienM
Copy link
Contributor

/test pull-cluster-api-provider-openstack-e2e-full-test

@EmilienM
Copy link
Contributor

This looks good to me, let's see how the e2e-full-test job works (testing upgrades).
One minor nit about unit tests but otherwise happy to LGTM.

Nice work :-)

api/v1alpha7/conversion.go Outdated Show resolved Hide resolved
@mdbooth
Copy link
Contributor

mdbooth commented Jan 18, 2024

I couldn't understand how the conversion tests were passing without any change to the restore functions. I expected the hub->spoke->hub (e.g. v1alpha8->v1alpha7->v1alpha8) tests to fail, because when converting a slice of length 2 to a single value and back we obviously lose the second value. It turns out that the fuzzer was not generating slices of length 2, so I made a change to the relevant fuzzerfuncs to ensure that it does.

I've added 3 commits:

  • The first fixes a nit I mentioned
  • The second updates the fuzzer funcs to sometimes generate Subnets of length 2. This causes the tests to fail.
  • The third fixes the tests by restoring subnets beyond the first one

For convenience I pushed them directly, but please review and squash them into your other commits as appropriate.

I haven't finished reviewing yet, btw.

@mdbooth
Copy link
Contributor

mdbooth commented Jan 18, 2024

Looks good. Can you take a look at the commits I added (feel free to implement them differently!) and squash them as appropriate, and also Emilien's unit tests. Thanks!

MaysaMacedo and others added 3 commits January 18, 2024 14:31
This commit adds support to specify more than one
existent subnet on the `OpenStackCluster`. The existent
`OpenStackClusterSpec.Subnet` is removed in favor
of `OpenStackClusterSpec.Subnets`.

Co-Authored-By: Emilien Macchi <emilien@redhat.com>
This commit adds a section to the book explaining the
modification of the `OpenStackClusterSpec.Subnet` API field.
@mdbooth
Copy link
Contributor

mdbooth commented Jan 18, 2024

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MaysaMacedo, mdbooth

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2024
@MaysaMacedo
Copy link
Contributor Author

I don't think this is urgent so lets wait until we've decided on the open conversion question.

In the meantime, can we think about how we could e2e test this? I don't think we have ipv6 support in CI for the e2e tests. Would you have time to look into that? It would be really good to be able to actually deploy a dual-stack cluster.

Sure, I can start taking a look. Note that this PR only creates dual-stack servers, there is no support for IPv6 SGs or API with IPv6. Would that be enough for the CI?

@EmilienM
Copy link
Contributor

/lgtm

Nice work Maysa!
Feel free to unhold when CI is green.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 18, 2024
@EmilienM
Copy link
Contributor

/test pull-cluster-api-provider-openstack-e2e-full-test

@MaysaMacedo
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 18, 2024
@k8s-ci-robot k8s-ci-robot merged commit f90ddda into kubernetes-sigs:main Jan 18, 2024
10 checks passed
@MaysaMacedo MaysaMacedo deleted the experimenting-dualstack branch January 18, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants