Use an External Database with Artifactory Helm Installation
For production grade installations, it is recommended to use an external a PostgreSQL with static password.
For production grade installations, it is recommended to use an external PostgreSQL with a static password.
Configure External PostgreSQL Database with Artifactory Helm Installation
There are cases where you want to use an external PostgreSQL with a different database name, e.g., my-artifactory-db; in this case, you will need to set a custom PostgreSQL connection URL, where my-artifactory-db is the name of the database.
This can be done with 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=falsefor the chart to use thedatabase.*parameters. Without it, they will be ignored.
Configure Artifactory Helm Installation with an External Oracle Database
To use Artifactory with an Oracle database, the required instant client library files, libaio must be copied to the tomcat lib. In addition, you will need to set the LD_LIBRARY_PATH env variable.
-
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
The above configuration is using Oracle Instant Client lib for x64 architecture. For Artifactory installations on ARM64 architecture, you should update the preStartCommand with the URL of Oracle Instant Client lib compatible to ARM64 architecture.
-
Install Artifactory with the values file you created.
Artifactory
helm upgrade --install artifactory jfrog/artifactory --namespace artifactory -f values-oracle.yamlArtifactory HA
helm upgrade --install artifactory-ha jfrog/artifactory-ha --namespace artifactory-ha -f values.yaml -
If this is an upgrade from 6.x to 7.x, add the same
preStartCommandunder theartifactory.migration.preStartCommand.
Configure Other External Databases with Artifactory Helm Installation
There are cases where you want to use a different database and not the PostgreSQL provided by default. For more information, see configuring the database.
Note
The official Artifactory Docker images include the PostgreSQL database driver. For other database types, you will have to add the relevant database driver to Artifactory's tomcat/lib.
This can be done with 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=falsefor the chart to use thedatabase.*parameters. Without it, they will be ignored.
Configure Database Credentials in Helm with a Pre-existing Kubernetes Secret
If you store your database credentials in a pre-existing Kubernetes Secret, you can 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"Updated 2 days ago
