Volumes allow applications running on tsuru to use external storage volumes mounted on their filesystem. There are three concepts involved in the process: volume plans, volume and volume binds.
Volume plans are managed by tsuru administrators and are configured in tsuru.conf file. Volume plans describe how each volume that will be associated to this plan will be created by each provisioner.
The following configuration register a volume plan called
ebs that is supported kubernetes their own parameters.
volume-plans: ebs: kubernetes: storage-class: my-ebs-storage-class
On Kubernetes, volume plans may use a volume plugin or a storage class.
Volumes are created by tsuru users using one of the plans previously configurated. These can be created and managed by using the tsuru client. The behavior is provisioner specific:
On Kubernetes provisioner¶
Creating a volume with a plan that has no storage-class defined will cause tsuru to manually create one PersistentVolume using the plugin specified in the plan with the opt received in the command line. Also, one PersistentVolumeClaim would be created and bound to the PersistentVolume.
If the plan specifies a storage-class instead of a plugin only the PersistentVolumeClaim will be created using the specified storage-class.
Volumes binds, like service binds, associate a given application to a previously created volume. This is the moment when the volume will be made available to the application by the provisioner. The bind/unbind actions can be triggered by the tsuru client.
ebs volume plan is registered in tsuru configuration, one can create a volume using:
To be able to use this volume from an app, bind to it:
Volumes with Minikube¶
volume-plans: minikube-plan: kubernetes: storage-class: standard
Then, to create a volume and bind it to your app:
tsuru volume create my-vol minikube-plan -p my-kubernetes-pool -t my-team -o capacity=1Gi -o access-modes=ReadWriteMany tsuru volume bind my-vol /mnt/mountpoint -a my-app