Persistent Volumes in your home Kubernetes cluster

Categories: Kubernetes

Summary

We will deploy rook cluster storage service into the baremetal cluster.

Prerequisites

You should have a Baremetal Kubernetes cluster at least version 1.8. If you don't, I recommend taking a look at:

Home Kubernetes cluster in 15 minutes with kubeadm and calico

According to rook's documentation you should also have at least 5GB of disk space on the drive you want to use for storage.

Let's do it

First we need to prepare the baremetal machine for rook's persistent volumes:

```

Clone the rook's repo and apply the configuration to the cluster.

Remember! Always make sure you are targetting correct cluster by running

```

before applying any configuration!

``` git clone https://github.com/rook/rook.git cd rook/cluster/examples/kubernetes kubectl apply -f rook-operator.yaml kubectl -n rook-system get pod ```

Rook operator and agent should be up and running. You can check that by running:

``` kubectl -n rook-system get pod NAME READY STATUS RESTARTS AGE rook-agent-jlbfx 1/1 Running 0 32s rook-operator-5c5db8db4c-tmssj 1/1 Running 0 1m ```

Before we start requesting the storage we still need to create rook's StorageClasss and storage pool. Run following commands in the same folder:

``` kubectl create namespace rook kubectl apply -f rook-storageclass.yaml ```

At this point cluster should be ready to provision persistent volumes. Let's test it using simple application:

``` kubectl apply -f mysql.yaml kubectl apply -f mysql.yaml ```

See also

Share this post with your friends

comments powered by Disqus