diff --git a/Dockerfile b/Dockerfile index fee3fa53..343b278b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM centos:7 -FROM centos:7 - # Update the CentOS repository configuration RUN sed -i 's|mirrorlist=http://mirrorlist.centos.org/?|#mirrorlist=http://mirrorlist.centos.org/?|g' /etc/yum.repos.d/CentOS-*.repo && \ sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo diff --git a/helm/operator/templates/hwameistorcluster.yaml b/helm/operator/templates/hwameistorcluster.yaml index 57f05860..9f1b2a4b 100644 --- a/helm/operator/templates/hwameistorcluster.yaml +++ b/helm/operator/templates/hwameistorcluster.yaml @@ -255,7 +255,7 @@ spec: chartVersion: "v0.4.1" storageClass: allowVolumeExpansion: true - reclaimPolicy: "Delete" + reclaimPolicy: {{ $.Values.storageClassReclaimPolicy }} fsType: "xfs" dataLoadManager: diff --git a/helm/operator/values.yaml b/helm/operator/values.yaml index 1d3978a6..70b2e0d3 100644 --- a/helm/operator/values.yaml +++ b/helm/operator/values.yaml @@ -183,6 +183,8 @@ dataLoadInit: imageRepository: hwameistor/dataload-init tag: v0.0.1 + +#storageClassReclaimPolicy: Retain > Delete #datasetDefaultPoolClass: NVMe > SSD > HDD # diskReserve example diff --git a/pkg/install/storageclass/storageclass.go b/pkg/install/storageclass/storageclass.go index c97933f4..9db2b9a2 100644 --- a/pkg/install/storageclass/storageclass.go +++ b/pkg/install/storageclass/storageclass.go @@ -34,7 +34,7 @@ func NewMaintainer(cli client.Client, clusterInstance *hwameistoroperatorv1alpha var volumeBindingWaitForFirstConsumer = storagev1.VolumeBindingWaitForFirstConsumer var defaultAllowVolumeExpansionBooleanValue = true -var defaultReclaimPolicy = corev1.PersistentVolumeReclaimDelete +var defaultReclaimPolicy = corev1.PersistentVolumeReclaimRetain var defaultDiskType = "HDD" var defaultFSType = "xfs"