# Persistent local storage

**URL:** <https://forums.suse.com/t/persistent-local-storage/11966>\
**Category:** SUSE Rancher Prime\
**Created:** [October 8, 2018, 7:14am UTC](https://forums.suse.com/t/persistent-local-storage/11966 "2018-10-08T07:14:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mark](https://forums.suse.com/u/mark)\
**Post date:** [October 8, 2018, 7:14am UTC](https://forums.suse.com/t/persistent-local-storage/11966/1 "2018-10-08T07:14:20Z")

</div>

Good day,

I’ve been trying for hours to get this right but to no avail, so any help would be greatly appreciated.

I’m trying to set up a postgresql chart (from the Catalog Apps) with persistent local storage for test environments. My issue is I cannot get it to persist the volume locally to a chosen directory.

On the cluster I created a persistent volume:

- Volume Plugin = Local Node Path
- Capacity = 20GiB
- path on the Node = /opt/postgresql (I created this directory on the rancheros file system)
- The Path on the Node must be = A directory, or create if it does not exist
- Access Modes = Single Node Read-Write
- Mount Options = none
- Assign to Storage Class = none
- Node Affinity = No node Selectors

On the project I created a persistent volume claim bound to the persistent volume:

- Access Modes = Single Node Read-Write

On the postgres chart I’m using:

- persistence.existingClaim = MY\_PVC
- using a username and password. Tried various combinations of the persistence options to no avail.

Ultimately I cannot get the mount point contents /var/lib/postgresql/data/pgdata to persist on the nodes local filesystem

---

<div class="post-metadata">

**Author:** ![masterl](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/masterl/32/10013_2.png) [@masterl](https://forums.suse.com/u/masterl)\
**Post date:** [July 30, 2023, 6:16am UTC](https://forums.suse.com/t/persistent-local-storage/11966/2 "2023-07-30T06:16:56Z")

</div>

Any luck?  
I am thinking it shouldn’t be that hard to install postgresql yet here we are! 9 hrs later I can’t get it working

---

<div class="post-metadata">

**Author:** ![mrcaldo](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@mrcaldo](https://forums.suse.com/u/mrcaldo)\
**Post date:** [July 30, 2023, 10:16am UTC](https://forums.suse.com/t/persistent-local-storage/11966/4 "2023-07-30T10:16:10Z")

</div>

I have created the persistent volume on a node. Then I added the Persistent Volume Claim.

I successfully installed PostgresQL using the helmet chart with the created PVC and node affinity for the node with the PV.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/d/d34a1a46778b5d5481c76ea4e8ccebdb790bb47c.png)
