Enable pay-as-you-go billing
After you have set up your cluster using any of the paid, trial, or free Portworx licenses, you can enable 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 based on your cluster environment.
Enable pay-as-you-go billing on internet connected clusters
Prerequisites
- You have a pay-as-you-go SaaS key that was acquired by contacting the Pure Storage support team.
- HTTPS port 443 is open
- 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>noteIf 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 previous step:
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 the env: 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-keyWait 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 under AGE, as shown in the following example:kubectl get pods -n portworx -l name=portworxNAME 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 statusStatus: PX is operational
Telemetry: Disabled or Unhealthy
Metering: Healthy
License: PX-Enterprise Usage Based (expires in 209 days)
...
Enable pay-as-you-go billing on air-gapped clusters
You can enable pay-as-you-go billing for an air-gapped cluster with no outbound connectivity by acquiring a pay-as-you-go account key from Portworx.
Once you enable a pay-as-you-go license for an air-gapped cluster with no outbound connectivity, you currently can't switch to any other license.