Helm HA Installation Using artifactory-ha Chart

JFrog Installation & Setup Documentation

Content Type
Installation & Setup
ft:sourceType
Paligo

Use artifactory Chart for New Helm HA Installations

We recommend that you use the artifactory chart for new Helm HA installations. The artifactory chart is under active development and has the features of the artifactory-ha chart. Existing customers who use the artifactory-ha chart can continue to use that chart.

From Artifactory 7.59.9 and Above

From version 7.59.9 and above, Artifactory HA cluster is full HA with all nodes designated as primary nodes. The basic HA installation creates three primary nodes and 0 member nodes.

  1. Add https://charts.jfrog.ioto your Helm client.

    helm repo add jfrog https://charts.jfrog.io
  2. Update the repository.

    helm repo update
  3. Create a unique Master Key (Artifactory requires a unique master key) pass it to the template during installation.

    # Create a key
    export MASTER_KEY=$(openssl rand -hex 32)echo ${MASTER_KEY}

    Custom Master Key in Production Installations

    For production grade installations, we strongly recommend that you use a custom master key. If you initially use the default master key it will be very hard to change the master key at a later stage. Therefore, generate a unique key and pass it to the template at install/upgrade time.

    Alternatively, you can manually create a secret containing the master key and pass it to the template during installation.

    # Create a key
    export MASTER_KEY=$(openssl rand -hex 32)
    echo ${MASTER_KEY}
     
    # Create a secret containing the key. The key in the secret must be named master-key
    kubectl create secret generic my-masterkey-secret -n artifactory --from-literal=master-key=${MASTER_KEY}

    In either case, make sure to pass the same master key on all future calls to Helm install and Helm upgrade. This means always passing --set artifactory.masterKey=${MASTER_KEY} (for the custom master key) or --set artifactory.masterKeySecretName=my-masterkey-secret (for the manual secret) and verifying that the contents of the secret remain unchanged.

  4. Next, create a unique join key.

    # Create a key
    export JOIN_KEY=$(openssl rand -hex 32)
    echo ${JOIN_KEY}

    By default the chart has one set in the values.yaml (artifactory.joinKey). However, this key is for demonstration purposes only and should not be used in a production environment. Generate a unique key and pass it to the template during installation.

    Alternatively, you can manually create a secret containing the join key and pass it to the template during installation.

    # Create a key
    export JOIN_KEY=$(openssl rand -hex 32)
    echo ${JOIN_KEY}
     
    # Create a secret containing the key. The key in the secret must be named join-key
    kubectl create secret generic my-joinkey-secret -n artifactory --from-literal=join-key=${JOIN_KEY}

    In either case, make sure to pass the same join key on all future calls to Helm install and Helm upgrade. This means always passing --set artifactory.joinKey=${JOIN_KEY} (for the custom join key) or --set artifactory.joinKeySecretName=my-joinkey-secret (for the manual secret) and verifying that the contents of the secret remain unchanged.

  5. Install the chart with the release name artifactory-ha and with the master key and join key.

    helm upgrade --install artifactory-ha --set artifactory.masterKey=${MASTER_KEY} --set artifactory.joinKey=${JOIN_KEY} --namespace artifactory-ha --create-namespace jfrog/artifactory-ha

    The parameter replicaCount decides the number of pods with Artifactory. You can set the replica count to a value more than or equal to 2. We recommend that you provide the value as 3.

    Change Internal PostgreSQL Password

    If you are using an internal PostgreSQL, it is recommended to change the PostgreSQL password. For more information, see Auto-generated Passwords (Internal PostgreSQL).

  6. Connect to Artifactory.

    It might take a few minutes for Artifactory's public IP to become available. Follow the instructions that are output by the install command above to get the Artifactory IP to access it. Below you will find a sample instruction of what to look for to pick the URL to reach Artifactory (in the example below, art77 is the release name and art is the namespace).

    Congratulations. You have just deployed JFrog Artifactory HA.
    SETUP:
    1. Get the Artifactory IP and URL
       NOTE: It may take a few minutes for the LoadBalancer public IP to be available!
       You can watch the status of the service by running 'kubectl get svc -w artha77-nginx'
       export SERVICE_IP=$(kubectl get svc --namespace art artha77-nginx -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
       echo http://$SERVICE_IP/
    2. Open Artifactory in your browser
       Default credential for Artifactory:
       user:     admin
       password: password
  7. Install the Artifactory HA license using one of three methods: REST API, Artifactory UI, or a Kubernetes Secret. For more information, click the link below.

  8. To access the logs, find the name of the pod using the following command.

    kubectl --namespace <your namespace> get pods
  9. To get the container logs, run the following command.

    kubectl --namespace <your namespace> logs -f <name of the pod>
  10. Optional Steps

    1. Customize the product configuration including database, Java Opts, and filestore.

      Filestore Options

      Helm filestore (storage) installations require certain modifications; for more information, see Advanced Storage Options.

      Note

      Unlike other installations, Helm Chart configurations are made to the values.yamland are then applied to the system.yaml.

      Follow these steps to apply the configuration changes.

      1. Make the changes to values.yaml.

      2. Run the command.

    2. To configure Artifactory for Helm, you will need to override the default system.yaml configuration. For more information, see Overriding the Default System YAML File.

    3. By default, Helm deploys Artifactory with PostgreSQL (running in a separate pod). It is possible to deploy Artifactory without PostgreSQL (or any other external database), which will default to the embedded Derby database.

After installing and before running Artifactory, you may set the following configurations.

  • System YAML Configuration File

    Where to find system.yaml?

    You can configure all your system settings using the system.yaml file located in the $JFROG_HOME /artifactory/var/etc folder. For more information, see Artifactory YAML Configuration.

    If you don't have a System YAML file in your folder, copy the template available in the folder and name it system.yaml.

    For the Helm charts, the system.yaml file is managed in the chart’s values.yaml.

  • Database

    Artifactory comes with an embedded Derby Database out-of-the-box. If you're planning to use it in production, it is highly recommended to first Configure the Database, and then start Artifactory.

  • Customize Java Opts (optional)Remember to modify your JVM Parameters as needed by setting JAVA_OPTIONS in Shared Configurations. The property to pass extra Java opts is artifactory.extraJavaOpts. It is highly recommended to set your Java memory parameters as follows:

    Tip

    The larger your repository or number of concurrent users, the larger you need to make the -Xms and -Xmx values accordingly. If you can reserve at least 512MB for Artifactory, the recommended minimal values are:

    -server -Xms512m -Xmx2g -Xss256k -XX:+UseG1GC

    For more recommendations about your hardware configuration (especially the -Xmx parameter), see System Requirements

  • Additional Settings

    These include: customizing ports, joinKey (join.key), masterKey (master.key).

  • Configuring the Filestore

    By default, Artifactory is configured to use the local file system as its filestore. Artifactory supports a variety of additional filestore configurations to meet a variety of needs for binary storage providers, storage size and redundancy.

Enable TLS 1.0 and 1.1 for Connectivity with Older Databases

Artifactory version 7.25.2 onwards includes OpenJDK version 11.0.11 and later. TLS 1.0 and TLS 1.1 are disabled by default from OpenJDK 11.0.11 onwards. If your database version does not support TLS 1.2, the Artifactory startup fails.

If you are unable to upgrade your database to a version that supports TLS 1.2 or later, perform the following steps to run Artifactory.

  1. Download the java.security file that has TLS 1.0 and 1.1 enabled.

  2. Create the directory, ${JFROG_HOME}/artifactory/var/bootstrap/artifactory/java.

  3. Copy the java.security file into ${JFROG_HOME}/artifactory/var/bootstrap/artifactory/java.

  4. Provide the appropriate permissions to the directory.

    Note

    Artifactory startup takes a backup of the existing java.security file and bootstraps custom java.security into the ${JFROG_HOME}/artifactory/app/third-party/java/conf/security folder.

Configure Java Security File for Helm Installations
  1. Create the following local directory.

    mkdir -p java/configmap
  2. Download the java.security file that has TLS 1.0 and 1.1 enabled.

  3. Copy the java.security file to java/configmap.

  4. Run the following command to create a custom config map. For more information, see Using Config Maps.

    kubectl create configmap java-security-config --from-file=java/configmap/java.security
  5. Pass the following custom config map to your Helm install. For more information, see Using Config Maps.

    artifactory:
      preStartCommand: "mkdir -p /opt/jfrog/artifactory/var/bootstrap/artifactory/java && cp -Lrf /tmp/java/* /opt/jfrog/artifactory/var/bootstrap/artifactory/java/"
      customVolumes: |
       - name: java-security-config
         configMap:
           name: java-security-config
      customVolumeMounts: |
        - name: java-security-config
          mountPath: /tmp/java/java.security
          subPath: java.security