This repository contains read/write speed tests for Kubernetes Persistent Volumes (PVs). This repo is a clone from "https://github.com/phnmnl/k8s-volume-test" and make tiny modification
We assume you have:
- A Kubernetes cluster up and running with configured kubectl CLI
- A PV that supports ReadWriteMany with at least 5GB of capacity
Please clone this repository, and locate into it:
cd k8s-volume-test
Create a "LocalStorage" PersistentVolume using pv.yml
:
kubectl apply -f pv.yml
Create a PersistentVolumeClaim using pvc.yml
:
kubectl apply -f pvc.yml
Perform the write test:
kubectl apply -f write.yml
Check the write test STATUS
, and wait until it is Completed
:
kubectl get pods --show-all
Get the output of the writing test:
kubectl logs $(kubectl get pods --show-all -o jsonpath='{.items[?(@.spec.containers[*].name=="write")].metadata.name}')
Perform the read test:
kubectl apply -f read.yml
Check the write test STATUS
, and wait until it is Completed
:
kubectl get pods --show-all
Get the output of the reading test:
kubectl logs $(kubectl get pods --show-all -o jsonpath='{.items[?(@.spec.containers[*].name=="read")].metadata.name}')