# Error in creating cluster with option persistentVolumeReclaimPolicy: Retain after upgrading from 1.0.1 to 1.1.2

**URL:** <https://discuss.elastic.co/t/error-in-creating-cluster-with-option-persistentvolumereclaimpolicy-retain-after-upgrading-from-1-0-1-to-1-1-2/235073>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [May 31, 2020, 3:30pm UTC](https://discuss.elastic.co/t/error-in-creating-cluster-with-option-persistentvolumereclaimpolicy-retain-after-upgrading-from-1-0-1-to-1-1-2/235073 "2020-05-31T15:30:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmad\_Al-Masry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmad_al-masry/32/65270_2.png) [@Ahmad\_Al-Masry](https://discuss.elastic.co/u/Ahmad_Al-Masry)\
**Post date:** [May 31, 2020, 3:30pm UTC](https://discuss.elastic.co/t/error-in-creating-cluster-with-option-persistentvolumereclaimpolicy-retain-after-upgrading-from-1-0-1-to-1-1-2/235073/1 "2020-05-31T15:30:00Z")

</div>

Hi  
After upgrading to 1.1.2 I got error from kubectl -n elastic-system logs -f statefulset.apps/elastic-operator about persistentVolumeReclaimPolicy is not a valid filed, and after removing persistentVolumeReclaimPolicy: Retain from my configuration it worked. the following is he volum configuration I used knowing that this configuration is working since 0.9 beta and also worked when I upgraded to 1.0.1, but only crashed after upgrading to 1.1.2

> ```
> volumeClaimTemplates:
> - metadata:
> name: elasticsearch-data
> spec:
> persistentVolumeReclaimPolicy: Retain
> accessModes:
> - ReadWriteOnce
> resources:
> requests:
> storage: 256Gi
> storageClassName: ebs-csi-gp2-sc
> 
> ```

I do not know if this is a feature or a problem in the validator, but I think it worth mentioning, because we tend to retain the volumes and the default is delete.

---

<div class="post-metadata">

**Author:** ![charith-elastic](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@charith-elastic](https://discuss.elastic.co/u/charith-elastic)\
**Post date:** [June 1, 2020, 8:08am UTC](https://discuss.elastic.co/t/error-in-creating-cluster-with-option-persistentvolumereclaimpolicy-retain-after-upgrading-from-1-0-1-to-1-1-2/235073/2 "2020-06-01T08:08:33Z")

</div>

[`VolumeClaimTemplates` is a field containing an array of `PersistentVolumeClaimSpec` objects](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-api-elasticsearch-k8s-elastic-co-v1.html#k8s-api-github-com-elastic-cloud-on-k8s-pkg-apis-elasticsearch-v1-nodeset). `PersistentVolumeClaimSpec` objects do not have a field named `persistentVolumeReclaimPolicy`: [https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#persistentvolumeclaimspec-v1-core](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#persistentvolumeclaimspec-v1-core).

The [`StorageClass`](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) defines the reclaim policy -- which is set through the `storageClassName` field. You already have set this field to `ebs-csi-gp2-sc` so you should take a look at the definition of the `ebs-csi-gp2-sc` storage class to make sure it has the correct `reclaimPolicy` defined on it.

```auto
kubectl get sc ebs-csi-gp2-sc

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:00am UTC](https://discuss.elastic.co/t/error-in-creating-cluster-with-option-persistentvolumereclaimpolicy-retain-after-upgrading-from-1-0-1-to-1-1-2/235073/3 "2022-11-04T08:00:28Z")

</div>


