ARTIFACTORY: How to update the Access configuration file using Helm

AuthorFullName__c
Ashraf Kherbawy
articleNumber
000005504
FirstPublishedDate
2022-12-15T17:52:17Z
lastModifiedDate
2024-09-17

ARTIFACTORY: How to update the Access configuration file using Helm

Overview:

In this article, we will briefly go over modifying the Access configuration file (access.config.latest.yaml), on an Artifactory that is installed using Helm.

The chart uses the Access Patch method of modifying the Access config, which means you only need to add the values that you want to modify (No need to add default values).

You may find all of the possible Access configuration values (With their default values) here, and we will be using some of them in the example below.


How it’s built in our Helm Chart: 

In our chart, the configuration is set in the Unified Secret template alongside other configurations, and in the case you have the Unified Secret disabled, then the Artifactory Access Config template will be used instead. 

Depending on what you have enabled, the Statefulset template will take in the relevant configuration from either template, creates a volume and a volume mount (At /tmp/etc/access.config.patch.yml), and then copies it to the Access directory (/var/opt/jfrog/artifactory/etc/access/access.config.patch.yml), with the help of the copy-system-configurations initContainer that is built within the Statefulset.

P.S: This works the same for both the Artifactory chart and Artifactory-ha chart

How to modify the Access configuration:

In your values.yaml, you will need to add under the access.accessConfig key all of the configurations that you want to change, as they are indented and ordered in the actual configuration file. For example, assuming you want to configure the following values:

security:
  tls:
    enabled: true
  user-lock-policy:
    attempts: 5
token:
  refresh-expiry: 100000


You simply need to paste the above under the access.accessConfig key:
 

access:
  accessConfig:
    security:
      tls:
        enabled: true
      user-lock-policy:
        attempts: 5
    token:
      refresh-expiry: 100000


Pretty simple!

One last important thing to note, is that the templates take in the values as they are, and will create the Patch file out of it. This means that if you mess up any value order, indentation, or have a typo, the configuration file will not initialize, and this may cause Access to crash.