External Database for Artifactory Helm Installation

Use external PostgreSQL with Artifactory Helm: disable internal PostgreSQL, set custom JDBC URL, user, and password.

For production installations, use an external PostgreSQL database with a static password.

Configure External PostgreSQL Database with Artifactory Helm Installation

To use an external PostgreSQL with a different database name — for example, my-artifactory-db — set a custom PostgreSQL connection URL using that database name.

Set the following parameters:

postgresql:
 enabled: false
database:
 type: postgresql
 driver: org.postgresql.Driver
 url: 'jdbc:postgresql://${DB_HOST}:${DB_PORT}/my-artifactory-db'
 user: <DB_USER>
 password: <DB_PASSWORD>
📘

Note

You must set postgresql.enabled=false for the chart to use the database.* parameters. Without it, the chart ignores database.* parameters.

Configure Artifactory Helm Installation with an External Oracle Database

To use Artifactory with an Oracle database, copy the required instant client library files (libaio) to tomcat lib and set the LD_LIBRARY_PATH environment variable.

  1. Create a value file with the configuration.

    postgresql:
      enabled: false
    database:
      type: oracle
      driver: oracle.jdbc.OracleDriver
      url: <DB_URL>
      user: <DB_USER>
      password: <DB_PASSWORD>
    artifactory:
      preStartCommand:  mkdir -p /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib; cd /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib && curl https://download.oracle.com/otn_software/linux/instantclient/2111000/instantclient-basic-linux.x64-21.11.0.0.0dbru.zip -o instantclient-basic-linux.x64-21.11.0.0.0dbru.zip && unzip -jn instantclient-basic-linux.x64-21.11.0.0.0dbru.zip && cp instantclient_21_11/ojdbc8.jar . && cp /opt/jfrog/artifactory/app/artifactory/libaio/* .
      extraEnvironmentVariables:
      - name: LD_LIBRARY_PATH
         value: /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib
    metadata:
      extraEnvironmentVariables:
      - name: LD_LIBRARY_PATH
         value: /opt/jfrog/artifactory/app/artifactory/libaio/:/opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib
📘

Note

This configuration uses Oracle Instant Client for x64. For ARM64 Artifactory installations, update preStartCommand with the URL of Oracle Instant Client lib compatible with ARM64.

  1. Install Artifactory with the values file you created.

    Artifactory

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

    Artifactory HA

    helm upgrade --install artifactory-ha jfrog/artifactory-ha --namespace artifactory-ha -f values.yaml
  2. If upgrading from 6.x to 7.x, add the same preStartCommand under artifactory.migration.preStartCommand.

Configure Other External Databases with Artifactory Helm Installation

To use a different database instead of the default PostgreSQL, see configuring the database.

📘

Note

The official Artifactory Docker images include the PostgreSQL database driver. For other database types, add the required driver to Artifactory's tomcat/lib.

Set the following parameters:

# Make sure your Artifactory Docker image has the MySQL database driver in it
postgresql:
 enabled: false
database:
 type: mysql
 driver: com.mysql.jdbc.Driver
 url: <DB_URL>
 user: <DB_USER>
 password: <DB_PASSWORD>
artifactory:
 preStartCommand: "mkdir -p /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib; cd /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib && curl https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.41/mysql-connector-java-5.1.41.jar -o /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib/mysql-connector-java-5.1.41.jar"
📘

Note

You must set postgresql.enabled=false for the chart to use the database.* parameters. Without it, the chart ignores database.* parameters.

Configure Database Credentials in Helm with a Pre-existing Kubernetes Secret

If your database credentials are in a pre-existing Kubernetes Secret, specify them via database.secrets instead of database.user and database.password.

# Create a secret containing the database credentials
postgresql:
 enabled: false
database:
 type: postgresql
 driver: org.postgresql.Driver
 secrets:
  user:
    name: "my-secret"
    key: "user"
  password:
    name: "my-secret"
    key: "password"
  url:
    name: "my-secret"
    key: "url"