stakater/storage

Chart version: 1.0.7
Api version: v1
App version: 1.0.0
Chart that deploys PV and PVC for use with any application
application
Chart Type
Active
Status
Unknown
License
503
Downloads
https://stakater.github.io/stakater-charts
Set me up:
helm repo add center https://repo.chartcenter.io
Install Chart:
helm install storage center/stakater/storage
Versions (0)

storage

This chart is used to apply pv and pvc. You can specify any number of pv and pvc. This chart can come in handy when a public chart does not offer additional pv and pvc. You have to use the following format to specify pv and pvc:

Volumes:
- name: storage-volume
  annotations: {}
  labels:
    app: appname
  accessModes:
  - ReadWriteOnce
  storage: 10Gi
  nfs:
    server: fs-blabla.efs.eu-west-1.amazonaws.com
    path: /home/storage

Claims:
- name: storage-volume-claim
  annotations: {}
  storageClassName: efs
  storage: 10Gi
  volumeName: storage-volume
  labels:
    app: appname
  accessModes:
  - ReadWriteOnce

For installing the chart, run the following command:

helm repo add stable https://kubernetes-charts.storage.googleapis.com/

helm repo update

helm install stable/storages -f values.yaml --namespace <namespace-name>

Usage

The following quickstart let’s you set up secret:

  1. Update the values.yaml and set the following properties
Key Description Example Default Value
Volumes.name name of the volume test storage-volume
Volumes.annotations annotations for volume {}
Volumes.accessModes accessModes of the volume ReadWriteOnce ReadWriteOnce
Volumes.labels label for volume app: app-name app: app-name
Volumes.storage storage size for volume 8Gi 8Gi
Volumes.claimRef.name Name of claim reference storage-data
Volumes.nfs.server server for volume fs-blabla.efs.eu-west-1.amazonaws.com fs-blabla.efs.eu-west-1.amazonaws.com
Volumes.nfs.path path for volume /home/storage /home/storage
Claims.name name of the claim storage-volume-claim storage-volume-claim
Claims.annotations annotations for claim {}
Claims.accessModes accessModes of the claim ReadWriteOnce ReadWriteOnce
Claims.labels label for claim app: app-name app: app-name
Claims.storage storage size for claim 8Gi 8Gi
Claims.storageClassName storageClass name for claim efs efs
Claims.volumeName volume name for claim storage-volume storage-volume

Example

Storage chart is used to create persistent volumes and persistent volume claims for other charts which does not support creation of additional volumes and claims. For example, we need additional storage for jenkins chart but there is no support for creation of additional PV and PVCs. Below are the steps, that explain how to achieve this using storage chart.

  • Update the values.yaml file to create a persistent volume claim.
Claims:
- name: jenkins-mvn-local-repo
  annotations:
    volume.beta.kubernetes.io/storage-class: efs
    helm.sh/resource-policy: keep
  storage: 8Gi
  # if you speicify storageClassName then volumeName is ignored and claim is made with storageClass instead of volume
  storageClassName: "efs"
  # volumeName: storage-volume
  labels:
    app: jenkins
  accessModes:
  - ReadWriteOnce
  • Deploy the storage chart. This will create a persistent volume claim with name jenkins-mvn-local-repo having 8Gi of storage.
  • Now, to mount this PVC in jenkins, update the values.yaml in jenkins chart. We need to update the volumes and mounts under Persistence
  volumes:
  - name: jenkins-mvn-local-repo
    persistentVolumeClaim:
      claimName: jenkins-mvn-local-repo
  mounts:
  - mountPath: /mvn-data
    name: jenkins-mvn-local-repo
  • Deploy the jenkins chart and we can see the additional PVC jenkins-mvn-local-repo mounted on path /mvn-data.