Skip to content

Commit 81c3cd6

Browse files
committed
feat: add Premium_LRS support
1 parent da33450 commit 81c3cd6

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

deploy/example/pv-blobfuse-csi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
csi:
1616
driver: blobfuse.csi.azure.com
1717
readOnly: false
18-
volumeHandle: arbitrary-volumeid
18+
volumeHandle: uniqe-volumeid # make sure this volumeid is unique in whole cluster
1919
volumeAttributes:
2020
containerName: EXISTING_CONTAINER_NAME
2121
nodeStageSecretRef:

deploy/example/storageclass-blobfuse-csi-mountoptions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: blobfuse.csi.azure.com
66
provisioner: blobfuse.csi.azure.com
77
parameters:
8-
skuName: Standard_LRS # available values: Standard_LRS, Standard_GRS, Standard_RAGRS
8+
skuName: Standard_LRS # available values: Standard_LRS, Premium_LRS, Standard_GRS, Standard_RAGRS
99
reclaimPolicy: Retain # if set as "Delete" container would be removed after pvc deletion
1010
volumeBindingMode: Immediate
1111
mountOptions:

deploy/example/storageclass-blobfuse-csi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ metadata:
55
name: blobfuse.csi.azure.com
66
provisioner: blobfuse.csi.azure.com
77
parameters:
8-
skuName: Standard_LRS # available values: Standard_LRS, Standard_GRS, Standard_RAGRS
8+
skuName: Standard_LRS # available values: Standard_LRS, Premium_LRS, Standard_GRS, Standard_RAGRS
99
reclaimPolicy: Retain # if set as "Delete" container would be removed after pvc deletion
1010
volumeBindingMode: Immediate

docs/driver-parameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
99
> get a `mountOptions` example [here](../deploy/example/storageclass-blobfuse-csi-mountoptions.yaml)
1010
11-
Name | Meaning | Example | Mandatory | Default value
11+
Name | Meaning | Example | Mandatory | Default value
1212
--- | --- | --- | --- | ---
13-
skuName | blobfuse storage account type (alias: `storageAccountType`) | `Standard_LRS`, `Standard_GRS`, `Standard_RAGRS` | No | `Standard_LRS`
13+
skuName | blobfuse storage account type (alias: `storageAccountType`) | `Standard_LRS`, `Premium_LRS`, `Standard_GRS`, `Standard_RAGRS` | No | `Standard_LRS`
1414
location | specify the location in which blobfuse share will be created | `eastus`, `westus`, etc. | No | if empty, driver will use the same location name as current k8s cluster
1515
resourceGroup | specify the existing resource group name where the container is | existing resource group name | No | if empty, driver will use the same resource group name as current k8s cluster
1616
storageAccount | specify the storage account name in which blobfuse share will be created | STORAGE_ACCOUNT_NAME | No | if empty, driver will find a suitable storage account that matches `skuName` in the same resource group; if a storage account name is provided, it means that storage account must exist otherwise there would be error

pkg/blobfuse/controllerserver.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
7979
resourceGroup = d.cloud.ResourceGroup
8080
}
8181

82-
account, accountKey, err := d.cloud.EnsureStorageAccount(accountName, storageAccountType, string(storage.StorageV2), resourceGroup, location, blobfuseAccountNamePrefix)
82+
accountKind := string(storage.StorageV2)
83+
if strings.EqualFold(storageAccountType, "Premium_LRS") {
84+
accountKind = string(storage.BlockBlobStorage)
85+
}
86+
account, accountKey, err := d.cloud.EnsureStorageAccount(accountName, storageAccountType, accountKind, resourceGroup, location, blobfuseAccountNamePrefix)
8387
if err != nil {
8488
return nil, fmt.Errorf("could not get storage key for storage account %s: %v", accountName, err)
8589
}

test/e2e/dynamic_provisioning_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var _ = ginkgo.Describe("[blobfuse-csi-e2e] Dynamic Provisioning", func() {
9595
Cmd: []string{"cat", "/mnt/test-1/data"},
9696
ExpectedString: "hello world\nhello world\n", // pod will be restarted so expect to see 2 instances of string
9797
},
98-
StorageClassParameters: map[string]string{"skuName": "Standard_LRS"},
98+
StorageClassParameters: map[string]string{"skuName": "Premium_LRS"},
9999
}
100100
test.Run(cs, ns)
101101
})

0 commit comments

Comments
 (0)