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 deploy an application using Portworx volumes
  • How to inspect the state of the volume
  • How to validate data persistence by killing one instance of an application

This scenario assumes you have already covered the following scenarios:

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

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

Deploying a Stateful application on Kubernetes using Portworx

Step 1 of 7

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.


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
        echo "Waiting for portworx nodes to be ready. Current ready nodes: ${NUM_READY}"
    sleep 5

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