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 implementation of Node IPAM support #1666

Merged
merged 1 commit into from
Nov 11, 2022

Conversation

tylerschultz
Copy link
Contributor

@tylerschultz tylerschultz commented Oct 25, 2022

What this PR does / why we need it:

  • Adds addressesFromPools to the VSphereVM network device spec
  • Creates IPAddressClaims when AddressesFromPools is specified
  • IP addresses created by IPAM providers are assigned to vSphere machines via the VM metadata
  • IPv4 Gateways from IPAddresses (created by IPAM providers) are assigned to the Gateway4 field
  • IPv6 Gateways from IPAddresses (created by IPAM providers) are assigned to the Gateway6 field
  • All gateways in the same IP family assigned to a VSphereVM network device must be the same.
  • This implementation expects that an appropriate gateway for the IP family exists for every IPAddress that comes from an IPAM provider.
  • Adds the IPAddressClaimed Condition to provide visibility of the status of IP address acquisition
  • Adds the finalizer to prevent IPAMClaims from being deleted early
  • IPAddressClaims have an OwnerReference to VSphereVMs to ensure they are garbage-collected when the VM is deleted.

Co-authored-by: Aidan Obley aobley@vmware.com
Co-authored-by: Tyler Schultz tschultz@vmware.com
Co-authored-by: Christian Ang angc@vmware.com
Co-authored-by: Edwin Xie exie@vmware.com

Which issue(s) this PR fixes:
Fixes #1550

This PR implements this proposal: #1632

Special notes for your reviewer:

The e2e test will come in a separate PR. The IPAM feature requires an unreleased version of CAPI with a version of clusterctl with --ipam-provider flag and related IPAM CRDs. The main branch of CAPI also bumps to ginkgo v2. #1667

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

Adds support for node IPAM

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 25, 2022
@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 Oct 25, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @tylerschultz. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 25, 2022
@schrej
Copy link
Member

schrej commented Oct 27, 2022

/ok-to-test

@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 Oct 27, 2022
Copy link
Contributor

@srm09 srm09 left a comment

Choose a reason for hiding this comment

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

Did an initial pass, bunch of nits apart from setting the Conditions on the VSphereVM object. Need to fully review the reconcileIPAddresses function once, but the changes overall look good.

config/rbac/role.yaml Show resolved Hide resolved
pkg/manager/manager.go Outdated Show resolved Hide resolved
pkg/manager/manager.go Outdated Show resolved Hide resolved
pkg/services/govmomi/service.go Show resolved Hide resolved
pkg/services/govmomi/service.go Outdated Show resolved Hide resolved
pkg/services/govmomi/service.go Show resolved Hide resolved
pkg/services/govmomi/service.go Show resolved Hide resolved
pkg/util/machines.go Outdated Show resolved Hide resolved
pkg/util/machines_test.go Outdated Show resolved Hide resolved
apis/v1beta1/vspherevm_types.go Outdated Show resolved Hide resolved
@tylerschultz tylerschultz force-pushed the ipam-support branch 2 times, most recently from bb30246 to 2f8ed9e Compare October 31, 2022 21:01
@tylerschultz
Copy link
Contributor Author

/retest-required

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2022
@tylerschultz tylerschultz force-pushed the ipam-support branch 2 times, most recently from c22fdf9 to 9ab673d Compare November 2, 2022 21:11
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2022
@tylerschultz
Copy link
Contributor Author

Apologies, the conversations were folded and I didn't see several items! All should be resolved now. Thanks!

Copy link
Contributor

@srm09 srm09 left a comment

Choose a reason for hiding this comment

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

lgtm apart from a few nits.
/approve
/hold

controllers/vspherevm_controller.go Show resolved Hide resolved
pkg/services/govmomi/service.go Outdated Show resolved Hide resolved
pkg/services/govmomi/service.go Show resolved Hide resolved
@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. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 3, 2022
@srm09
Copy link
Contributor

srm09 commented Nov 3, 2022

@yastij @schrej Do take a pass at reviewing the PR and feel free to remove the hold once you feel it is good to go.

Copy link
Member

@schrej schrej left a comment

Choose a reason for hiding this comment

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

Very clean, well done!
Just two small things, otherwise
/lgtm

I didn't look at tests in detail though.

controllers/vspherevm_controller.go Outdated Show resolved Hide resolved
pkg/services/govmomi/service.go Show resolved Hide resolved
pkg/services/govmomi/service.go Outdated Show resolved Hide resolved
Copy link
Member

@yastij yastij left a comment

Choose a reason for hiding this comment

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

/approve

pkg/services/govmomi/service.go Show resolved Hide resolved
pkg/util/machines.go Outdated Show resolved Hide resolved
pkg/services/govmomi/service.go Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: srm09, yastij

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

@yastij
Copy link
Member

yastij commented Nov 10, 2022

lgtm pending answers to the question above

Copy link
Member

@yastij yastij left a comment

Choose a reason for hiding this comment

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

/hold

pkg/util/machines.go Show resolved Hide resolved
- Adds `addressesFromPools` to the VSphereVM network device spec
- Creates IPAddressClaims when AddressesFromPools is specified
- IP addresses created by IPAM providers are assigned to vSphere
  machines via the VM metadata
- IPv4 Gateways from IPAddresses (created by IPAM providers) are
  assigned to the Gateway4 field
- IPv6 Gateways from IPAddresses (created by IPAM providers) are assigned
  to the Gateway6 field
- All gateways in the same IP family assigned to a VSphereVM network
  device must be the same.
- This implementation expects that an appropriate gateway for the IP
  family exists for every IPAddress that comes from an IPAM provider.
- Adds the `IPAddressClaimed` Condition to provide visibility of the
  status of IP address acquisition
- Adds the finalizer to prevent IPAMClaims from being deleted early
- IPAddressClaims have an OwnerReference to VSphereVMs to ensure they
  are garbage-collected when the VM is deleted.

Co-authored-by: Tyler Schultz <tschultz@vmware.com>
Co-authored-by: Christian Ang <angc@vmware.com>
Co-authored-by: Edwin Xie <exie@vmware.com>
@k8s-ci-robot
Copy link
Contributor

@tylerschultz: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-vsphere-apidiff-main 606f6d5 link false /test pull-cluster-api-provider-vsphere-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@srm09
Copy link
Contributor

srm09 commented Nov 11, 2022

/unhold
I will let @yastij add the final lgtm which should let this one merge.

@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 Nov 11, 2022
@yastij
Copy link
Member

yastij commented Nov 11, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 11, 2022
@k8s-ci-robot k8s-ci-robot merged commit 26fa80a into kubernetes-sigs:main Nov 11, 2022
@tylerschultz tylerschultz deleted the ipam-support branch November 11, 2022 17:52
@tylerschultz
Copy link
Contributor Author

Thanks all!

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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPAM support for CAPV
7 participants