Skip to content

Commit 35d3a11

Browse files
authored
Merge pull request #325 from songjiaxun/azurestack_support_premium
fix: Azure Stack supports Premium_LRS storage account type
2 parents 33d17ce + 9db0746 commit 35d3a11

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

docs/limitations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Azure Blob Storage CSI Driver Limitations
22
- Although Blob CSI Driver allows ReadWriteMany access mode to be used, its functionality is limited by the underlying volume-mounting technology. If azure-storage-fuse is being used to mount a Blob storage container, multiple nodes are allowed to mount the same container, but for just read-only scenarios. It means, you can still use ReadWriteMany mode to claim a volume, but you should carefully avoid writing to one single file from multiple nodes as there will be data corruption. NFSv3, in the contrast, fully supports ReadWriteMany access mode.
33
- The azure-storage-fuse method only supports Linux agent nodes.
4-
- For the Kubernetes clusters that are running on Azure Stack Hub environments, only Standard Locally-redundant storage (Standard_LRS) Storage Account is supported. You will not be blocked if you claim a volume with other types of Storage Account, however, under the hood the account type will be converted to Standard_LRS.
4+
- For the Kubernetes clusters that are running on Azure Stack Hub environments, only Standard Locally-redundant (Standard_LRS) and Premium Locally-redundant (Premium_LRS) Storage Account types are supported.
55
- The memory consumption of azure-storage-fuse (blobfuse) may be high when large files are being processed. Thus, by default the Blob CSI Driver container has a memory restriction of 2100Mi. This known issue is described in [this ticket](https://github.com/Azure/azure-storage-fuse/issues/454).
66
- Restart csi-blobfuse-node daemonset would make current blobfuse mount unavailable. This issue is tracked by [this ticket](https://github.com/kubernetes-sigs/blob-csi-driver/issues/115).

pkg/blob/controllerserver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
114114
}
115115
if IsAzureStackCloud(d.cloud) {
116116
accountKind = string(storage.Storage)
117-
storageAccountType = "Standard_LRS"
117+
if storageAccountType != "" && storageAccountType != string(storage.StandardLRS) && storageAccountType != string(storage.PremiumLRS) {
118+
return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("Invalid skuName value: %s, as Azure Stack only supports %s and %s Storage Account types.", storageAccountType, storage.PremiumLRS, storage.StandardLRS))
119+
}
118120
}
119121

120122
tags, err := azure.ConvertTagsToMap(customTags)

test/e2e/dynamic_provisioning_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ var _ = ginkgo.Describe("[blob-csi-e2e] Dynamic Provisioning", func() {
136136
Pods: pods,
137137
StorageClassParameters: map[string]string{"skuName": "Standard_GRS"},
138138
}
139+
if isAzureStackCloud {
140+
test = testsuites.DynamicallyProvisionedReadOnlyVolumeTest{
141+
CSIDriver: testDriver,
142+
Pods: pods,
143+
StorageClassParameters: map[string]string{"skuName": "Standard_LRS"},
144+
}
145+
}
139146
test.Run(cs, ns)
140147
})
141148

@@ -174,6 +181,14 @@ var _ = ginkgo.Describe("[blob-csi-e2e] Dynamic Provisioning", func() {
174181
ColocatePods: true,
175182
StorageClassParameters: map[string]string{"skuName": "Standard_RAGRS"},
176183
}
184+
if isAzureStackCloud {
185+
test = testsuites.DynamicallyProvisionedCollocatedPodTest{
186+
CSIDriver: testDriver,
187+
Pods: pods,
188+
ColocatePods: true,
189+
StorageClassParameters: map[string]string{"skuName": "Standard_LRS"},
190+
}
191+
}
177192
test.Run(cs, ns)
178193
})
179194

@@ -209,6 +224,14 @@ var _ = ginkgo.Describe("[blob-csi-e2e] Dynamic Provisioning", func() {
209224
Driver: blobDriver,
210225
StorageClassParameters: map[string]string{"skuName": "Standard_GRS"},
211226
}
227+
if isAzureStackCloud {
228+
test = testsuites.DynamicallyProvisionedReclaimPolicyTest{
229+
CSIDriver: testDriver,
230+
Volumes: volumes,
231+
Driver: blobDriver,
232+
StorageClassParameters: map[string]string{"skuName": "Standard_LRS"},
233+
}
234+
}
212235
test.Run(cs, ns)
213236
})
214237

test/e2e/suite_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const (
4646
defaultReportDir = "/workspace/_artifacts"
4747
)
4848

49+
var isAzureStackCloud = strings.EqualFold(os.Getenv("AZURE_CLOUD_NAME"), "AZURESTACKCLOUD")
4950
var blobDriver *blob.Driver
5051

5152
var bringKeyStorageClassParameters = map[string]string{

test/e2e/testsuites/specs.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ package testsuites
1818

1919
import (
2020
"fmt"
21+
"os"
22+
"strings"
2123

2224
"sigs.k8s.io/blob-csi-driver/test/e2e/driver"
2325

@@ -64,7 +66,9 @@ const (
6466
)
6567

6668
var (
67-
supportedStorageAccountTypes = []string{"Standard_LRS", "Premium_LRS", "Standard_GRS", "Standard_RAGRS"}
69+
isAzureStackCloud = strings.EqualFold(os.Getenv("AZURE_CLOUD_NAME"), "AZURESTACKCLOUD")
70+
azurePublicCloudSupportedStorageAccountTypes = []string{"Standard_LRS", "Premium_LRS", "Standard_GRS", "Standard_RAGRS"}
71+
azureStackCloudSupportedStorageAccountTypes = []string{"Standard_LRS", "Premium_LRS"}
6872
)
6973

7074
type VolumeMountDetails struct {
@@ -101,6 +105,10 @@ func (pod *PodDetails) SetupWithDynamicVolumes(client clientset.Interface, names
101105
func (pod *PodDetails) SetupWithDynamicMultipleVolumes(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver) (*TestPod, []func()) {
102106
tpod := NewTestPod(client, namespace, pod.Cmd)
103107
cleanupFuncs := make([]func(), 0)
108+
supportedStorageAccountTypes := azurePublicCloudSupportedStorageAccountTypes
109+
if isAzureStackCloud {
110+
supportedStorageAccountTypes = azureStackCloudSupportedStorageAccountTypes
111+
}
104112
accountTypeCount := len(supportedStorageAccountTypes)
105113
for n, v := range pod.Volumes {
106114
storageClassParameters := map[string]string{"skuName": supportedStorageAccountTypes[n%accountTypeCount]}

0 commit comments

Comments
 (0)