Skip to content

Commit

Permalink
Merge pull request #190 from stg-0/fix/storageclass-expansion
Browse files Browse the repository at this point in the history
Fix: enable volumeExpansion in StorageClasses
  • Loading branch information
stg-0 authored Jul 3, 2023
2 parents 4c33234 + 5b20a3d commit bfede43
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions pkg/build/nodeimage/const_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ metadata:
namespace: kube-system
annotations:
storageclass.kubernetes.io/is-default-class: "true"
allowVolumeExpansion: true
provisioner: rancher.io/local-path
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete
Expand Down
7 changes: 4 additions & 3 deletions pkg/cluster/internal/create/actions/createworker/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ var storageClassAWSTemplate = StorageClassDef{
},
Name: "keos",
},
Provisioner: "ebs.csi.aws.com",
Parameters: make(map[string]interface{}),
VolumeBindingMode: "WaitForFirstConsumer",
AllowVolumeExpansion: true,
Provisioner: "ebs.csi.aws.com",
Parameters: make(map[string]interface{}),
VolumeBindingMode: "WaitForFirstConsumer",
}

var standardAWSParameters = commons.SCParameters{
Expand Down
7 changes: 4 additions & 3 deletions pkg/cluster/internal/create/actions/createworker/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ var storageClassAZTemplate = StorageClassDef{
},
Name: "keos",
},
Provisioner: "disk.csi.azure.com",
Parameters: make(map[string]interface{}),
VolumeBindingMode: "WaitForFirstConsumer",
AllowVolumeExpansion: true,
Provisioner: "disk.csi.azure.com",
Parameters: make(map[string]interface{}),
VolumeBindingMode: "WaitForFirstConsumer",
}

var standardAZParameters = commons.SCParameters{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile
allowVolumeExpansion: true
provisioner: file.csi.azure.com
mountOptions:
- mfsymlinks
Expand All @@ -17,6 +18,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-csi
allowVolumeExpansion: true
provisioner: file.csi.azure.com
mountOptions:
- mfsymlinks
Expand All @@ -31,6 +33,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-csi-premium
allowVolumeExpansion: true
provisioner: file.csi.azure.com
mountOptions:
- mfsymlinks
Expand All @@ -45,6 +48,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-premium
allowVolumeExpansion: true
provisioner: file.csi.azure.com
mountOptions:
- mfsymlinks
Expand All @@ -61,6 +65,7 @@ metadata:
annotations:
storageclass.kubernetes.io/is-default-class: "true"
name: default
allowVolumeExpansion: true
provisioner: disk.csi.azure.com
parameters:
skuname: StandardSSD_LRS
Expand All @@ -71,6 +76,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed
allowVolumeExpansion: true
provisioner: disk.csi.azure.com
parameters:
cachingmode: ReadOnly
Expand All @@ -83,6 +89,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-csi
allowVolumeExpansion: true
provisioner: disk.csi.azure.com
parameters:
skuname: StandardSSD_LRS
Expand All @@ -93,6 +100,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-csi-premium
allowVolumeExpansion: true
provisioner: disk.csi.azure.com
parameters:
skuname: Premium_LRS
Expand All @@ -103,6 +111,7 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-premium
allowVolumeExpansion: true
provisioner: disk.csi.azure.com
parameters:
cachingmode: ReadOnly
Expand Down
7 changes: 4 additions & 3 deletions pkg/cluster/internal/create/actions/createworker/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ var storageClassGCPTemplate = StorageClassDef{
},
Name: "keos",
},
Provisioner: "pd.csi.storage.gke.io",
Parameters: make(map[string]interface{}),
VolumeBindingMode: "WaitForFirstConsumer",
AllowVolumeExpansion: true,
Provisioner: "pd.csi.storage.gke.io",
Parameters: make(map[string]interface{}),
VolumeBindingMode: "WaitForFirstConsumer",
}

var standardGCPParameters = commons.SCParameters{
Expand Down
7 changes: 4 additions & 3 deletions pkg/cluster/internal/create/actions/createworker/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ type StorageClassDef struct {
Annotations map[string]string `yaml:"annotations,omitempty"`
Name string `yaml:"name"`
} `yaml:"metadata"`
Provisioner string `yaml:"provisioner"`
Parameters map[string]interface{} `yaml:"parameters"`
VolumeBindingMode string `yaml:"volumeBindingMode"`
AllowVolumeExpansion bool `yaml:"allowVolumeExpansion"`
Provisioner string `yaml:"provisioner"`
Parameters map[string]interface{} `yaml:"parameters"`
VolumeBindingMode string `yaml:"volumeBindingMode"`
}

func getBuilder(builderType string) PBuilder {
Expand Down

0 comments on commit bfede43

Please sign in to comment.