This topic explains how to install Portworx with Google Kubernetes Engine (GKE). Follow the steps in this topic in order.

Create a GKE cluster

Configure gcloud

If this is your first time running with Google Cloud, please follow this quickstart to install gcloud shell and configure your project and compute zone. If you already have gcloud setup, you can skip this.

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

Create your GKE cluster using gcloud

Portworx is supported on GKE cluster provisioned on Ubuntu Node Images. So it is important to specify the node image as Ubuntu when creating clusters.

You have 2 options in the type of cluster you create: Regional or Zonal. Read Regional Clusters to help you make this decision

Create a zonal cluster

Below command creates a 3-node zonal cluster in us-east1-a with auto-scaling enabled.

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

Create a regional cluster

Below command creates a 3-node regional in us-east1 cluster with auto-scaling enabled.

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-standard-4 \
     --num-nodes=3 \
     --image-type ubuntu \
     --scopes compute-rw \
     --enable-autoscaling --max-nodes=6 --min-nodes=3

Set your default cluster

After the above GKE cluster completes, let’s make sure and set it up as our default cluster while using the gcloud.

gcloud config set container/cluster px-demo
gcloud container clusters get-credentials px-demo

To make sure we open access to the Compute API, run the following command.

gcloud services enable compute.googleapis.com

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)'`


Who provisions the storage?

Portworx gets its storage capacity from block storage mounted in the nodes and aggregates capacity across all the nodes to create a global storage pool. In this tutorial, Portworx uses Persistent Disks (PD) as that block storage, where Portworx adds PD automatically as the Kubernetes scales-out and moves PD attachment as nodes exit the cluster or get replaced.

Continue below to generate the Portworx specs.

Generate the specs

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

To generate the specs, click Generating the Portworx specs. close

Portworx can also be installed using it’s 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 in your cluster.

kubectl apply -f px-spec.yaml
Monitor the portworx pods

Wait till all portworx pods show as ready in the below output.

kubectl get pods -o wide -n kube-system -l name=portworx
Monitor Portworx cluster status
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


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

Last edited: Tuesday, Dec 11, 2018