diff --git a/contexts/_template/features/provider-aws.yaml b/contexts/_template/features/provider-aws.yaml index 292f398d2..47f0dcbff 100644 --- a/contexts/_template/features/provider-aws.yaml +++ b/contexts/_template/features/provider-aws.yaml @@ -39,5 +39,5 @@ kustomize: - policy-resources components: - aws-ebs - cleanup: - - pvcs + substitutions: + single_storage_type: ${cluster.storage?.single_storage_type ?? "gp3"} diff --git a/contexts/_template/features/provider-azure.yaml b/contexts/_template/features/provider-azure.yaml index baceb1165..63daef052 100644 --- a/contexts/_template/features/provider-azure.yaml +++ b/contexts/_template/features/provider-azure.yaml @@ -35,5 +35,7 @@ kustomize: path: csi dependsOn: - policy-resources - cleanup: - - pvcs + components: + - azure-disk + substitutions: + single_storage_type: ${cluster.storage?.single_storage_type ?? "StandardSSD_LRS"} diff --git a/contexts/_template/schema.yaml b/contexts/_template/schema.yaml index b99fdbc17..5a7666769 100644 --- a/contexts/_template/schema.yaml +++ b/contexts/_template/schema.yaml @@ -152,6 +152,13 @@ properties: default: ["/var/mnt/local"] description: Additional volume mounts for workers additionalProperties: false + storage: + type: object + properties: + single_storage_type: + type: string + description: Storage type for the single storage class (e.g., gp3 for AWS, StandardSSD_LRS for Azure) + additionalProperties: false additionalProperties: false # DNS configuration diff --git a/kustomize/csi/aws-ebs/storageclass.yaml b/kustomize/csi/aws-ebs/storageclass.yaml index 711d548d3..a545ef25d 100644 --- a/kustomize/csi/aws-ebs/storageclass.yaml +++ b/kustomize/csi/aws-ebs/storageclass.yaml @@ -6,8 +6,9 @@ metadata: storageclass.kubernetes.io/is-default-class: "true" provisioner: ebs.csi.aws.com volumeBindingMode: WaitForFirstConsumer +allowVolumeExpansion: true parameters: - type: gp3 + type: ${single_storage_type:-gp3} encrypted: "true" fsType: ext4 reclaimPolicy: Delete diff --git a/kustomize/csi/azure-disk/kustomization.yaml b/kustomize/csi/azure-disk/kustomization.yaml new file mode 100644 index 000000000..0237a1186 --- /dev/null +++ b/kustomize/csi/azure-disk/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component +resources: + - storageclass.yaml diff --git a/kustomize/csi/azure-disk/storageclass.yaml b/kustomize/csi/azure-disk/storageclass.yaml new file mode 100644 index 000000000..9716bfa9e --- /dev/null +++ b/kustomize/csi/azure-disk/storageclass.yaml @@ -0,0 +1,14 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: single + annotations: + storageclass.kubernetes.io/is-default-class: "true" +provisioner: disk.csi.azure.com +volumeBindingMode: WaitForFirstConsumer +allowVolumeExpansion: true +parameters: + skuName: ${single_storage_type:-StandardSSD_LRS} + cachingMode: ReadWrite + fsType: ext4 +reclaimPolicy: Delete