Install Portworx on VMware vSphere cloud

Install Portworx on VMware vSphere cloud

Introduction

So you want to start using persistent storage for you Kubernetes cluster, which runs on VMware vSphere? Let’s go ahead and deploy Portworx Enterprise! For this installation I’ll be using the Portworx Operator with makes both the installation of Portworx really easy, but also allows you to make changes afterwards, or do upgrades of the cluster easily. To make our live easy we’ll use the Cloud Drives integration for VMware, so that Portworx will automatically create the required virtual disks in VMware vSphere and attach them to the virtual Kubernetes worker nodes.

More of a visual style learning, feel free to check out the recording I did on the installation below.

Prerequisites

In this installation procedure we are going to follow the Portworx documentation for installing Portworx on top of VMware. Before you start, this procedure, I expect you to have your Kubernetes cluster up-and-running and you’ve reviewed the Portworx requirements for the installation.

The table below gives a quick summary of the most important requirements for your cluster.

SpecificationSupported Value
Deployment HostVM OS: Linux
vCPU: 4
Memory: 16 GB
Disk storage: 200 GB
Control-Plane VMsMinimum: 1
Recommended: 3
vCPUs: 2
RAM: 8 GB
OS Volume: 25 GB
Worker Node VMsMinimum: 3 (for storage cluster)
vCPUs: 8
RAM: 16 GB
OS Volume: 25 GB

Create the VMware vSphere secret

Since we are using the Cloud Drives functionality, by which Portworx is able to create and attach the required virtual disks to the worker node VMs, we need to create a Kubernetes secret, which contains the username and password with the correct permissions.

First encrypt the username and password, using the following commands:

printf <vcenter-server-user> | base64
printf <vcenter-server-password> | base64

And use the output from those command to create the following yaml spec:

apiVersion: v1
kind: Secret
metadata:
 name: px-vsphere-secret
 namespace: kube-system
type: Opaque
data:
 VSPHERE_USER: YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2Fs
 VSPHERE_PASSWORD: cHgxLjMuMEZUVw==

Save this yaml to a file and user kubectl apply to apply it to your kubernetes cluster.

Generate the installation specs

Generate the installation specifications on-line using Portworx Central, using the following steps.

  1. Under the Basic tab, ensure that the following config parameters are set.
    • Select the Use the Portworx operator checkbox.
    • Select the 2.8 or higher version of Portworx in Portworx Version drop-down.
    • Under ETCD, select Built-in.
  2. Under the Storage tab, ensure that the following config parameters are set.
    • Under Select your environment, choose Cloud.
    • Under Select Cloud platform, select vSphere.
    • Under Configure storage devices, choose Create Using a Spec in Select type of disk.
    • Under vCenter datastore prefix, enter the name of your datacenter or a prefix if multiple can be used.
  3. Under the Customize tab, ensure that the following config parameters are set.
    • In Are you running either of these?, choose None.
    • In Advanced settings, select the following checkboxes.
      • Enable Stork
      • Enable CSI
      • Enable Monitoring
      • Enable Telemetry

Save the spec to a local file.

Install the Operator

To install the Portworx Operator, run the following command:

kubectl apply -f 'https://install.portworx.com/2.8?comp=pxoperator'

Install Portworx

Next to install Portworx apply the spec file you saved from Portworx Central before, using kubectl apply -f spec.yaml

You can monitoring the installation process with the following command, which should show you the state of the Portworx pods. They should all go into a ready state:

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

To get more details from any of the pods, use the following:

kubectl -n kube-system describe pods <portworx-pod-id>

Check Portworx cluster status

Once the pods have gone into a ready state, you can check the Portworx cluster health with the following command:

PX_POD=$(kubectl get pods -l name=portworx -n kube-system -o jsonpath='{.items[0].metadata.name}')
kubectl exec $PX_POD -n kube-system -- /opt/pwx/bin/pxctl status

Conclusion

This completes the installation of Portworx on a Kubernetes cluster that runs within a VMware vSphere environment. You can now start deploying StatefulSets, using the example StorageClasses created, of create your own StorageClasses and get creative!

Leave a Reply

Your email address will not be published.