This video is part of a series on how to install and use the HPE 3PAR Docker
volume plugin within a Red Hat OpenShift environment.
In this demo will be using a 3-node OpenShift cluster with a single master, and two
worker nodes. They will be using iSCI to connect to a 3PAR 8440 array
for volume provisioning. The first step is to clone the 3PAR Docker volume
plugin repo from GitHub in order to get access to the installer.
Once we have it downloaded, we can navigate to the installer folder.
Within the installer folder, there are some important files to note. First is the
host file, which Ansible will use to deploy various components of the 3PAR
Docker volume plugin on the OpenShift master and worker nodes. The properties
folder contains the configuration file for your 3PAR and I will show you how
that's done shortly. Once those two files are configured, we can run the
installation playbook that will deploy the plugin into your OpenShift
cluster. Let's start by editing the host file. Ansible uses the host file to describe
your environment using labels, and with this information will deploy specific
components for the 3PAR Docker volume plugin on the master and worker nodes.
The all label contains the host names or IPs for all of the OpenShift
nodes in your cluster. If you use a proxy in your company, you can
configure it here. Next at the host names or IPs of the OpenShift
master and worker nodes. The last section is used to define the host
names or IPs that will be used to deploy the etcd cluster required
for the 3PAR Docker volume plugin to store volume and cluster metadata.
Once this is done, go ahead and save and exit.
Now let's take a look at the Properties file and the Properties folder. We'll
make a quick backup of the sample file here. The Properties file contains all
of the details of the 3PAR array or arrays that will be used for provisioning
volumes within your OpenShift cluster. As you can see, there are multiple
sections within the file, but don't be overwhelmed, I'll walk you through each
section. Note the default and 3PAR1 labels in the file. These are
used for each array that is configured for use by OpenShift. Only if the array
configured under the default label is required for the plugin to function
properly. To start, if you're not going to need to configure OpenShift to use
multiple 3PARs for volume provisioning, we can delete the 3PAR1
section.
Under the mandatory parameter section, there are only a few changes that need
to be made in order to configure the plugin. First, change the plugin
driver to either Fibre Channel or iSCI depending upon your
storage environment. Next, configure the host name or IP address and username
password for your 3PAR array. One thing to note, the user will need edit rights
on the array in order to add, delete, and modify volumes. Specify the CPG that
will be used. Optionally, you can configure the snap CPG as well here.
Additional settings are available like encrypting the passwords or enabling
3PAR replication within the plugin. These can be found within our documents
on our GitHub page.
Once this is all done, we can save and exit.
We're now ready to install the plugin. We do this by running the Ansible dash
playbook command and specifying the host file we created earlier and the
install HPE 3PAR volume driver yml file.
Once Ansible finishes, you'll have successfully installed the plugin.
Now we'll go through some basic usage to verify the 3PAR Docker volume plugin
installation and integrations within OpenShift using storage classes,
persistent volume claims, and PODs. Let's go ahead and download some pre-created
examples from the 3PAR examples repo.
Navigate to the Containers OpenShift Samples folder.
Within this folder, you will find working examples of a storage class, a
persistent volume claim and an engine XPOD.
Let's go ahead and start with the storage class. The first steps of
creating persistent volumes is to create a storage class which acts like
a storage profile that your users will consume when requesting storage for their
applications. You can create multiple storage classes depending on your user
needs. For example, a gold, silver, bronze type storage class.
Within the storage class, we will specify a name, the provisioner 3PAR
driver will use, and then various parameters for each volume. You can
refer to the documentation on our GitHub page for available options here.
In this example, will be creating a simple storage class that will
provision full volumes using the SSD_r6 CPG.
Now go ahead and save this file.
We will now import the storage class into OpenShift with the
oc create -f command.
You could then verify that it was imported correctly by using the oc
describe command, and you should see the parameters we set within the
storage class.
Now let's take a look at the sample persistent volume claim. The persistent
volume claim, or PVC, contains several important parameters. First, it sets
the access modes. Since we're using a 3PAR, which is a block device, we
will be using the ReadWriteOnce setting.
Next, specify the size in the storage class that will be used to provision
the volume for your application.
Once that's done, go ahead and save and exit.
Now we will import the PVC into OpenShift using the same command as we
did with a storage class. Again, we can inspect the PVC, at which point we will
see the persistent volume has been created and bound, waiting for a POD to
attach to. You can also inspect the persistent volume to get additional
information or details on the volume.
We'll be putting all of this together as we deploy an nginix web server in
a POD that will consume the volume we just created to store the website data.
Let's take a look at the POD. Here we specify the container image that will
be used and the mount location and PVC to be used for the persistent
volume. The last section will expose the nginix POD external to the
cluster, so we can see if everything is working as expected.
Like before, we will import the POD specifications into OpenShift and
wait a few minutes as the POD is created.
We can inspect the POD to see if it was created successfully.
Now let's log into the POD to verify if everything is working correctly by
writing some data to the new persistent volume.
Once we've done that, we can get the IP of the POD and use curl to check
the web server.
If you see the output shown, you have successfully created a persistent
volume using the HPE 3PAR Docker volume plugin.