Bootstraps Artifactory

JFrog Installation & Setup Documentation

Content Type
Installation & Setup
ft:sourceType
Paligo

You can bootstrap the Artifactory admin password and the Artifactory configuration when using Helm Charts.

Bootstrap the Artifactory Admin Password

You can bootstrap the admin user password as described in Recreating the Default Admin User.Recreate the Default Admin User

  1. Create admin-creds-values.yaml and provide the IP (by default 127.0.0.1) and password.

    artifactory:
      admin:
        ip: "<IP_RANGE>" # Example: "*" to allow access from anywhere
        username: "admin"
        password: "<PASSWD>"
  2. Apply the admin-creds-values.yaml file.

    Artifactory

    helm upgrade --install artifactory --namespace artifactory jfrog/artifactory -f admin-creds-values.yaml

    Artifactory HA

    helm upgrade --install artifactory-ha --namespace artifactory-ha jfrog/artifactory-ha -f admin-creds-values.yaml
  3. Restart the Artifactory pod (Kubectl delete pod <pod_name>).

Bootstrap the Artifactory Configuration

You can use Helm Charts to bootstrap the Artifactory global and security configuration. To do so, you will need an Artifactory subscription.

  1. Create a bootstrap-config.yaml with an artifactory.config.import.xml and a security.import.xml as shown below.

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: my-release-bootstrap-config
    data:
      artifactory.config.import.xml: |
        <config contents>
      security.import.xml: |
        <config contents>
  2. Create a configMap in Kubernetes.

    kubectl apply -f bootstrap-config.yaml
  3. Pass the configMap to Helm using one of the following options.

    Artifactory

    helm upgrade --install artifactory --set artifactory.license.secret=artifactory-license,artifactory.license.dataKey=art.lic,artifactory.configMapName=my-release-bootstrap-config --namespace artifactory jfrog/artifactory

    Artifactory HA

    helm upgrade --install artifactory-ha --set artifactory.license.secret=artifactory-license,artifactory.license.dataKey=art.lic,artifactory.configMapName=my-release-bootstrap-config --namespace artifactory-ha jfrog/artifactory-ha

    or

    Artifactory

    helm upgrade --install artifactory --set artifactory.license.licenseKey=<LICENSE_KEY>,artifactory.configMapName=my-release-bootstrap-config --namespace artifactory jfrog/artifactory
    

    Artifactory HA

    helm upgrade --install artifactory-ha --set artifactory.license.licenseKey=<LICENSE_KEY>,artifactory.configMapName=my-release-bootstrap-config --namespace artifactory-ha jfrog/artifactory-ha

    For more information, see Bootstrapping the Artifactory Global Configuration and Bootstrapping the Artifactory Security Configuration.

Copy Configuration Files for Every Startup

Files stored in the /artifactory-extra-conf directory are only copied to the ARTIFACTORY_HOME/etc directory upon the first startup. In some cases, you might want your configuration files to be copied to the ARTIFACTORY_HOME/etc directory on every startup.

For example:

The binarystore.xml file: If you use the default behavior, your binarystore.xml configuration will only be copied on the first startup, which means that changes you make over time to the binaryStore.xml configuration will not be applied.

  1. To make sure your changes are applied on every startup, create a YAML block with the following values:

    artifactory: 
      copyOnEveryStartup: 
        - source: /artifactory_bootstrap/binarystore.xml 
          target: etc/artifactory
  2. Install the Helm chart with the values file you created:

    Artifactory

    helm upgrade --install artifactory --namespace artifactory jfrog/artifactory -f values.yaml

    Artifactory HA

    helm upgrade --install artifactory-ha --namespace artifactory-ha jfrog/artifactory-ha -f values.yaml

Any custom configuration file you have to configure Artifactory, such as logback.xml :

  1. Create a configMap with your logback.xml configuration.

  2. Next, create a values.yaml file with the following values:

    artifactory:
      ## Create a volume pointing to the config map with your configuration file
      customVolumes: |
        - name: logback-xml-configmap
          configMap:
            name: logback-xml-configmap
      customVolumeMounts: |
        - name: logback-xml-configmap
          mountPath: /tmp/artifactory-logback/
      copyOnEveryStartup:
        - source: /tmp/artifactory-logback/*
          target: etc/artifactory
  3. Install the Helm chart with the values file you created:

    Artifactory

    helm upgrade --install artifactory --namespace artifactory jfrog/artifactory -f values.yaml

    Artifactory HA

    helm upgrade --install artifactory-ha --namespace artifactory-ha /jfrog/artifactory-ha -f values.yaml