Volumes
Use volumes in your tensorkube deployments
Volumes in tensorkube provide persistent storage solutions, ensuring data longevity across pod restarts and deployments. By attaching volumes to your deployments, you can maintain stateful data, making it ideal for applications requiring consistent data access and storage.
tensorkube volume
The tensorkube volume
command group allows you to manage volumes for your Tensorkube cluster. These commands enable you to create, delete, and list volumes, which can be used to persist data across deployments.
Commands
-
create: Create a new volume for your Tensorkube cluster.
- Options:
--name
: Name of the volume (required).--vol-type
: Type of volume (required, currently onlyefs
is supported).
Example:
- Options:
-
delete: Delete a volume from your Tensorkube cluster.
- Options:
--name
: Name of the volume (required).--vol-type
: Type of volume (required, currently onlyefs
is supported).
Example:
- Options:
-
list: List all the volumes in the Tensorkube cluster.
- Options:
--vol-type
: Volume type (optional, currently onlyefs
is supported).
Example:
- Options:
Using Volumes During Deployment
Steps
-
Create a Volume: First, create a volume using the
tensorkube volume create
command. -
Deploy Your Application: When deploying your application, specify the volumes to be used. This can be done by including the volume configuration in your deployment config YAML file.
Example Deployment YAML:
config.yaml -
Access the Volume: Your application can now read from and write to the volume at the specified mount path (
/mnt/my-efs-volume
in the example above).
Your mount_path
must match the regex r'^(\/[a-zA-Z0-9._-]+)+\/?$'
; i.e. it must
- Begin with a forward slash
/
, i.e. you must specify the absolute path from the root directory in the container where you want to mount your volume - Contain only alphanumeric characters and hyphens
-
, underscores_
or periods.
Following these steps will enable you to effectively use volumes to manage persistent data in your Tensorkube deployments.