mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #99122 from huffmanca/update-minimum-azure-file-size
Updates the Azure File minimum size for premium accounts
This commit is contained in:
commit
0f140bf1ee
@ -55,8 +55,9 @@ var _ volume.PersistentVolumePlugin = &azureFilePlugin{}
|
||||
var _ volume.ExpandableVolumePlugin = &azureFilePlugin{}
|
||||
|
||||
const (
|
||||
azureFilePluginName = "kubernetes.io/azure-file"
|
||||
defaultSecretNamespace = "default"
|
||||
azureFilePluginName = "kubernetes.io/azure-file"
|
||||
defaultSecretNamespace = "default"
|
||||
minimumPremiumShareSize = 100 // GB
|
||||
)
|
||||
|
||||
func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
|
||||
|
@ -207,10 +207,15 @@ func (a *azureFileProvisioner) Provision(selectedNode *v1.Node, allowedTopologie
|
||||
resourceGroup = a.options.PVC.ObjectMeta.Annotations[resourceGroupAnnotation]
|
||||
}
|
||||
|
||||
fileShareSize := int(requestGiB)
|
||||
// when use azure file premium, account kind should be specified as FileStorage
|
||||
accountKind := string(storage.StorageV2)
|
||||
if strings.HasPrefix(strings.ToLower(sku), "premium") {
|
||||
accountKind = string(storage.FileStorage)
|
||||
// when using azure file premium, the shares have a minimum size
|
||||
if fileShareSize < minimumPremiumShareSize {
|
||||
fileShareSize = minimumPremiumShareSize
|
||||
}
|
||||
}
|
||||
|
||||
accountOptions := &azure.AccountOptions{
|
||||
@ -225,7 +230,7 @@ func (a *azureFileProvisioner) Provision(selectedNode *v1.Node, allowedTopologie
|
||||
shareOptions := &fileclient.ShareOptions{
|
||||
Name: shareName,
|
||||
Protocol: storage.SMB,
|
||||
RequestGiB: requestGiB,
|
||||
RequestGiB: fileShareSize,
|
||||
}
|
||||
|
||||
account, key, err := a.azureProvider.CreateFileShare(accountOptions, shareOptions)
|
||||
@ -252,7 +257,7 @@ func (a *azureFileProvisioner) Provision(selectedNode *v1.Node, allowedTopologie
|
||||
PersistentVolumeReclaimPolicy: a.options.PersistentVolumeReclaimPolicy,
|
||||
AccessModes: a.options.PVC.Spec.AccessModes,
|
||||
Capacity: v1.ResourceList{
|
||||
v1.ResourceName(v1.ResourceStorage): resource.MustParse(fmt.Sprintf("%dGi", requestGiB)),
|
||||
v1.ResourceName(v1.ResourceStorage): resource.MustParse(fmt.Sprintf("%dGi", fileShareSize)),
|
||||
},
|
||||
PersistentVolumeSource: v1.PersistentVolumeSource{
|
||||
AzureFile: &v1.AzureFilePersistentVolumeSource{
|
||||
|
Loading…
Reference in New Issue
Block a user