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 support for Shared VPC Networking #1189

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

barbacbd
Copy link
Contributor

@barbacbd barbacbd commented Mar 22, 2024

What type of PR is this?
/kind feature
/kind api-change

What this PR does / why we need it:

This is an update to the stale PR #991

** Added support for Host Project for a shared VPC in the Network struct.
** Network Resources will now use the host project name if exists, otherwise the normal project.
** Update the cluster getter interface to include the NetworkProject and Indicator for a shared VPC.
** Update reconcilers for girewall rules, subnets and network.
** Update the services to use the host project for resources when a shared vpc is used.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #861 #982

Special notes for your reviewer:

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

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Support shared VPC networking.
Able to deploy the cluster with shared VPC network from another project that hosts the networks.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Mar 22, 2024
Copy link

linux-foundation-easycla bot commented Mar 22, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 22, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @barbacbd!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-gcp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-gcp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @barbacbd. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 22, 2024
Copy link

netlify bot commented Mar 22, 2024

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

Name Link
🔨 Latest commit cd4236f
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-gcp/deploys/665f5f7f9c95b90008a75c7a
😎 Deploy Preview https://deploy-preview-1189--kubernetes-sigs-cluster-api-gcp.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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 22, 2024
@cpanato
Copy link
Member

cpanato commented Mar 23, 2024

/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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 23, 2024
@barbacbd
Copy link
Contributor Author

Still in the process of cleaning up unit tests. comments are causing linter to fail.

api/v1beta1/types.go Outdated Show resolved Hide resolved
cloud/services/compute/firewalls/reconcile.go Outdated Show resolved Hide resolved
cloud/services/compute/firewalls/reconcile.go Outdated Show resolved Hide resolved
cloud/services/compute/firewalls/reconcile_test.go Outdated Show resolved Hide resolved
cloud/services/compute/firewalls/reconcile_test.go Outdated Show resolved Hide resolved
cloud/services/compute/firewalls/reconcile_test.go Outdated Show resolved Hide resolved
cloud/services/compute/firewalls/reconcile_test.go Outdated Show resolved Hide resolved
@barbacbd barbacbd force-pushed the add-shared-vpc-support branch 3 times, most recently from 3baf3d5 to 260aa57 Compare March 27, 2024 16:25
cloud/scope/machine.go Show resolved Hide resolved
api/v1beta1/types.go Outdated Show resolved Hide resolved
@bfournie
Copy link
Contributor

bfournie commented Apr 1, 2024

/lgtm

@k8s-ci-robot
Copy link
Contributor

@bfournie: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

This is an update to the stale PR kubernetes-sigs#991

** Added support for Host Project for a shared VPC in the Network struct.
** Network Resources will now use the host project name if exists, otherwise the normal project.
** Update the cluster getter interface to include the NetworkProject and Indicator for a shared VPC.
** Update reconcilers for girewall rules, subnets and network.
** Update the services to use the host project for resources when a shared vpc is used.
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2024
Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks for contributing this feature and adding extensive testing where there wasn't!

/hold

To give the chance of others interested parties to review.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 29, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2024
@damdo
Copy link
Member

damdo commented May 29, 2024

/assign @cpanato
For an approval style review

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

lgtm

lets move forward, but i would love to have some e2e tests for this

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: barbacbd, cpanato

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 May 29, 2024
@damdo
Copy link
Member

damdo commented May 29, 2024

@barbacbd would you be able to work on setting up some E2E testing for this if possible? Thanks!

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 3, 2024
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 4, 2024
@barbacbd
Copy link
Contributor Author

barbacbd commented Jun 4, 2024

@cpanato @damdo I have opened another PR for the e2e tests #1255. I think that is going to take quite a bit of configuration to get it working.

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jun 4, 2024

@barbacbd: 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-gcp-apidiff cd4236f link false /test pull-cluster-api-provider-gcp-apidiff

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

@barbacbd
Copy link
Contributor Author

barbacbd commented Jun 6, 2024

/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 Jun 6, 2024
Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

Thanks @barbacbd
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 11, 2024
@k8s-ci-robot k8s-ci-robot merged commit 5a947cf into kubernetes-sigs:main Jun 11, 2024
22 of 23 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.1.0 milestone Jun 11, 2024
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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Can i configured GCP Instance Network Settings more freely?
10 participants