Skip to content

Enable setting VNet peering properties#3340

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
giantswarm:more-peering-properties-clean
Apr 5, 2023
Merged

Enable setting VNet peering properties#3340
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
giantswarm:more-peering-properties-clean

Conversation

@nprokopic
Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR enables setting additional properties for VNet peering (AllowForwardedTraffic, AllowGatewayTransit, AllowVirtualNetworkAccess and UseRemoteGateways).

One use case for setting these properties to non-default values is to, for example, configure VPN gateway transit for virtual network peering.

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 #3183

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:

Enable setting VNet peering properties (`AllowForwardedTraffic`, `AllowGatewayTransit`, `AllowVirtualNetworkAccess` and `UseRemoteGateways`)

@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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 21, 2023
@nprokopic nprokopic force-pushed the more-peering-properties-clean branch 2 times, most recently from 5660020 to 5dc706b Compare March 22, 2023 15:19
Copy link
Copy Markdown
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

This looks great, thanks for working on this @nprokopic !

Just one comment from my end: would you be able to add a unit test for VnetPeeringSpecs() in cluster_test.go?

Copy link
Copy Markdown
Contributor

@Jont828 Jont828 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! As @willie-yao said, we might want to add some tests in cluster_tests.go, and here are a couple points from me.

Comment thread api/v1beta1/types.go Outdated
AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"`

// UseRemoteGateways specifies if remote gateways can be used on this virtual network.
//
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can probably remove this extra line

Comment thread api/v1beta1/types.go Outdated

// UseRemoteGateways specifies if remote gateways can be used on this virtual network.
//
// If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use
// If the flag is set to true, and allowGatewayTransit on remote peering is also set to true, the virtual network will use

Comment thread api/v1beta1/types.go Outdated
// UseRemoteGateways specifies if remote gateways can be used on this virtual network.
//
// If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use
// gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot
// the gateways of the remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot

RemoteVnetName: "spoke-vnet",
RemoteResourceGroup: "spoke-group",
SubscriptionID: "sub1",
AllowForwardedTraffic: to.BoolPtr(true),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
AllowForwardedTraffic: to.BoolPtr(true),
AllowForwardedTraffic: pointer.Bool(true),

I think we want to switch to the "k8s.io/utils/pointer" library

@nprokopic
Copy link
Copy Markdown
Contributor Author

This looks great, thanks for working on this @nprokopic !

Just one comment from my end: would you be able to add a unit test for VnetPeeringSpecs() in cluster_test.go?

Thanks for the review! Sure, I will add a unit test for VnetPeeringSpecs() in cluster_test.go, missed it when I looked for unit tests to add. Will address other comments as well and update the PR.

@nprokopic nprokopic force-pushed the more-peering-properties-clean branch from 5dc706b to 82d0936 Compare March 31, 2023 11:16
@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 Mar 31, 2023
@nprokopic
Copy link
Copy Markdown
Contributor Author

@Jont828 @willie-yao I have added missing tests and also addressed other suggestions from the review. All tests are 🟢 :)

Can we add this PR to the v1.9 milestone?

@Jont828
Copy link
Copy Markdown
Contributor

Jont828 commented Apr 3, 2023

/lgtm

This looks great! Unless there are any objections, I don't see why not.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 3, 2023
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 324aa8ade4d393ac71aa222ab473486159927d13

@willie-yao
Copy link
Copy Markdown
Contributor

/lgtm

Thanks for all the great work on this!

@willie-yao
Copy link
Copy Markdown
Contributor

/milestone v1.9

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@willie-yao: You must be a member of the kubernetes-sigs/cluster-api-provider-azure-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Cluster API Provider Azure Maintainers and have them propose you as an additional delegate for this responsibility.

Details

In response to this:

/milestone v1.9

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.

@nawazkh
Copy link
Copy Markdown
Member

nawazkh commented Apr 4, 2023

Sweet! Thanks for adding this! 🚀

@nprokopic
Copy link
Copy Markdown
Contributor Author

@willie-yao: You must be a member of the kubernetes-sigs/cluster-api-provider-azure-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Cluster API Provider Azure Maintainers and have them propose you as an additional delegate for this responsibility.

Can somebody from @kubernetes-sigs/cluster-api-provider-azure-maintainers help out here?

@mboersma
Copy link
Copy Markdown
Contributor

mboersma commented Apr 5, 2023

/milestone v1.9

@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Apr 5, 2023
@CecileRobertMichon
Copy link
Copy Markdown
Contributor

/approve

Thanks all for the reviews 🚀

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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

The pull request process is described here

Details 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 Apr 5, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8fefb1a into kubernetes-sigs:main Apr 5, 2023
@Gacko Gacko deleted the more-peering-properties-clean branch February 13, 2025 15:28
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/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. 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.

VPN gateway transit for virtual network peering

7 participants