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 only efs is supported).

    Example:

    tensorkube volume create --name my-volume --vol-type efs
    
  • delete: Delete a volume from your Tensorkube cluster.

    • Options:
      • --name: Name of the volume (required).
      • --vol-type: Type of volume (required, currently only efs is supported).

    Example:

    tensorkube volume delete --name my-volume --vol-type efs
    
  • list: List all the volumes in the Tensorkube cluster.

    • Options:
      • --vol-type: Volume type (optional, currently only efs is supported).

    Example:

    tensorkube volume list --vol-type efs
    

Using Volumes During Deployment

Steps

  1. Create a Volume: First, create a volume using the tensorkube volume create command.

    tensorkube volume create --name my-volume --vol-type efs
    
  2. 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
     env: default
     gpus: 1
     gpu_type: a10g
     volumes:
       - name: my-volume
         type: efs
         mount_path: /mnt/my-efs-volume
    
  3. 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.