Install Portworx on GCP GKE using the Operator

This document shows how to install Portworx with Google Kubernetes Engine (GKE).


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

Create a GKE cluster

Configure the gcloud shell

If this is your first time running with Google Cloud, please follow the steps below to install the gcloud shell, configure your project and compute zone. If you already have gcloud set up, you can skip to the next section.

gcloud config set project $PROJECT_NAME
gcloud config set compute/region us-east1
gcloud config set compute/zone us-east1-b
sudo gcloud components update

Create your GKE cluster using gcloud

You have 2 options for the type of cluster you create: Regional or Zonal. Check out this link to find out more about regional clusters.

Create a zonal cluster

To create a 3-node zonal cluster in us-east1-a with auto-scaling enabled, run:

gcloud container clusters create px-demo \
    --zone us-east1-b \
    --disk-type=pd-ssd \
    --disk-size=50GB \
    --labels=portworx=gke \
    --machine-type=n1-highcpu-8 \
    --num-nodes=3 \
    --image-type ubuntu \
    --scopes compute-rw,storage-ro \
    --enable-autoscaling --max-nodes=6 --min-nodes=3

Create a regional cluster

If you want to create a 3-node regional in us-east1 cluster with auto-scaling enabled, type:

gcloud container clusters create px-demo \
     --region us-east1 \
     --node-locations us-east1-b,us-east1-c,us-east1-d \
     --disk-type=pd-ssd \
     --disk-size=50GB \
     --labels=portworx=gke \
     --machine-type=n1-highcpu-8 \
     --num-nodes=3 \
     --image-type ubuntu \
     --scopes compute-rw,storage-ro \
     --enable-autoscaling --max-nodes=6 --min-nodes=3

Set your default cluster

After the above command completes, let’s check that everything is properly set up and make this cluster the default cluster while using gcloud:

gcloud config set container/cluster px-demo
gcloud container clusters get-credentials --region <region-name> px-demo

Next, we need to open access to the Compute API. Run the following command:

gcloud services enable

Provide permissions to Portworx

Portworx requires a ClusterRoleBinding for your user to deploy the specs. You can do this using:

kubectl create clusterrolebinding myname-cluster-admin-binding \
    --clusterrole=cluster-admin --user=`gcloud info --format='value(config.account)'`


NOTE: Portworx gets its storage capacity from the block storage mounted in the nodes and aggregates the capacity across all the nodes. This way, it creates a global storage pool. In this example, Portworx uses Persistent Disks (PD) as that block storage, where Portworx adds PDs automatically as the Kubernetes scales-out and removes PDs as nodes exit the cluster or get replaced.

Install the Operator

Enter the following kubectl create command to deploy the operator:

kubectl create -f

Generate the specs

To install Portworx with Kubernetes, you must first generate Kubernetes manifests that you will deploy in your cluster:

  1. Navigate to PX-Central and log in, or create an account.

  2. Click Continue with Portworx Enterprise option:

    Px-central Product Catalog

  3. Choose an appropriate license for your requirement and click Continue:

    Screenshot showing Portworx license selector

NOTE: If you’re using a cloud provider, do not add volumes of different types when configuring storage devices for during spec generation. For example, do not add both GP2 and GP3 for AWS, standard and ssd for GCP, or Standard and Premium for Azure. This can cause performance issues and errors.

Apply the specs

Apply the generated specs to your cluster.

kubectl apply -f px-spec.yaml

Monitor the Portworx nodes

  1. Enter the following kubectl get command, waiting until all Portworx nodes show as ready in the output:

    kubectl -n kube-system get storagenodes -l name=portworx
  2. Enter the following kubectl describe command with the NAME of one of the Portworx nodes to show the current installation status for individual nodes:

    kubectl -n kube-system describe storagenode <portworx-node-name>
    Type     Reason                             Age                     From                  Message
    ----     ------                             ----                    ----                  -------
    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.
    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.


Once you have a running Portworx installation, below sections are useful.

Last edited: Tuesday, Jul 5, 2022