Commit 68a5d071 authored by Max Woolf's avatar Max Woolf

ADD: Documentation around using external production PSQL providers in Auto DevOps pipelines

parent e8790766
Pipeline #85441888 failed with stage
in 49 seconds
...@@ -845,6 +845,24 @@ the database are preconfigured, but can be customized by setting the associated ...@@ -845,6 +845,24 @@ the database are preconfigured, but can be customized by setting the associated
postgres://user:password@postgres-host:postgres-port/postgres-database postgres://user:password@postgres-host:postgres-port/postgres-database
``` ```
#### Using external PostgreSQL database providers
Whilst Auto DevOps provides out-of-the-box support for a PostgreSQL container for production environments, for some use-cases it may not be sufficiently secure or resillient and you may wish to use an external managed provider for PostgreSQL, for example AWS Relational Database Service.
You will need to define environment-scoped variables for `POSTGRES_ENABLED` and `DATABASE_URL` in your project's CI/CD settings.
To achieve this, first disable the built-in PostgreSQL installation for the required environments using scoped [environment variables](https://docs.gitlab.com/ee/ci/environments.html#scoping-environments-with-specs). For this use-case, it's likely that only `production` will need to be added to this list as the built-in PostgreSQL setup for review apps and staging will be sufficient as a high-availability setup is not required.
![Auto Metrics](img/disable_postgres.png)
Next, define the database connection string however your buildpack or `Dockerfile` requires it. In many cases, this is `DATABASE_URL` defined as a connection string in the format:
```yaml
postgres://user:password@postgres-host:postgres-port/postgres-database
```
You will need to ensure that your kubernetes cluster has network access to wherever PostgreSQL is hosted.
### Environment variables ### Environment variables
The following variables can be used for setting up the Auto DevOps domain, The following variables can be used for setting up the Auto DevOps domain,
...@@ -942,11 +960,11 @@ To configure your application variables: ...@@ -942,11 +960,11 @@ To configure your application variables:
1. Go to your project's **Settings > CI/CD**, then expand the section 1. Go to your project's **Settings > CI/CD**, then expand the section
called **Variables**. called **Variables**.
1. Create a CI Variable, ensuring the key is prefixed with 2. Create a CI Variable, ensuring the key is prefixed with
`K8S_SECRET_`. For example, you can create a variable with key `K8S_SECRET_`. For example, you can create a variable with key
`K8S_SECRET_RAILS_MASTER_KEY`. `K8S_SECRET_RAILS_MASTER_KEY`.
1. Run an Auto Devops pipeline either by manually creating a new 3. Run an Auto Devops pipeline either by manually creating a new
pipeline or by pushing a code change to GitLab. pipeline or by pushing a code change to GitLab.
Auto DevOps pipelines will take your application secret variables to Auto DevOps pipelines will take your application secret variables to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment