GKE
This document shows how to install Portworx with Google Kubernetes Engine (GKE).
Prerequisites
Before installing , 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 gcloud
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 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
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
Select Install and Run to open the Spec Generator
Select New Spec
Choose either or , depending on which license you intend to use:
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 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
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