Skip to main content
Version: 3.1

Install Portworx on Kubernetes using Kubernetes Operations (KOPS)

This topic explains how to install Portworx on Kubernetes using Kubernetes Operations (KOPS). Follow the steps in this topic in order.

Prepare

This article assumes that you are familiar with KOPS. For information about using KOPS, see one of the following pages:

Granting Portworx the needed AWS permissions

Portworx creates and attaches EBS volumes. As such, it needs the AWS permissions to do so. Below is a sample policy describing these permissions:


{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:ModifyVolume",
"ec2:DetachVolume",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:DeleteTags",
"ec2:DeleteVolume",
"ec2:DescribeTags",
"ec2:DescribeVolumeAttribute",
"ec2:DescribeVolumesModifications",
"ec2:DescribeVolumeStatus",
"ec2:DescribeVolumes",
"ec2:DescribeInstances",
"autoscaling:DescribeAutoScalingGroups"
],
"Resource": ["*"]
}
]
}

Install

note

If you are not using instance privileges, you must also specify AWS environment variables in the StorageCluster spec file. The environment variables to specify (for the KOPS IAM user) are:

AWS_ACCESS_KEY_ID=<id>,AWS_SECRET_ACCESS_KEY=<key>

If generating the StorageCluster spec via the GUI wizard, specify the AWS environment variables in the List of environment variables field. If generating the StorageCluster spec via the command line, specify the AWS environment variables using the e parameter.

Generate the specs

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

Navigate to Portworx Central and log in, or create an account, then follow the process to generate a spec.

note

If you're using a cloud provider and you use the Customize option when generating your spec, do not add volumes of different types when configuring storage devices 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.

Deploy the Operator

To deploy the Operator, run the command that Portworx Central provided, which looks similar to the following:

kubectl apply -f 'https://install.portworx.com/<portworx_version>?comp=pxoperator&kbver=<k8s-version>&ns=portworx'
serviceaccount/portworx-operator created
podsecuritypolicy.policy/px-operator created
clusterrole.rbac.authorization.k8s.io/portworx-operator created
clusterrolebinding.rbac.authorization.k8s.io/portworx-operator created
deployment.apps/portworx-operator created

Deploy the StorageCluster

To deploy the StorageCluster, run the command that Portworx Central provided, which looks similar to the following:

kubectl apply -f “https://install.portworx.com/<portworx_version>?operator=true&mc=false&kbver=1.25.0&ns=portworx&b=true&kd=type%3Dgp3%2Csize%3D150&s=%22type%3Dgp3%2Csize%3D150%22&c=px-cluster-xxxxxxxx-xxxx-xxxx-xxxx-2ac5fb8069e0&stork=true&csi=true&mon=true&tel=false&st=k8s&promop=true'

Monitor the Portworx nodes

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

    kubectl -n <px-namespace> 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 <px-namespace> 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.