Starting Artifactory version 7.31.10, you may now configure PostgreSQL in HA mode with Artifactory.
As of the 14th of November, 2022, there isn’t any direct way to configure PostgreSQL HA in Artifactory Helm chart. This article shows how to provide a custom system.yaml, that contains the HA configuration based on the official documentation.
Important: Only one PostgreSQL primary server and multiple PostgreSQL read replicas can be configured to work with Artifactory. Please read the above linked documentation page for details.
1. Configure the DB settings under shared.database AND metadata.database in the custom-system.yaml file, to work with PostgreSQL HA:
shared: database: type: postgresql url: "jdbc:postgresql://xx.xx.x.x:5432,yy.yy.y.y:5432/artifactory?targetServerType=primary" driver: org.postgresql.Driver username: "artifactory" password: "password" artifactory: ... frontend: ... access: ... metadata: database: type: postgresql url: "jdbc:postgresql://xx.xx.x.x:5432,yy.yy.y.y:5432/artifactory?target_session_attrs=read-write" driver: org.postgresql.Driver username: "artifactory" password: "password"
2. Create a secret containing this configuration:
kubectl create secret generic csy --from-file ./custom-system.yaml
3. Pass it to the systemYamlOverride property, in the values.yaml as shown below:
systemYamlOverride: existingSecret: csy dataKey: custom-system.yaml
4. Pass the new values.yaml file using the Helm upgrade command:
helm upgrade --install artifactory jfrog/artifactory -f values.yaml --namespace your-namespace