Skip to content

Commit

Permalink
configurable storage class (#136)
Browse files Browse the repository at this point in the history
* configurable storage class

* change sc name and make default... default

* move change to config

* changelog
  • Loading branch information
vxav authored Aug 12, 2024
1 parent 4b8645b commit f11bc1f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 60 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Make default storage class configurable.

## [1.10.0] - 2024-07-08

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,16 @@ apiVersion: storage.k8s.io/v1
metadata:
labels:
{{- include "labels.common" $ | nindent 4 }}
{{- if .delete.isDefault }}
annotations:
storageclass.kubernetes.io/is-default-class: "true"
{{- end }}
name: csi-vsphere-sc-delete
name: csi-vsphere-sc-default
provisioner: csi.vsphere.vmware.com
reclaimPolicy: Delete
reclaimPolicy: {{ .reclaimPolicy }}
allowVolumeExpansion: true
parameters:
storagepolicyname: {{ .delete.vcdStorageProfileName | quote }}
csi.storage.k8s.io/fstype: {{ .delete.fileSystem }}
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
labels:
{{- include "labels.common" $ | nindent 4 }}
{{- if .retain.isDefault }}
annotations:
storageclass.kubernetes.io/is-default-class: "true"
{{- if .storageProfileName }}
storagepolicyname: {{ .storageProfileName | quote }}
{{- end }}
name: csi-vsphere-sc-retain
provisioner: csi.vsphere.vmware.com
reclaimPolicy: Retain
allowVolumeExpansion: true
parameters:
storagepolicyname: {{ .retain.vcdStorageProfileName | quote }}
csi.storage.k8s.io/fstype: {{ .retain.fileSystem }}
csi.storage.k8s.io/fstype: {{ .fileSystem }}
{{- end }}
{{- end }}
11 changes: 3 additions & 8 deletions config/vsphere-csi-driver/overwrites/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ config:

storageClass:
enabled: true
delete:
isDefault: true
vcdStorageProfileName: "vSAN Default Storage Policy"
fileSystem: "ext4"
retain:
isDefault: false
vcdStorageProfileName: "vSAN Default Storage Policy"
fileSystem: "ext4"
reclaimPolicy: "Delete"
fileSystem: "ext4"
# storageProfileName: "vSAN Default Storage Policy"

internalFeatureStates:
topologyPreferentialDatastores:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,16 @@ apiVersion: storage.k8s.io/v1
metadata:
labels:
{{- include "labels.common" $ | nindent 4 }}
{{- if .delete.isDefault }}
annotations:
storageclass.kubernetes.io/is-default-class: "true"
{{- end }}
name: csi-vsphere-sc-delete
name: csi-vsphere-sc-default
provisioner: csi.vsphere.vmware.com
reclaimPolicy: Delete
reclaimPolicy: {{ .reclaimPolicy }}
allowVolumeExpansion: true
parameters:
storagepolicyname: {{ .delete.vcdStorageProfileName | quote }}
csi.storage.k8s.io/fstype: {{ .delete.fileSystem }}
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
labels:
{{- include "labels.common" $ | nindent 4 }}
{{- if .retain.isDefault }}
annotations:
storageclass.kubernetes.io/is-default-class: "true"
{{- if .storageProfileName }}
storagepolicyname: {{ .storageProfileName | quote }}
{{- end }}
name: csi-vsphere-sc-retain
provisioner: csi.vsphere.vmware.com
reclaimPolicy: Retain
allowVolumeExpansion: true
parameters:
storagepolicyname: {{ .retain.vcdStorageProfileName | quote }}
csi.storage.k8s.io/fstype: {{ .retain.fileSystem }}
csi.storage.k8s.io/fstype: {{ .fileSystem }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ config:

storageClass:
enabled: true
delete:
isDefault: true
vcdStorageProfileName: "vSAN Default Storage Policy"
fileSystem: "ext4"
retain:
isDefault: false
vcdStorageProfileName: "vSAN Default Storage Policy"
fileSystem: "ext4"
reclaimPolicy: "Delete"
fileSystem: "ext4"
# storageProfileName: "vSAN Default Storage Policy"

internalFeatureStates:
topologyPreferentialDatastores:
Expand Down

0 comments on commit f11bc1f

Please sign in to comment.