Install Portworx on GCP GKE using the Operator
This document shows how to install Portworx with Google Kubernetes Engine (GKE).
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
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.
export PROJECT_NAME=<PUT-YOUR-PROJECT-NAME-HERE>
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 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)'`
Install
Install the Operator
Enter the following kubectl create
command to deploy the operator:
kubectl create -f https://install.portworx.com/?comp=pxoperator
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:
Apply the specs
Apply the generated specs to your cluster.
kubectl apply -f px-spec.yaml
Monitor the Portworx nodes
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
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>
Events: 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.
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