v1.0
Managed Kubernetes
K8s Basics
PMK Onboarding
Networking / Ingress
Data Services
Automating PMK
Troubleshooting

How to Deploy PortWorx as a Storage Backend for your Kubernetes Cluster using CSI

Introduction

This guide provides step by step instructions for configuring Portworx storage as a backend for persistent volumes created on your Kubernetes cluster.

Prerequisites

This tutorial will use a Platform9 Managed Kubernetes Free Tier cluster, however you can use this tutorial to configure Portworx storage on any other Kubernetes cluster of your choice.

Step 1 - Create a Storage Class for Portworx

Once Portworx installation is running you need to create a storage class with the fowling configuration, this can be applied via the Platform9 UI using the Storage Class dashboards.

YAML
Copy

In the PMK UI, navigate to the Storage Class menu and click Add New Storage Class.

Next, enter the details for the storage class.

Finally, review the configuration, ensure it matches the example below including the replication parameter at the bottom of the YAML spec. Once the YAML is correct click Complete and Platform9 will create the storage class.

YAML
Copy

You Portworx storage class is now created and should be listed under the Storage Classes tab.

Step 2 - Create a Test PVC

You can test the CSI based storage class by creating a Kubernetes Persistent Volume Claim (PVC) with the following YAML spec and applying it to your cluster. Copy the YAML to a file locally and use kubectl to add the PVC. Ensure the StorageClassName matches the storage class that you created above

YAML
Copy

Create the PVC from the YAML file with the command below:

Bash
Copy
output
Copy

To view the state of the PVC run

Bash
Copy
Output
Copy

Step 3 - Create MySQL Using the PVC

The following YAML spec creates an example MySQL application that uses the new PVC.

YAML
Copy

Use Kubectl to apply the spec.

Bash
Copy

Run the following command to view the running deployment:

Bash
Copy
  Last updated