GCP Marketplace
Prerequisites
Before installing Portworx Enterprise , make sure your environment meets the following requirements:
Image type: Only GKE clusters provisioned on Ubuntu Node Images support Portworx. You must specify the Ubuntu node image when you create clusters.
Resource requirements: Portworx requires that each node in the Kubernetes cluster has at least 4 CPUs and 4 GB memory for Portworx. It is important to keep this in mind when selecting the machine types during cluster creation.
Permissions: Portworx requires access to the Google Cloud APIs to provision & manage disks. Make sure the user/service account creating the GKE cluster has the following roles:
- Compute Admin
- Service Account User
- Kubernetes Engine Cluster Viewer
Permissions
Portworx requires permissions to create GCE PDs using the compute APIs. Also, the GCP marketplace requires that the clusters have Read permissions for storage APIs. These permissions can be added to the node pools from the UI when creating the GKE cluster. If using gcloud
, type the following command to create a cluster with the correct permissions:
gcloud container clusters create portworx-gke \
--zone us-east1-b \
--disk-type=pd-ssd \
--disk-size=50GB \
--machine-type=n1-standard-4 \
--num-nodes=3 \
--image-type ubuntu \
--scopes compute-rw,storage-ro
Service Account
The service account associated with your GKE cluster should have permissions to create and mount GCE PDs.
On GCP Marketplace, you have 2 options for installing Portworx.
Option 1: Install Portworx from the marketplace
Before we start installing Portworx, here are a few things you should keep in mind:
- When installing Portworx Enterprise from the GCP Marketplace it will automatically install on all the worker nodes in your GKE cluster.
- The marketplace installer will also create some Service Accounts to be used by the various components. It is recommended to let the installer create these service accounts instead of choosing pre-existing ones.
- When installing from the marketplace, the billing agent will automatically report billing information based on the number of nodes to GCP. Please refer to the marketplace listing for the pricing information.
Now, let’s look more closely at how to install Portworx Enterprise from the marketplace.
- First, use the search bar at the top to search for Portworx. You should see something like the following:
- Select the app and you will see information about it:
- Next, let’s click configure to go to the configuration page:
Here, you will be required to do a few things: select the Kubernetes cluster and the namespace, type the name of the app, and choose the physical disks you want to provision and attach to each node. Note that these disks will automatically get attached to the nodes on reboots and node failures.
When everything is set, go ahead and click “Deploy”.
- Now, the installer asks you to confirm that your cluster meets minimum resource requirements. Then, it will proceed with the actual install:
- Once the installation is finished, we can check the status of our new app:
Option 2: Install Portworx using the CLI
You can also choose to install Portworx using the CLI. You will still need to generate a license key from the GCP portal and create a Kubernetes Secret that can be used to report billing information.
Create Reporting Secret
Navigate to the Portworx listing on the GCP Marketplace and click on
Configure
. Then, click on the Install via command line
tab. Here you can generate a license key to be used for the reporting.
Choose a service account you want to be associated with the billing and click Generate license key
. This will download the license key to your system. Apply the license key to your GKE cluster using the following commands:
NS=<namespace_where_you_installed_portworx>
kubectl apply -n $NS license.yaml
Generate the specs
To install Portworx with Kubernetes, you must first generate Kubernetes manifests that you will deploy in your cluster:
Navigate to PX-Central and log in, or create an account.
Click Continue with Portworx Enterprise option:
Choose an appropriate license for your requirement and click Continue:
Portworx can also be installed using its Helm chart by following instructions here. The above method is recommended over helm as the wizard will guide you based on your environment.
Apply the specs
Apply the generated specs to your cluster.
kubectl apply -f px-spec.yaml
Monitor the Portworx pods
Enter the following
kubectl get
command, waiting until all Portworx pods show as ready in the output:kubectl get pods -o wide -n kube-system -l name=portworx
Enter the following
kubectl describe
command with the ID of one of your Portworx pods to show the current installation status for individual nodes:kubectl -n kube-system describe pods <portworx-pod-id>
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 7m57s default-scheduler Successfully assigned kube-system/portworx-qxtw4 to k8s-node-2 Normal Pulling 7m55s kubelet, k8s-node-2 Pulling image "portworx/oci-monitor:2.5.0" Normal Pulled 7m54s kubelet, k8s-node-2 Successfully pulled image "portworx/oci-monitor:2.5.0" Normal Created 7m53s kubelet, k8s-node-2 Created container portworx Normal Started 7m51s kubelet, k8s-node-2 Started container portworx Normal PortworxMonitorImagePullInPrgress 7m48s portworx, k8s-node-2 Portworx image portworx/px-enterprise:2.5.0 pull and extraction in progress Warning NodeStateChange 5m26s portworx, k8s-node-2 Node is not in quorum. Waiting to connect to peer nodes on port 9002. Warning Unhealthy 5m15s (x15 over 7m35s) kubelet, k8s-node-2 Readiness probe failed: HTTP probe failed with statuscode: 503 Normal NodeStartSuccess 5m7s portworx, k8s-node-2 PX is ready on this node
NOTE: In your output, the image pulled will differ based on your chosen Portworx license type and version.
Monitor the cluster status
Use the pxctl status
command to display the status of your Portworx cluster:
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
Edit the Portworx DaemonSet
Once Portworx has been installed, please edit the portworx
DaemonSet with the following:
kubectl edit daemonset -n $NS portworx
And add the following environment variables to the portworx
container so that
Portworx can read the license generate above
REPORTING_SECRET: Name of the secret generated above
REPORTING_SECRET_NAMESPACE: Namespace where you installed Portworx
Post-Install
Once you have a running Portworx installation, below sections are useful.
-
Storage operations Learn how to perform various storage operations using Portworx on Kubernetes
-
Stateful applications on Kubernetes Learn how to install various applications with Portworx on Kubernetes
-
Operate and Maintain Operations guide for running Portworx in Production with Kubernetes
Upgrade
When an upgrade is available on the marketplace you can install the new version with a new name in the same namespace as the previous install. This will replace all the components for the application with the updated version.
You can remove the old version of the application once all the components in the new version are running.
Uninstall
WARNING: Uninstalling Portworx is a destructive process and you will not be able to recover volumes provisioned by Portworx. Please use this with caution.
You can uninstall Portworx from your GKE cluster by running the following command:
curl -fsL "https://install.portworx.com/px-wipe" | bash
This will remove all Portworx specific state from the nodes and clean all the disks used by Portworx_
Once the above script completes successfully you can delete the Application object created by GCP.
You can find more information about uninstalling Portworx here.