โ๏ธConfigure persistence
Parameters
To configure the persistence of our Helm Charts, each component of the stack has a persistence field.
Here's the list of field:
laputa:
persistence: # ...
curity:
admin:
persistence: # ...
postgresql:
primary:
persistence: # ...
mongodb:
persistence: # ...
garage:
persistence:
meta:
# ...
data:
# ...
layout-redis:
master:
persistence: # ...
laputa-redis:
master:
persistence: # ...
impersonate-redis:
master:
persistence: # ...
dataexecution-redis:
master:
persistence: # ...In which, we've enabled and disabled the persistence of each component, based on the needs of the deployment. For example, most Redis doesn't need to be persisted and can be disabled.
Here's a common list of options for the persistence field:
Dynamic provisioning
To dynamically provision storage, we use a StorageClass. StorageClass is a Kubernetes resource defined by a storage provisioner, which is itself provided by the cloud provider, or by your Kubernetes administrator.
You can list the available provisioners with:
For the sake of the example, we will use local-path as our storage provisioner.
Your StorageClass should look like this:
Behind the scenes of the Helm Chart, persistence is actually a PersistentVolumeClaimTemplate. This is used to generate a PersistentVolumeClaim for each replica of the StatefulSet.
To ask for a volume, simply set:
Upon deployment, the StatefulSet will create a PersistentVolumeClaim with the requested size, which will trigger the creation of a PersistentVolume.
If you think the Helm Chart is too limiting, you can always create your own PVC and set the existingClaim field.
Apply it:
In which, you can set the existingClaim field:
Feel free to check the availables parameters of a PersistentVolumeClaim at the Kubernetes documentation - Persistent Volumes.
Static provisioning
For the sake of the example, we will use hostPath with a node selector. If you are interested in other options, you might be interested in checking out Container Storage Interface (CSI) Drivers.
To statically provision a volume, you need to create a PersistentVolume:
Apply it:
Simply set:
You probably want to claim it with a PersistentVolumeClaim:
Apply it:
In which, you can set the existingClaim field:
Last updated
Was this helpful?