Volume
Volumes Explained
Volumes allow applications running on Shipa to use external storage volumes mounted on their filesystem. There are three concepts involved in the process: volume plans, volumes, and volume bind. Volumes equate to Persistent Volumes in Kubernetes.
Volume Plans
Volume plans are managed by Shipa operators and can be configured through both the Shipa Dashboard and CLI. Volume plans describe how each provisioner will create each volume associated with this plan.
Supporting information is available through the sections below and on the Shipa Website:
Volumes
Volumes are created by Shipa users using one of the available Volume Plans. These can be created and managed through both the Shipa CLI and Dashboard.
When managing volumes through Shipa, PersistentVolumeClaim bound to the PersistentVolume is automatically created.
Supporting information is available through the sections below:
Volume Binds
Volume bind associates a given application to a previously created volume. This is the moment when the volume is made available to the application by the provisioner. The bind/unbind actions can be triggered using the Shipa client.
Supporting information is available through the sections below:
Creating New Volumes
shipa volume create <volume-name> <plan-name> [-k/--framework <framework>] [-t/--team <team>] [-c/--capacity] [-am/--access-modes] [-o/--opt key=value]...
The command above creates a new persistent volume based on an existing volume plan.
Flag | Description |
---|---|
--m, --access-modes | (= "") access-mode for the volume, such as ReadWriteOnce. (mandatory) |
-c, --capacity | (= "") The size of the volume that should be created by Shipa (mandatory) |
-o, --opt | (= {}) Any additional options that should be used by Shipa when creating the volume (not mandatory) |
-k, --framework | (= "") the framework that owns the service (mandatory if the user has access to more than one framework) |
-t, --team | (= "") the team that owns the service (mandatory if the user has access to more than one team) |
Updating Existing Volumes
shipa volume update <volume-name> <plan-name> [-k/--framework <framework>] [-t/--team <team>] [-c/--capacity] [-am/--access-modes] [-o/--opt key=value]...
The command above updates an existing persistent volume.
-o, --opt | (= {}) backend specific volume options |
-k, --framework | (= "") the framework that owns the service (mandatory if the user has access to more than one framework) |
-t, --team | (= "") the team that owns the service (mandatory if the user has access to more than one team) |
--am, --access-modes | (= "") access-mode for the volume, such as ReadWriteOnce. (mandatory) |
-c, --capacity | (= "") The size of the volume that should be created by Shipa (mandatory) |
Deleting Volumes
shipa volume delete <volume-name>
Deletes an existing persistent volume.
Listing Volumes
shipa volume list
Lists existing persistent volumes.
Creating Volume Plans
shipa volume plan create <name> [--storage-class class]
Creates a volume plan that will be used by Shipa and users when managing volumes. A volume plan is a logical grouping of Volumes. To find the storage class, can check the Kubernetes Storage Class Documentation or run a kubectl command. E.g under name "gp2" would be the Storage Class.
kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
gp2 (default) kubernetes.io/aws-ebs Delete WaitForFirstConsumer false 4h38m
Flags:
Flag | Description |
---|---|
--storage-class | (= "") Storage class name configured on Kubernetes for the chosen CSI provider (mandatory) |
Listing Volume Plans
shipa volume plan list
Lists existing volume plans.
Binding Volumes to Applications
shipa volume bind <volume-name> <mount point> [-a/--app <appname>] [-r/--readonly] [--no-restart]
Binds an existing volume to an application.
Flags:
Flag | Description |
---|---|
-a, --app | (= "") The name of the application |
--no-restart | (= false) prevents restarting the application |
-r, --readonly | (= false) the volume will be available only for reading |
Unbinding Volumes from Applications
shipa volume unbind <volume-name> <mount point> [-a/--app <appname>]
Unbinds a volume from an application.
Flags:
Flag | Description |
---|---|
-a, --app | (= "") The name of the application |
--no-restart | (= false) prevents restarting the application |
Validating Shipa Volume
You can Shell into the running container and validate the Volume is presented to the container. If a volume was bound at "var/shiparocks" for example.
shipa app list
shipa app shell -a portal
ls -l /var/shiparocks
Updated about 1 year ago