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

fix: support mulltiple subnet when creating private endpoints #2065

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

andyzhangx
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

fix: support mulltiple subnet when creating private endpoints
when specifying "networkEndpointType: privateEndpoint" in storage class, only first subnet is associated with a new private endpoint, this does not work when there are multiple subnets. Ideally when there are multiple subnets, multiple private endpoints should be created, every private endpoint is associated with one subnet, and only one dns zone will be created mapping to vnet and multiple private endpoints
For example, in csi logs below, there are two subnets(aks-subnet, subnet2), two private endpoint(f0240127bc91d4905903342-pvtendpoint-0, f0240127bc91d4905903342-pvtendpoint-1) will be created and one private DNS zone group(f0240127bc91d4905903342-dnszonegroup) will be created.
cloud-provider-azure pr: kubernetes-sigs/cloud-provider-azure#6783
csi logs:

I0809 10:44:20.264799       1 utils.go:101] GRPC call: /csi.v1.Controller/CreateVolume
I0809 10:44:20.264829       1 utils.go:102] GRPC request: {"capacity_range":{"required_bytes":107374182400},"name":"pvc-a449228d-7696-48a9-b082-a98530a9401d","parameters":{"csi.storage.k8s.io/pv/name":"pvc-a449228d-7696-48a9-b082-a98530a9401d","csi.storage.k8s.io/pvc/name":"pvc-azurefile","csi.storage.k8s.io/pvc/namespace":"default","networkEndpointType":"privateEndpoint","skuName":"Premium_LRS","subnetName":"aks-subnet,subnet2"},"volume_capabilities":[{"AccessType":{"Mount":{"mount_flags":["dir_mode=0777","file_mode=0777","mfsymlinks","cache=strict","nosharesock","actimeo=30","nobrl"]}},"access_mode":{"mode":5}}]}
I0809 10:44:20.508800       1 azure_storageaccount.go:344] found a matching account f0240127bc91d4905903342 type Premium_LRS location eastus
I0809 10:44:21.135082       1 azure_storageaccount.go:609] Creating private endpoint(f0240127bc91d4905903342-pvtendpoint) for account (f0240127bc91d4905903342)
I0809 10:44:21.707160       1 azure_storageaccount.go:670] begin to create private endpoint(f0240127bc91d4905903342-pvtendpoint-0) on subnet(aks-subnet) under vnet(aks-vnet-27574481) in rg(MC_aks-yxytest_group_aks-yxytest_eastus)
I0809 10:44:27.370234       1 azure_storageaccount.go:670] begin to create private endpoint(f0240127bc91d4905903342-pvtendpoint-1) on subnet(subnet2) under vnet(aks-vnet-27574481) in rg(MC_aks-yxytest_group_aks-yxytest_eastus)
I0809 10:44:33.498485       1 azure_storageaccount.go:721] Creating private DNS zone group(f0240127bc91d4905903342-dnszonegroup) with privateEndpoint(f0240127bc91d4905903342-pvtendpoint-0), vNetName(aks-vnet-27574481), resourceGroup(MC_aks-yxytest_group_aks-yxytest_eastus)
I0809 10:44:34.687096       1 azure_storageaccount.go:721] Creating private DNS zone group(f0240127bc91d4905903342-dnszonegroup) with privateEndpoint(f0240127bc91d4905903342-pvtendpoint-1), vNetName(aks-vnet-27574481), resourceGroup(MC_aks-yxytest_group_aks-yxytest_eastus)
I0809 10:44:35.663168       1 controllerserver.go:568] begin to create file share(pvc-a449228d-7696-48a9-b082-a98530a9401d) on account(f0240127bc91d4905903342) type(Premium_LRS) subID() rg(MC_aks-yxytest_group_aks-yxytest_eastus) location() size(100) protocol(SMB)
I0809 10:44:35.925792       1 controllerserver.go:600] create file share pvc-a449228d-7696-48a9-b082-a98530a9401d on storage account f0240127bc91d4905903342 successfully
I0809 10:44:35.935106       1 controllerserver.go:646] store account key to k8s secret(azure-storage-account-f0240127bc91d4905903342-secret) in default namespace
I0809 10:44:35.935406       1 azure_metrics.go:118] "Observed Request Latency" latency_seconds=15.670012553 request="azurefile_csi_driver_controller_create_volume" resource_group="mc_aks-yxytest_group_aks-yxytest_eastus" subscription_id="" source="file.csi.azure.com" volumeid="MC_aks-yxytest_group_aks-yxytest_eastus#f0240127bc91d4905903342#pvc-a449228d-7696-48a9-b082-a98530a9401d###default" result_code="succeeded"
I0809 10:44:35.935528       1 utils.go:108] GRPC response: {"volume":{"capacity_bytes":107374182400,"volume_context":{"csi.storage.k8s.io/pv/name":"pvc-a449228d-7696-48a9-b082-a98530a9401d","csi.storage.k8s.io/pvc/name":"pvc-azurefile","csi.storage.k8s.io/pvc/namespace":"default","networkEndpointType":"privateEndpoint","secretnamespace":"default","server":"f0240127bc91d4905903342.privatelink.file.core.windows.net","skuName":"Premium_LRS","subnetName":"aks-subnet,subnet2"},"volume_id":"MC_aks-yxytest_group_aks-yxytest_eastus#f0240127bc91d4905903342#pvc-a449228d-7696-48a9-b082-a98530a9401d###default"}}


Which issue(s) this PR fixes:

Fixes ##2047

Requirements:

Special notes for your reviewer:

Release note:

none

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 19, 2024
@andyzhangx
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

@andyzhangx: 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-azurefile-csi-driver-e2e-capz-windows-2019 52cf419 link true /test pull-azurefile-csi-driver-e2e-capz-windows-2019

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.

@andyzhangx
Copy link
Member Author

/retest

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/bug Categorizes issue or PR as related to a bug. 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.

2 participants