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: create private endpoint failure when vnetResourceGroup is specified #6720

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Aug 1, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

fix: create private endpoint failure when vnetResourceGroup is specified in azure file storage class

this PR adds a new parameter vnetResourceGroup into getSubnet func, if vnetResourceGroup is provided, then use it, otherwise use vnetResourceGroup from cloud provider config which keeps the same logic

related config and error msg
  apiVersion: storage.k8s.io/v1
  kind: StorageClass
  metadata:
    name: my-azurefile
  mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=0
  - gid=0
  - mfsymlinks
  - cache=strict
  - actimeo=30
  - nobrl
  parameters:
    networkEndpointType: privateEndpoint
    skuName: Premium_LRS
    subnetName: default
    vnetName: my-vnet  # this is the name of the private vnet created on step 3
    vnetResourceGroup: aks-ds-rg
  provisioner: file.csi.azure.com
  reclaimPolicy: Delete
  volumeBindingMode: Immediate
I0726 13:12:03.775852       1 utils.go:77] GRPC call: /csi.v1.Controller/CreateVolume
 
I0726 13:12:03.775883       1 utils.go:78] GRPC request: {"capacity_range":{"required_bytes":10737418240},"name":"pvc-9ac5081e-1483-4a9c-9915-e21ea222e53d","parameters":{"csi.storage.k8s.io/pv/name":"pvc-9ac5081e-1483-4a9c-9915-e21ea222e53d","csi.storage.k8s.io/pvc/name":"my-azurefile","csi.storage.k8s.io/pvc/namespace":"default","networkEndpointType":"privateEndpoint","skuName":"Premium_LRS","subnetName":"default","vnetName":"my-vnet","vnetResourceGroup":"aks-ds-rg"},"volume_capabilities":[{"AccessType":{"Mount":{"mount_flags":["dir_mode=0777","file_mode=0777","uid=0","gid=0","mfsymlinks","cache=strict","actimeo=30","nobrl"]}},"access_mode":{"mode":5}}]}
 
I0726 13:12:04.313940       1 azure_storageaccount.go:413] azure - no matching account found, begin to create a new account yyy in resource group MC_aks-ds-rg_aks-test_australiacentral, location: australiacentral, accountType: Premium_LRS, accountKind: FileStorage, tags: map[k8s-azure-created-by:azure]
 
I0726 13:12:04.313999       1 azure_storageaccount.go:438] set AllowBlobPublicAccess(false) for storage account(yyy)
 
I0726 13:12:04.313940       1 azure_storageaccount.go:413] azure - no matching account found, begin to create a new account yyy in resource group MC_aks-ds-rg_aks-test_australiacentral, location: australiacentral, accountType: Premium_LRS, accountKind: FileStorage, tags: map[k8s-azure-created-by:azure]
 
I0726 13:12:04.313999       1 azure_storageaccount.go:438] set AllowBlobPublicAccess(false) for storage account(yyy)
 
I0726 13:12:30.176409       1 azure_storageaccount.go:583] Creating private endpoint(yyy-pvtendpoint) for account (yyy)
 
I0726 13:12:30.248922       1 azure_subnetclient.go:135] Received error in subnet.get.request: resourceID: /subscriptions/xxx/resourceGroups/MC_aks-ds-rg_aks-test_australiacentral/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/default, error: Retriable: false, RetryAfter: 0s, HTTPStatusCode: 404, RawError: {"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Network/virtualNetworks/my-vnet' under resource group 'MC_aks-ds-rg_aks-test_australiacentral' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}
 
I0726 13:12:30.249020       1 azure_subnet_repo.go:65] Subnet "default" not found
 
E0726 13:12:30.249040       1 azure_storageaccount.go:590] SubnetPropertiesFormat of (my-vnet, default) is nil
 
I0726 13:12:30.450263       1 azure_armclient.go:302] Received error in sendAsync.send: resourceID: http://localhost:7788/subscriptions/xxx/resourceGroups/aks-ds-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/default?api-version=2022-07-01, error: Retriable: false, RetryAfter: 0s, HTTPStatusCode: 400, RawError: {
 
  "error": {
 
    "code": "AddressPrefixStringCannotBeNullOrEmpty",
 
    "message": "Address prefix string for resource /subscriptions/xxx/resourceGroups/aks-ds-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/default cannot be null or empty.",
 
    "details": []
 
  }

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix: subnet update issue when vnetResourceGroup is specified in azure file storage class

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

fix: subnet update issue when vnetResourceGroup is specified in azure file storage class

/kind bug

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind labels Aug 1, 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 requested review from jwtty and lzhecheng August 1, 2024 07:02
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 1, 2024
@andyzhangx
Copy link
Member Author

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed do-not-merge/needs-kind labels Aug 1, 2024
@lzhecheng
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 1, 2024
@coveralls
Copy link

Coverage Status

coverage: 77.483% (+0.008%) from 77.475%
when pulling 76b072e on andyzhangx:fix-subnet-update
into ebff53e on kubernetes-sigs:master.

@andyzhangx
Copy link
Member Author

/retest

2 similar comments
@andyzhangx
Copy link
Member Author

/retest

@andyzhangx
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

@andyzhangx: The following tests 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-cloud-provider-azure-e2e-ccm-vmss-ip-lb-capz 76b072e link true /test pull-cloud-provider-azure-e2e-ccm-vmss-ip-lb-capz
pull-cloud-provider-azure-e2e-ccm-vmss-multi-slb-capz 76b072e link true /test pull-cloud-provider-azure-e2e-ccm-vmss-multi-slb-capz
pull-cloud-provider-azure-e2e-ccm-vmssflex-capz 76b072e link true /test pull-cloud-provider-azure-e2e-ccm-vmssflex-capz
pull-cloud-provider-azure-e2e-ccm-vmss-shared-probe-capz 76b072e link true /test pull-cloud-provider-azure-e2e-ccm-vmss-shared-probe-capz

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

@andyzhangx andyzhangx merged commit 3942a97 into kubernetes-sigs:master Aug 1, 2024
13 of 18 checks passed
@andyzhangx
Copy link
Member Author

/cherrypick release-1.30

@andyzhangx
Copy link
Member Author

/cherrypick release-1.29

@andyzhangx
Copy link
Member Author

/cherrypick release-1.28

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #6721

In response to this:

/cherrypick release-1.29

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.

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #6722

In response to this:

/cherrypick release-1.30

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.

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #6723

In response to this:

/cherrypick release-1.28

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.

@andyzhangx andyzhangx changed the title fix: subnet update issue when vnetResourceGroup is specified fix: create private endpoint failure when vnetResourceGroup is specified Aug 1, 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/bug Categorizes issue or PR as related to a bug. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants