Migrate away from builtin postgresql to RDS DB for CI pipelines
Summary
Because of all the issues we've seen around the builtin postgresql bitnami module, we decided to create an RDS instance available to CI pipelines and to expose functionality from the pipeline so that package pipelines could use it. Mattermost was the testbed for the development of this functionality, and now we are able to abandon the usage of the builtin bitnami postgresql module for use by our package within CI pipelines.
Steps to reproduce
N/A
What is the current behavior?
When a mattermost package pipeline runs, it spins up and consumes a builtin bitnami provided postgresql database.
What is the expected behavior?
When a mattermost package pipeline runs, it consumes an RDS DB instead of a builtin bitnami provided one.
One of the cypress tests (it should have storage
) currently fails when using the new functionality. This is marked on the draft MR as an issue, and I had to clear that test to get the prototype pipelines to pass. I'm not sure if this test fails on the regular pipeline or only with the CI RDS functionality enabled. Whoever picks this up and runs with it will need to resolve it by either fixing the test, removing it, or something.
Relevant logs and/or screenshots
Initial proof of concept work for this was shown on this clean install ci pipeline and this upgrade ci pipeline.
Possible fixes
The bulk of the work to be done is in the db-credentials secret template and the values yaml. There is already a draft MR open that implements the needed changes but some investigation needs to be done regarding a failing cypress test.
Once that's done the bigbang umbrella needs to be modified to stop installing postgresql in the pipelines. This patch should accomplish that:
diff --git a/tests/package-mapping.yaml b/tests/package-mapping.yaml
index b98854f2..c51892d8 100644
--- a/tests/package-mapping.yaml
+++ b/tests/package-mapping.yaml
@@ -72,6 +72,14 @@ mattermostOperator:
hrName: "mattermost-operator"
filePath: "mattermost-operator"
mattermost:
+ bigbang_ci:
+ rds:
+ enabled: true
+ database: .addons.mattermost.values.database.auth.database
+ username: .addons.mattermost.values.database.auth.username
+ password: .addons.mattermost.values.database.auth.password
+ host: .addons.mattermost.values.database.auth.host
+ port: .addons.mattermost.values.database.auth.port
dependencies:
- "mattermostOperator"
- "minioOperator"
diff --git a/tests/rke2-test-values.yaml b/tests/rke2-test-values.yaml
index 9ba6fba1..ab476307 100644
--- a/tests/rke2-test-values.yaml
+++ b/tests/rke2-test-values.yaml
@@ -503,6 +503,7 @@ addons:
cypress:
artifacts: false
postgresql:
+ sslmode: require
persistence:
size: 256Mi
resources:
diff --git a/tests/test-values.yaml b/tests/test-values.yaml
index 0a62ab46..25e52d81 100644
--- a/tests/test-values.yaml
+++ b/tests/test-values.yaml
@@ -2035,6 +2035,7 @@ addons:
resolution: DNS
postgresql:
+ sslmode: require
persistence:
size: 256Mi
resources:
/cc {put CODEOWNERs @githandles here}