Table of Contents
Table of Contents
Further Reading
What Does Volume Mean?
In Kubernetes, a volume is a storage resource attached to a pod. Containers within that pod can use it to persist and share data.
Container file systems are ephemeral and disappear when a container stops. Volumes provide a stable location where files and test artifacts stay accessible during and after execution.
Common Kubernetes Volume Types
Why Volumes Matter
Volumes maintain state and data consistency in containerized environments. In testing workflows, they help teams:
- Preserve logs, reports, and results after containers stop running
- Share data between multiple containers in a single pod
- Keep test data available for debugging and analysis
- Connect external storage such as AWS EBS or NFS for scale
- Keep environments consistent across executions
Without volumes, data generated during a test disappears when the container terminates.
How Volumes Work with Testkube
- Custom volume mounts: Testkube workflows can mount Kubernetes volumes into test pods for data, configuration, or large datasets.
- Shared workspace: Steps in a workflow can share files, such as checked-out tests or generated reports.
- Artifact storage: Logs, outputs, and artifacts from each execution are collected and stored centrally, so they remain available after pods are deleted.
- Kubernetes-native integration: Workflows use standard volume definitions, including PersistentVolumeClaims, ConfigMaps, and Secrets.
- Storage compatibility: Any storage backend your cluster supports, cloud or on-premises, can back test volumes.
Real-World Example
A B2B SaaS team runs a nightly data migration test against a large anonymized dataset. Downloading the dataset every night slowed the run and raised costs.
- Provision once: the team stores the dataset on a PersistentVolumeClaim.
- Mount in the workflow: the Testkube workflow mounts the volume read-only into the test pod.
- Keep results: reports and logs are saved as artifacts for review the next morning.
Runs start faster, and the team can still inspect results long after the pod is gone.
Best Practices for Volumes in Testing
- Choose the right lifetime: Use emptyDir for scratch space and PersistentVolumeClaims for data that must survive.
- Mount read-only when possible: Protect shared datasets from accidental changes.
- Keep secrets in Secret volumes: Never bake credentials into images.
- Clean up unused claims: Orphaned volumes add storage cost.
- Size storage realistically: Large reports and videos can fill small volumes quickly.



