Difficulty: Intermediate
Estimated Time: 10 minutes

Portworx is a software defined persistent storage solution designed and purpose built for applications deployed as containers, via container orchestrators such as Kubernetes, Marathon and Swarm. It is a clustered block storage solution and provides a Cloud-Native layer from which containerized stateful applications programmatically consume block, file and object storage services directly through the scheduler.

In this tutorial, you will learn:

  • How to create a StorageClass for Portworx volumes
  • How to create a PersistentVolumeClaim using Portworx
  • How to inspect details of a Portworx Volume

If you are interested in learning how to install Portworx on Kubernetes, visit this scenario

Thank you for trying the playground. To view all our scenarios, go here

To learn more about Portworx, below are some useful references.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Persistent volumes on Kubernetes using Portworx

Step 1 of 4

Wait for Kubernetes & Portworx to be ready

Let's first wait for Kubernetes and Portworx to be ready.

Step: Wait for Kubernetes to be ready

Click the below section which waits for all Kubernetes nodes to be ready.

./k8s-wait-ready.sh

Step: Wait for Portworx to be ready

Run below script to wait for Portworx to be ready on all the nodes. This can take a few minutes since it involves pulling multiple docker images.

kubectl get pods -n kube-system -l name=portworx -o wide

while true; do
    NUM_READY=`kubectl get pods -n kube-system -l name=portworx -o wide | grep Running | grep 1/1 | wc -l`
    if [ "${NUM_READY}" == "3" ]; then
        echo "All portworx nodes are ready !"
        kubectl get pods -n kube-system -l name=portworx -o wide
        break
    else
        echo "Waiting for portworx nodes to be ready. Current ready nodes: ${NUM_READY}"
    fi
    sleep 5
done

Now that we have the Portworx cluster up, let's proceed to the next step !