DEV Community

loading...

Kubestr – Open-Source Kubernetes Storage benchmarking tool

Dean
Cloud Management specialist working at VMware, with a keen interest in cloud native apps.
Originally published at veducate.co.uk on ・6 min read

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.

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 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).

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

kubestr download and extract

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

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:

> ./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)
Enter fullscreen mode Exit fullscreen mode
  • 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)
Enter fullscreen mode Exit fullscreen mode
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 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>
Enter fullscreen mode Exit fullscreen mode

kubestr csicheck -s storageclass -v volumestorageclass

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

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

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
Enter fullscreen mode Exit fullscreen mode

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

kubestr fio default

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.

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

# Example command

kubestr fio -s ebs-sc -z 200Gi -f
Enter fullscreen mode Exit fullscreen mode

kubestr fio -s ebs-sc -z 200gi -f - output

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 or the github page.

Regards

Follow @Saintdle

Dean Lewis

The post Kubestr – Open-Source Kubernetes Storage benchmarking tool appeared first on vEducate.co.uk.

Discussion (0)