Switch to pay-as-you-go billing on an existing Kubernetes cluster
If you have already set up your cluster using any of the paid, trial, or free Portworx licenses, you can switch to pay-as-you-go billing by acquiring a pay-as-you-go SaaS key from the Pure Storage support team and performing the following steps.
For enabling pay-as-you-go billing on your air-gapped cluster, refer to this page.
Prerequisites
- A pay-as-you-go SaaS key, acquired by contacting the Pure Storage support team.
- HTTPS port to open:
443
- Hosts for activating the SaaS key:
rest.zuora.com
flex1327.compliance.flexnetoperations.com
Run the dig rest.zuora.com +noall +answer
command to check if the host is reachable or not.
Alternatively, you can run the following command:
$ curl https://rest.zuora.com
{"message":"no Route matched with those values"}
Enable pay-as-you-go billing
The examples below use the portworx
namespace, you should update this to the correct namespace for your environment.
Run the following command on one of the node to activate your SaaS key:
pxctl license activate saas --key <SAAS_KEY>
If you already have a Portworx cluster and run the above command, your PAYG (pay-as-you-go) license will be activated. You can then follow the verifying steps to check if your SaaS key is activated. However, if you are installing a new Portworx cluster, you should follow the procedure in this section to activate your SaaS key before installing Portworx.
Create a Kubernetes secret
Run the following command to a Kubernetes secrect and place your pay-as-you-go SaaS key into it:
kubectl create secret generic px-saas \
--from-literal=saas-key=<SAAS_KEY> -n portworx
Update your StorageCluster spec
Patch the pay-as-you-go secret into your cluster. Follow the steps appropriate for your cluster's install method:
-
Patch the STC using the secret you created in step 1:
kubectl patch stc $stc --type='json' \
-p='[{"op": "add", "path": "/spec/env/0","value": {"name": "SAAS_ACCOUNT_KEY_STRING", "valueFrom":{"secretKeyRef":{"name": "px-saas", "key": "saas-key"}}}}]' -n portworxThe above step patches your StorageCluster
stc
and appends the following under theenv:
parameter. This will enable pay-as-you-go billing on your cluster.env:
- name: "SAAS_ACCOUNT_KEY_STRING"
valueFrom:
secretKeyRef:
name: px-saas
key: saas-key -
Wait for a few minutes and then verify if the automatic rolling upgrade is successful by running the following command. You will observe that the new pods have been created recently with new
px-cluster-<id>
. You can also see the latest timestamp underAGE
, as shown in the following example:kubectl get pods -n portworx -l name=portworx
NAME READY STATUS RESTARTS AGE
px-cluster-xxxxxxxx-xxxx-xxxx-xxxx-ef93c42d8aeb-b66td 2/2 Running 0 6m56s
px-cluster-xxxxxxxx-xxxx-xxxx-xxxx-ef93c42d8aeb-fqdgj 2/2 Running 0 5m16s
px-cluster-xxxxxxxx-xxxx-xxxx-xxxx-ef93c42d8aeb-t8ldc 2/2 Running 0 9m
Verify if your SaaS key activated
-
Check your SaaS key license usage by running
pxctl status
from one of the worker nodes:pxctl status
Status: PX is operational
Telemetry: Disabled or Unhealthy
Metering: Healthy
License: PX-Enterprise Usage Based (expires in 209 days)
...
-
To see more detailed information about your license run
pxctl license list
pxctl license list
DESCRIPTION ENABLEMENT ADDITIONAL INFO
Number of nodes maximum 1000
Number of volumes per cluster maximum 16384
Volume capacity [TB] maximum 40
Node disk capacity [TB] maximum 256
Node disk capacity extension yes
Number of snapshots per volume maximum 64
Number of attached volumes per node maximum 256
Storage aggregation yes
Shared volumes yes
Volume sets yes
BYOK data encryption yes
Limit BYOK encryption to cluster-wide secrets no
Resize volumes on demand yes
Snapshot to object store [CloudSnap] yes
Number of CloudSnaps daily per volume maximum unlim
Cluster-level migration [Kube-motion/Data Migration] yes
Disaster Recovery [PX-DR] yes
Autopilot Capacity Management yes
OIDC Security yes
Bare-metal hosts yes
Virtual machine hosts yes
Product SKU PX-Enterprise Usage Based expires in 209 days
LICENSE EXPIRES: 2023-06-01 23:59:59 +0000 UTC
For information on purchase, upgrades and support, see
https://docs.portworx.com/knowledgebase/support.html
How to apply a new pay-as-you-go key secret
If you need to update your pay-as-you-go key secret, you can export the secret object to a YAML file, apply the secret, and then perform a rolling update by adding a dummy env
variable to your StorageCluster stc
:
-
Export the YAML file:
kubectl get secret/px-saas -n portworx -o yaml > px-saas.yaml
-
After editing the file with your new
pay-as-you-go
key secret, run thekubectl apply
command:kubectl apply -f px-saas.yaml
-
Get your
px-cluster ID
usingpxctl status
, and run the following command to trigger the Portworx pod rolling update:kubectl patch stc <px-cluster-ID> -n portworx --type "json" -p '[{"op":"add","path":"/spec/env/-","value":{"name":"DUMMYENV","value":"date"}}]'