CNE: Licensing an Offline Environment
You can license a CNE environment that has no access to One Liferay’s provisioning service by using an activation bundle. The bundle is a ZIP file that you get from One Liferay, Liferay’s customer portal, and copy to the cluster.
Offline licensing uses the same setup as online licensing, so first install the operator and enable licensing. The operator reads the bundle from its marketplace volume, which CNE Azure Ready 0.3.0 doesn’t provide, so offline licensing isn’t available there.
The examples use the namespace liferay and the LiferayEnvironment (short name lenv) named liferay-default. Replace them with your own, including in Secret names such as liferay-default-identity.
Configuring Offline Mode
The operator reads the bundle from its marketplace volume. On Kubernetes Ready, turn the volume on first.
The bundle’s Marketplace add-ons reach Liferay DXP only when you also turn on add-on delivery on the liferay-default chart.
In your liferay-default chart values, keep licensing.enabled at true, set licensing.offline to true, and set licensing.offlineActivationBundle to the file name you give the bundle. On Kubernetes Ready, add them to your values file:
licensing:
enabled: true
offline: true
offlineActivationBundle: bundle.zip
Then upgrade your release with the values file.
On CNE AWS Ready and CNE GCP Ready, add the same values under the liferay-default key in the liferay.yaml you used in Enabling Licensing:
liferay-default:
licensing:
enabled: true
offline: true
offlineActivationBundle: bundle.zip
Then commit and push the change to your GitOps repository.
If you write the LiferayEnvironment yourself, set spec.offline and spec.offlineActivationBundle instead.
Licensing the Environment
-
Read the offline request the operator generates for the environment:
kubectl --namespace liferay get secret liferay-default-identity \ --output jsonpath='{.data.offline-request}' | base64 --decodeThe request expires after 90 days. If it expires before you submit it, read the new one.
-
Exchange the offline request for an activation bundle in One Liferay, as in steps 1 to 6 of Requesting an Activation Bundle.
-
Copy the bundle to
[namespace]/[file]on the marketplace volume, for exampleliferay/bundle.zip.[namespace]is the environment’s namespace, and[file]is theofflineActivationBundlevalue. Use a temporary pod that runs in thedxp-operator-systemnamespace and mounts the claim named inmarketplace.claimName(dxp-operator-marketplaceon CNE AWS Ready and CNE GCP Ready).On CNE AWS Ready and CNE GCP Ready,
dxp-operator-systemenforces the restricted Pod Security Standard, so the pod must meet it. -
Watch the environment until the
ACTIVATEDcolumn readsTrueand theVALID-UNTILcolumn shows a future expiration date:kubectl --namespace liferay get lenv liferay-default --watchIf
ACTIVATEDdoesn’t turnTrue, read theActivatedcondition’s reason withkubectl describe lenvand look it up in Troubleshooting.
Requesting an Activation Bundle
One Liferay builds the activation bundle from the environment’s offline request. The One Liferay form calls the request an activation token.
-
In One Liferay, open your project’s Activation page, click Generate Activation Key, select Cloud Native, the environment’s Type, and a Version, and click Next, as in Getting an Activation Code. The offline request doesn’t carry the type, so the form takes it from this choice.
-
Below the codes, click If your environment doesn’t have internet access, click here for offline activation. The Download Offline Activation Package form opens.
For a non-production environment, the form first lists the project’s non-production environments already activated offline. To activate another one, click Activate New Non-Prod Environment. To change one of them, see Changing a Non-Production Environment’s Subscriptions.
-
Paste the offline request from step 1 of Licensing the Environment into the activation token field.
If the form rejects the request, check that it hasn’t expired and that you copied all of it. The operator writes a new request on its next license check after the old one expires, so read it again as in step 1 of Licensing the Environment and paste it over the old value.
-
The form lists every subscription the project can include in the bundle and selects all of them. Clear the subscriptions the environment doesn’t need.
-
Choose the Liferay DXP version the bundle is built for.
-
Click Download Package. One Liferay downloads the activation bundle as a ZIP file.
-
Copy the bundle to the marketplace volume, as in step 3 of Licensing the Environment.
Changing a Non-Production Environment’s Subscriptions
To change the subscriptions in a non-production environment’s bundle,
-
Open the Download Offline Activation Package form for a non-production environment, as in steps 1 and 2 of Requesting an Activation Bundle.
-
Click the ellipsis (…) menu on the environment’s row, and click Modify.
The form opens with the environment’s current subscriptions selected. If the project is no longer entitled to one of them, the form drops it and says so.
-
Select or clear subscriptions, and click Download Package. One Liferay updates that environment rather than adding one, and downloads its new activation bundle.
-
Replace the environment’s bundle with the new one and watch for the new expiration date, as in steps 2 and 3 of Renewing an Offline License.
Renewing an Offline License
-
Read the environment’s current offline request and exchange it for a new activation bundle, as in steps 1 and 2 of Licensing the Environment. For a non-production environment, click Modify on its row instead, as in Changing a Non-Production Environment’s Subscriptions.
-
Replace the old bundle with the new one, keeping the same file name, as in step 3 of Licensing the Environment.
-
Watch the environment until the
VALID-UNTILcolumn shows the new expiration date. The operator reads the bundle on its next heartbeat, the license check it runs every ten minutes by default.