Kubestr – Open-Source Kubernetes Storage benchmarking tool
Tags: kubernetes, benchmark, kubestr, storage
Published: 2021-04-13 22:27:31

---
title: Kubestr – Open-Source Kubernetes Storage benchmarking tool
published: true
date: 2021-04-07 21:20:08 UTC
tags: Kubernetes,benchmark,kubestr,Storage
canonical_url: https://veducate.co.uk/kubestr/?utm_source=rss&utm_medium=rss&utm_campaign=kubestr
---

Kubernetes is a platform which is starting to lose the need for introduction in most settings. However, it still can be a complex beast to get to grips with, and getting your infrastructure components configured correctly is key to providing a successful Kubernetes environment for your applications.

One of these such areas is storage.

- Remember the days of [performance testing](https://kb.vmware.com/s/article/2019131) your iSCSI or Fibre Channel SANs for your virtualisation platform?
- Creating [storage based policy management](https://blogs.vmware.com/virtualblocks/2017/01/16/understanding-storage-policy-based-management/) objects in vCenter for your SANs capabilities
- [Integrating your backup solution to use storage snapshots.](https://veducate.co.uk/first-look-leveraging-nimble-secondary-flash-array-veeam-setup-guide/)

With your Kubernetes platform, you need to ensure a correct storage configuration, and benchmark your storage performance, like you would with any other platform. Then test the container storage features such as snapshots of the persistent volumes.

The configuration for each vendor when integrating with Kubernetes will be different, but the outcomes should be the same.

###### What is Kubestr?

Enter Kubestr, the Open-Source project tool from Kasten by Veeam, designed to help with ensuring your storage is configured correctly, help you benchmark the performance and test features such as snapshots.

###### Getting started with Kubestr

Simply [Download Kubestr](https://github.com/kastenhq/kubestr/releases/) for the platform you wish to run the tool from. For me I’ll be running it from my Mac OS X machine, which has connectivity to my Kubernetes platform (AWS EKS, I used [this blog to create it](https://vzilla.co.uk/vzilla-blog/getting-started-with-amazon-elastic-kubernetes-service-amazon-eks)).

I extracted the zip file and have the Kubestr command line tool available in the output folder.

[![kubestr download and extract](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-download-and-extract.jpg?resize=604%2C77&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-download-and-extract.jpg?ssl=1)

Running the tool for the first time will run some tests and output a number of useful items of information on how we can use the tool. Which I will start to breakdown as we continue.

For Kubestr to run, it will use the active context in your kubectl configuration file.

[![kubestr first run](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-first-run.jpg?resize=604%2C616&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-first-run.jpg?ssl=1)

Green Box – we have our initial checks.

- Kubernetes version
- RBAC check
- Kubernetes Aggregated layer check

Then we have the details from our available storage provisioners that are installed for our cluster. You can see what I have two installed.

Red Box – this is my default in-tree provisioner

1. Storage class names associated to this provisioner
2. Which Kubestr tests can be run for this provisioner. For an in-tree provisioner we can only run FIO benchmarks.

Purple box – this is my AWS CSI driver.

- We have details of the installed provisioner.

1. Storage class names and Volume Snapshot class names associated with this CSI Driver.
2. Which Kubestr tests can be run for this provisioner. For our CSI, we can run both FIO Benchmarks, and because we have the Volume Snapshot support enabled, tests for CSI Snapshot and restore of data functionality tests.

So, we now understand that against our storage we can run the following two actions:

- fio – for storage benchmarks. This is based on the linux tool [Flexible I/O tester.](https://linux.die.net/man/1/fio)

```
> ./kubestr fio -h
Run an fio test

Usage:
kubestr fio [flags]

Flags:
-f, --fiofile string The path to a an fio config file.
-h, --help help for fio
-i, --image string The container image used to create a pod.
-n, --namespace string The namespace used to run FIO. (default "default")
-z, --size string The size of the volume used to run FIO. (default "100Gi")
-s, --storageclass string The name of a Storageclass. (Required)
-t, --testname string The Name of a predefined kubestr fio test. Options(default-fio)

Global Flags:
-o, --output string Options(json)
```

- csicheck – Validates a CSI provisioners ability to take a snapshot of an application and restore it.

```
> ./kubestr csicheck -h
Validates a CSI provisioners ability to take a snapshot of an application and restore it

Usage:
  kubestr csicheck [flags]

Flags:
  -c, --cleanup Clean up the objects created by tool (default true)
  -h, --help help for csicheck
  -i, --image string The container image used to create a pod.
  -n, --namespace string The namespace used to run the check. (default "default")
  -u, --runAsUser int Runs the CSI check using pods as a user (int)
  -k, --skipCFScheck Use this flag to skip validating the ability to clone a snapshot.
  -s, --storageclass string The name of a Storageclass. (Required)
  -v, --volumesnapshotclass string The name of a VolumeSnapshotClass. (Required)

Global Flags:
  -o, --output string Options(json)
```

###### Validating your storage configuration

So first we will use the “csicheck” argument to validate our storage configuration. As the name suggests, this will be aimed at our CSI Drivers used to provision storage. I won’t personally cover the differences between in-tree provisioners and CSI, however you can [read this great write up](https://vzilla.co.uk/vzilla-blog/understanding-the-kubernetes-storage-journey) by Michael Cade if you want to know more.

Using my Kubestr output, it’s easy to know what arguments to use.

```
# To test CSI snapshot/restore functionality, run:

./kubestr csicheck -s <storage class> -v <volume snapshot class>
```

[![kubestr csicheck -s storageclass -v volumestorageclass](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-csicheck-s-storageclass-v-volumestorageclass.jpg?resize=604%2C261&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-csicheck-s-storageclass-v-volumestorageclass.jpg?ssl=1)

Below is my output, and I’ve also highlighted some of the objects being created in my environment as well.

[![kubestr csicheck -s storageclass -v volumestorageclass - output](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-csicheck-s-storageclass-v-volumestorageclass-output.jpg?resize=604%2C232&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-csicheck-s-storageclass-v-volumestorageclass-output.jpg?ssl=1)

Below you can see an output of an error where I had misconfigured the CSI and snapshots were not possible, the tool told me that my storage was misconfigured as it could not perform the tests.

[![kubestr csicheck -s storageclass -v volumestorageclass - error output](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-csicheck-s-storageclass-v-volumestorageclass-error-output.jpg?resize=604%2C61&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-csicheck-s-storageclass-v-volumestorageclass-error-output.jpg?ssl=1)

###### Performing a benchmark on your storage

Once you’ve validated your CSI configuration, the next piece is benchmarking. Kubestr implements FIO, so if you’ve used the tool before, some of these pieces will seem familiar to you.

To run a basic storage test is easy:

```
kubestr fio -s ebs-sc
```

This will create a 100GB PV and link a pod to run the FIO tests. Below you can see my output.

[![kubestr fio default](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-fio-defaullt.jpg?resize=604%2C466&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-fio-defaullt.jpg?ssl=1)

For more advanced options, we can configure the size of the PV, bring your own FIO test and output the data to file as well.

You can find examples of [FIO test configurations here](https://github.com/axboe/fio/tree/master/examples).

```
kubestr fio -s {storage class} -z {pv size} -f {fio settings file}

# Example command

kubestr fio -s ebs-sc -z 200Gi -f
```

[![kubestr fio -s ebs-sc -z 200gi -f - output](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-fio-s-ebs-sc-z-200gi-f-output.jpg?resize=604%2C417&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/04/kubestr-fio-s-ebs-sc-z-200gi-f-output.jpg?ssl=1)

Wrapping up, Kubestr offers a quick and easy way to test your storage configuration and performance when setting up your Kubernetes clusters. I’ll leave you try it out yourself, and you can always check out the [dedicate page](https://kubestr.io) or the [github page](https://github.com/kastenhq/kubestr).

 

Regards

[Follow @Saintdle](https://twitter.com/saintdle)<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

[Dean Lewis](https://uk.linkedin.com/in/saintdle?trk=profile-badge)

The post [Kubestr – Open-Source Kubernetes Storage benchmarking tool](https://veducate.co.uk/kubestr/) appeared first on [vEducate.co.uk](https://veducate.co.uk).