To activate Artifactory HA, you must install an appropriate license as part of the installation. There are three ways to manage the license: via Artifactory UI, REST API, or a Kubernetes Secret.
Specifying multiple licenses
Whether in the Artifactory UI, using the REST API or in the artifactory.cluster.license
file, make sure that the licenses are separated by a newline.
The easiest and recommended way is by using Artifactory UI. Using the Kubernetes Secret or REST API is for advanced users and is better suited for automation.
Warning
You should use only one of these methods. Switching between them while a cluster is running might disable your Artifactory HA cluster.
Option A: Using REST API
You can add licenses via REST API. Note that the REST API uses "\n" for the newlines in the licenses (this is currently recommended method).
Option B: Using the Artifactory UI
Once the primary cluster is running, open Artifactory UI and insert the license(s) in the UI. See HA installation and setup for more details.
Enter all of the licenses at once, with each license separated by a newline. If you add the licenses one at a time, you may get redirected to a node without a license and the UI will not load for that node.
Option C: Using a Kubernetes Secret
You can deploy the Artifactory license(s) as a Kubernetes Secret. You will need to prepare a text file with the license(s) written in it. If adding multiple licenses, they are added in the same file. Remember to addtwo new lines between eachlicense block.
Create the Kubernetes secret (assuming the local license file is '
art.lic
').kubectl create secret generic artifactory-cluster-license --from-file=./art.lic
Create a
license-values.yaml
.artifactory: license: secret: artifactory-cluster-license dataKey: art.lic
Install with the
license-values.yaml
.Run the following command for JFrog Platform.
helm upgrade --install jfrog-platform --namespace jfrog-platform --create-namespace jfrog/jfrog-platform -f license-values.yaml
Run the following command for Artifactory.
helm upgrade --install artifactory --set artifactory.license.secret=artifactory-cluster-license,artifactory.license.dataKey=artifactory.lic --namespace artifactory jfrog/artifactory
Important
This method is relevant for initial deployment only. Once Artifactory is deployed, you should not keep passing these parameters, since the license is already persisted into Artifactory's storage (and they will be ignored). Updating the license should be done via Artifactory UI or REST API.
Create the Kubernetes Secret as Part of the Helm Release
Create a
license-values.yaml
.artifactory: license: licenseKey: |- <LICENSE_KEY1> <LICENSE_KEY2> <LICENSE_KEY3>
Install with the
license-values.yaml
.helm upgrade --install jfrog-platform --namespace jfrog-platform --create-namespace jfrog/jfrog-platform -f license-values.yaml