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 azure storage account creation failure #65846

Merged

Conversation

andyzhangx
Copy link
Member

What this PR does / why we need it:
fix azure storage account creation failure

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

Special notes for your reviewer:
This bug is due to azure-sdk-for-go API change introduced in v1.11:
https://github.com/Azure/azure-sdk-for-go/blob/fbe7db0e3f9793ba3e5704efbab84f51436c136e/services/storage/mgmt/2017-10-01/storage/models.go#L381-L382

there is a new field Kind which is required, so any sdk upgrade from and old version would break the storage account creation since old code won't use Kind. I have filed an issue to azure-sdk-for-go: Azure/azure-sdk-for-go#2182

Release note:

fix azure storage account creation failure

/kind bug
/sig azure
/assign @khenidak @feiskyer
cc @brendandburns

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 5, 2018
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. sig/azure labels Jul 5, 2018
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 5, 2018
@karataliu
Copy link
Contributor

karataliu commented Jul 5, 2018

The document listed in code is for update. For creation, all 3 kinds are supported:
https://docs.microsoft.com/en-us/rest/api/storagerp/storageaccounts/create#kind

So according to the docs, If we're to make it StorageV2 in future, that'd be a decision we make, not limited by api. Can consider updating the comment in code.

@andyzhangx
Copy link
Member Author

@karataliu original storage account is identical to StorageV1, and StorageV2 is recommended according to https://docs.microsoft.com/en-us/azure/storage/common/storage-account-options?toc=%2fazure%2fstorage%2fblobs%2ftoc.json, and BlobStorage is only for block blob, so let's switch to use StorageV2, paste some info here:

The three different storage account options are:
General-purpose v2 (GPv2) accounts
General-purpose v1 (GPv1) accounts
Blob storage accounts

  • General-purpose v2
    General-purpose v2 (GPv2) accounts are storage accounts that support all of the latest features for blobs, files, queues, and tables. GPv2 accounts support all APIs and features supported in GPv1 and Blob storage accounts. They also support the same durability, availability, scalability, and performance features in those account types. Pricing for GPv2 accounts has been designed to deliver the lowest per gigabyte prices, and industry competitive transaction prices.

You can upgrade your GPv1 or Blob storage account to a GPv2 account using Azure portal, PowerShell, or Azure CLI.

@andyzhangx
Copy link
Member Author

/test pull-kubernetes-e2e-kops-aws

@andyzhangx
Copy link
Member Author

BTW, this is a critical bug, storage account creation is broken on v1.11 and master branch

@@ -113,6 +113,8 @@ func (az *Cloud) ensureStorageAccount(accountName, accountType, location, genAcc
accountName, az.ResourceGroup, location, accountType)
cp := storage.AccountCreateParameters{
Sku: &storage.Sku{Name: storage.SkuName(accountType)},
// set as StorageV2 according to https://docs.microsoft.com/en-us/rest/api/storagerp/StorageAccounts/Update
Copy link
Member

@feiskyer feiskyer Jul 5, 2018

Choose a reason for hiding this comment

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

nit: Also add a comment: "Currently only StorageV2 supported" for updates?

Copy link
Member

Choose a reason for hiding this comment

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

hmm, this is only for create, so all 3 kinds are supported here. So it's better changing the link to https://docs.microsoft.com/en-us/azure/storage/common/storage-account-options and add a comment of why StorageV2 is chosen

Copy link
Contributor

Choose a reason for hiding this comment

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

This is exactly what i meant.
The comment should be 'StorageV2' is chosen by purpose, not limited by api.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed by new comment

@feiskyer
Copy link
Member

feiskyer commented Jul 5, 2018

/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jul 5, 2018
@ddebroy
Copy link
Member

ddebroy commented Jul 5, 2018

Will it make sense to add an e2e case for dynamic provisioning of AzureFile backed volumes to catch such issues (resulting from upgrading azure SDK or due to some other reason) in the future?

Copy link
Member Author

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

@@ -113,6 +113,8 @@ func (az *Cloud) ensureStorageAccount(accountName, accountType, location, genAcc
accountName, az.ResourceGroup, location, accountType)
cp := storage.AccountCreateParameters{
Sku: &storage.Sku{Name: storage.SkuName(accountType)},
// set as StorageV2 according to https://docs.microsoft.com/en-us/rest/api/storagerp/StorageAccounts/Update
Copy link
Member Author

Choose a reason for hiding this comment

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

fixed by new comment

@andyzhangx
Copy link
Member Author

@ddebroy good question, I found this issue on Azure acs-engine regression test, while in upstream, there is no such plan to add Azure e2e test since cloud provider will be split to standalone repo in the near future.

@karataliu
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 Jul 6, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, karataliu

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

@feiskyer
Copy link
Member

feiskyer commented Jul 6, 2018

Will it make sense to add an e2e case for dynamic provisioning of AzureFile backed volumes to catch such issues (resulting from upgrading azure SDK or due to some other reason) in the future?

Azure related e2e tests are adding to https://github.com/kubernetes/cloud-provider-azure. @karataliu is working on that part.

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@andyzhangx
Copy link
Member Author

/test pull-kubernetes-e2e-gce-device-plugin-gpu
/test pull-kubernetes-bazel-test

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 6ca53a0 into kubernetes:master Jul 6, 2018
k8s-github-robot pushed a commit that referenced this pull request Jul 8, 2018
…5846-upstream-release-1.11

Automatic merge from submit-queue.

Automated cherry pick of #65846: fix azure storage account creation failure

Cherry pick of #65846 on release-1.11.

#65846: fix azure storage account creation failure
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. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create azure storage account failed in azure file plugin
7 participants