charts

Add a new persistent volume to a subchart

There are 3 steps to add a new persistent volume to a subchart:

Step details

Step 1:

Declare new block described as below into global.sharedPersistenceVolume variable in values.yaml file of stack chart

Meaning of each value above:

After added this block into global.sharedPersistenceVolume variable, chart shared-volume will automatically for loop through global.sharedPersistenceVolume variable and create all declared persistent volume claim. So it is necessary to include shared-volume into stack chart

Step 2:

Add helm template for the persistent volume in chart host-path-pv with format described as below (example of icinga2-scripts-volume):

Step 3:

In the volumes block of a deployment or statefulset in a subchart, add code described as below:

The if statement ensures only persistent volume used by that subchart be listed.