Files
krkn/docs/pvc_scenario.md
T
Alejandro Gullón baa812b7f0 Added new scenario to fill up a given volumen (#182)
* Added new scenario to fill up a given volumen

* fixing small issues and style

* adding PVC as input param instead of pod name

* small fix

* get container name and volumen name
replace oc with kubectl commands

* adding yaml file to create a pv, pvc and pod to run pvc_scenario

* adding support to match both string for describe command when looking for pod_name

* added support to find the pvc from a given pod

* small fix

* small fix
2021-11-24 12:18:49 -05:00

1.3 KiB

PVC scenario

Scenario to fill up a given PersistenVolumeClaim by creating a temp file on the PVC from a pod associated with it. The purpose of this scenario is to fill up a volume to understand faults cause by the application using this volume.

Sample scenario config
pvc_scenario:
  pvc_name: <pvc_name>          # Name of the target PVC
  pod_name: <pod_name>          # Name of the pod where the PVC is mounted, it will be ignored if the pvc_name is defined
  namespace: <namespace_name>   # Namespace where the PVC is
  fill_percentage: 50           # Target percentage to fill up the cluster, value must be higher than current percentage, valid values are between 0 and 99
  duration: 60                  # Duration in seconds for the fault
Steps
  • Get the pod name where the PVC is mounted
  • Get the volume name mounted in the container pod
  • Get the container name where the PVC is mounted
  • Get the mount path where the PVC is mounted in the pod
  • Get the PVC capacity and current used capacity
  • Calculate file size to fill the PVC to the target fill_percentage
  • Connect to the pod
  • Create a temp file kraken.tmp with random data on the mount path:
    • dd bs=1024 count=$file_size </dev/urandom > /mount_path/kraken.tmp
  • Wait for the duration time
  • Remove the temp file created:
    • rm kraken.tmp