From ed0ee174a6147a402d9fccd9ad6800a840dc5fa3 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 16:28:28 +0300 Subject: [PATCH 1/8] onprem: 2.8.3 --- codefresh/Chart.yaml | 4 ++-- codefresh/README.md | 2 +- codefresh/files/mongoSeedJobScript.sh | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/codefresh/Chart.yaml b/codefresh/Chart.yaml index 939102a5f..db62bb102 100644 --- a/codefresh/Chart.yaml +++ b/codefresh/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Helm Chart for Codefresh On-Prem name: codefresh -version: 2.8.2 +version: 2.8.3 keywords: - codefresh home: https://codefresh.io/ @@ -19,7 +19,7 @@ annotations: # supported kinds are added, changed, deprecated, removed, fixed and security. artifacthub.io/changes: | - kind: fixed - description: "Fix createDB function in postgres seed job" + description: "Fix mongo seed job to support Atlas" dependencies: - name: cf-common repository: oci://quay.io/codefresh/charts diff --git a/codefresh/README.md b/codefresh/README.md index 2efd0b612..c12076965 100644 --- a/codefresh/README.md +++ b/codefresh/README.md @@ -1,6 +1,6 @@ ## Codefresh On-Premises -![Version: 2.8.2](https://img.shields.io/badge/Version-2.8.2-informational?style=flat-square) ![AppVersion: 2.8.0](https://img.shields.io/badge/AppVersion-2.8.0-informational?style=flat-square) +![Version: 2.8.3](https://img.shields.io/badge/Version-2.8.3-informational?style=flat-square) ![AppVersion: 2.8.0](https://img.shields.io/badge/AppVersion-2.8.0-informational?style=flat-square) Helm chart for deploying [Codefresh On-Premises](https://codefresh.io/docs/docs/getting-started/intro-to-codefresh/) to Kubernetes. diff --git a/codefresh/files/mongoSeedJobScript.sh b/codefresh/files/mongoSeedJobScript.sh index bf6878cc0..86d30474e 100644 --- a/codefresh/files/mongoSeedJobScript.sh +++ b/codefresh/files/mongoSeedJobScript.sh @@ -115,6 +115,9 @@ for MONGODB_DATABASE in ${MONGODB_DATABASES[@]}; do mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"${MONGODB_DATABASE}\").createUser({user: \"${MONGODB_USER}\", pwd: \"${MONGODB_PASSWORD}\", roles: [\"readWrite\"]})" 2>&1 || true waitForMongoDB mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"${MONGODB_DATABASE}\").changeUserPassword(\"${MONGODB_USER}\",\"${MONGODB_PASSWORD}\")" 2>&1 || true + + # MongoDB Atlas + mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db.${MONGODB_DATABASE}.insertOne({ name: "Example", value: 123 }))" 2>&1 || true done mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"codefresh\").grantRolesToUser( \"${MONGODB_USER}\", [ { role: \"readWrite\", db: \"pipeline-manager\" } ] )" 2>&1 || true From 7918b8ce6b3ca3525550f5f989808b6886f6d049 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 16:30:26 +0300 Subject: [PATCH 2/8] onprem: 2.8.3 --- codefresh/files/mongoSeedJobScript.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codefresh/files/mongoSeedJobScript.sh b/codefresh/files/mongoSeedJobScript.sh index 86d30474e..b2c936d09 100644 --- a/codefresh/files/mongoSeedJobScript.sh +++ b/codefresh/files/mongoSeedJobScript.sh @@ -117,7 +117,7 @@ for MONGODB_DATABASE in ${MONGODB_DATABASES[@]}; do mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"${MONGODB_DATABASE}\").changeUserPassword(\"${MONGODB_USER}\",\"${MONGODB_PASSWORD}\")" 2>&1 || true # MongoDB Atlas - mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db.${MONGODB_DATABASE}.insertOne({ name: "Example", value: 123 }))" 2>&1 || true + mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db.${MONGODB_DATABASE}.insertOne({ name: "init", value: true }))" 2>&1 || true done mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"codefresh\").grantRolesToUser( \"${MONGODB_USER}\", [ { role: \"readWrite\", db: \"pipeline-manager\" } ] )" 2>&1 || true From 1c68dd6177cad819f4df167c3faf095cb7cbf909 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 16:59:26 +0300 Subject: [PATCH 3/8] onprem: 2.8.3 --- codefresh/files/mongoSeedJobScript.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codefresh/files/mongoSeedJobScript.sh b/codefresh/files/mongoSeedJobScript.sh index b2c936d09..399822979 100644 --- a/codefresh/files/mongoSeedJobScript.sh +++ b/codefresh/files/mongoSeedJobScript.sh @@ -117,7 +117,7 @@ for MONGODB_DATABASE in ${MONGODB_DATABASES[@]}; do mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"${MONGODB_DATABASE}\").changeUserPassword(\"${MONGODB_USER}\",\"${MONGODB_PASSWORD}\")" 2>&1 || true # MongoDB Atlas - mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db.${MONGODB_DATABASE}.insertOne({ name: "init", value: true }))" 2>&1 || true + mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db.${MONGODB_DATABASE}.insertOne({ name: "init", value: true })" 2>&1 || true done mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"codefresh\").grantRolesToUser( \"${MONGODB_USER}\", [ { role: \"readWrite\", db: \"pipeline-manager\" } ] )" 2>&1 || true From 90aa4d98fbdc08297a6c7276d839cd624bf8547d Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 17:13:30 +0300 Subject: [PATCH 4/8] onprem: 2.8.3 --- codefresh/files/mongoSeedJobScript.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codefresh/files/mongoSeedJobScript.sh b/codefresh/files/mongoSeedJobScript.sh index 399822979..4d3f486b2 100644 --- a/codefresh/files/mongoSeedJobScript.sh +++ b/codefresh/files/mongoSeedJobScript.sh @@ -117,7 +117,7 @@ for MONGODB_DATABASE in ${MONGODB_DATABASES[@]}; do mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"${MONGODB_DATABASE}\").changeUserPassword(\"${MONGODB_USER}\",\"${MONGODB_PASSWORD}\")" 2>&1 || true # MongoDB Atlas - mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db.${MONGODB_DATABASE}.insertOne({ name: "init", value: true })" 2>&1 || true + mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "use ${MONGODB_DATABASE}; db[\"${MONGODB_DATABASE}\"].insertOne({ name: "init", value: true })" 2>&1 || true done mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"codefresh\").grantRolesToUser( \"${MONGODB_USER}\", [ { role: \"readWrite\", db: \"pipeline-manager\" } ] )" 2>&1 || true From 4ddc944851a25808745a05991dd2a595a4f7307d Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 17:23:40 +0300 Subject: [PATCH 5/8] onprem: 2.8.3 --- codefresh/files/mongoSeedJobScript.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codefresh/files/mongoSeedJobScript.sh b/codefresh/files/mongoSeedJobScript.sh index 4d3f486b2..3ba69fcc9 100644 --- a/codefresh/files/mongoSeedJobScript.sh +++ b/codefresh/files/mongoSeedJobScript.sh @@ -117,7 +117,7 @@ for MONGODB_DATABASE in ${MONGODB_DATABASES[@]}; do mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"${MONGODB_DATABASE}\").changeUserPassword(\"${MONGODB_USER}\",\"${MONGODB_PASSWORD}\")" 2>&1 || true # MongoDB Atlas - mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "use ${MONGODB_DATABASE}; db[\"${MONGODB_DATABASE}\"].insertOne({ name: "init", value: true })" 2>&1 || true + mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db[\"${MONGODB_DATABASE}\"].insertOne({ name: "init", value: true })" 2>&1 || true done mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"codefresh\").grantRolesToUser( \"${MONGODB_USER}\", [ { role: \"readWrite\", db: \"pipeline-manager\" } ] )" 2>&1 || true From 7852390a18e07b70b9af024396929279df6101ca Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 17:30:07 +0300 Subject: [PATCH 6/8] onprem: 2.8.3 --- codefresh/files/mongoSeedJobScript.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codefresh/files/mongoSeedJobScript.sh b/codefresh/files/mongoSeedJobScript.sh index 3ba69fcc9..6762bad5c 100644 --- a/codefresh/files/mongoSeedJobScript.sh +++ b/codefresh/files/mongoSeedJobScript.sh @@ -117,7 +117,7 @@ for MONGODB_DATABASE in ${MONGODB_DATABASES[@]}; do mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"${MONGODB_DATABASE}\").changeUserPassword(\"${MONGODB_USER}\",\"${MONGODB_PASSWORD}\")" 2>&1 || true # MongoDB Atlas - mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db[\"${MONGODB_DATABASE}\"].insertOne({ name: "init", value: true })" 2>&1 || true + mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db = db.getSiblingDB(\"${MONGODB_DATABASE}\"); db[\"${MONGODB_DATABASE}\"].insertOne({ name: \"init\", value: true })" 2>&1 || true done mongosh ${MONGODB_ROOT_URI} ${MONGO_URI_EXTRA_PARAMS} --eval "db.getSiblingDB(\"codefresh\").grantRolesToUser( \"${MONGODB_USER}\", [ { role: \"readWrite\", db: \"pipeline-manager\" } ] )" 2>&1 || true From 3eb8b5397e3cb8aece3c8f72c5adb7287cde008b Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 17:51:13 +0300 Subject: [PATCH 7/8] onprem: 2.8.3 --- codefresh/README.md | 22 +--------------------- codefresh/README.md.gotmpl | 23 +---------------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/codefresh/README.md b/codefresh/README.md index c12076965..c1bba9d34 100644 --- a/codefresh/README.md +++ b/codefresh/README.md @@ -227,33 +227,13 @@ However, you might need to use external services like [MongoDB Atlas Database](h #### External MongoDB -> ⚠️ **Important!** If you use MongoDB Atlas, you must create the following databases in advance before installing Codefresh: - -```console -archive -audit -charts-manager -cluster-providers -codefresh -context-manager -gitops-dashboard-manager -k8s-monitor -pipeline-manager -platform-analytics-postgres -read-models -runtime-environment-manager -onboarding-status -payments -``` - -> You alse need to create a database user with `Write` permissions to ALL databases.
+> ⚠️ **Important!** If you use MongoDB Atlas, you must create user with `Write` permissions before installing Codefresh: > Then, provide the user credentials in the chart values at
`.Values.global.mongodbUser/mongodbRootUserSecretKeyRef`
`.Values.global.mongodbPassword/mongodbRootPasswordSecretKeyRef`
`.Values.seed.mongoSeedJob.mongodbRootUser/mongodbRootUserSecretKeyRef`
`.Values.seed.mongoSeedJob.mongodbRootPassword/mongodbRootPasswordSecretKeyRef`
> Ref:
-> [Create Database in Atlas](https://www.mongodb.com/docs/atlas/atlas-ui/databases/#create-a-database)
> [Create Users in Atlas](https://www.mongodb.com/docs/atlas/security-add-mongodb-users/#configure-database-users) `values.yaml` for external MongoDB: diff --git a/codefresh/README.md.gotmpl b/codefresh/README.md.gotmpl index f98f7c26a..23e7b925c 100644 --- a/codefresh/README.md.gotmpl +++ b/codefresh/README.md.gotmpl @@ -228,36 +228,15 @@ However, you might need to use external services like [MongoDB Atlas Database](h #### External MongoDB -> ⚠️ **Important!** If you use MongoDB Atlas, you must create the following databases in advance before installing Codefresh: - -```console -archive -audit -charts-manager -cluster-providers -codefresh -context-manager -gitops-dashboard-manager -k8s-monitor -pipeline-manager -platform-analytics-postgres -read-models -runtime-environment-manager -onboarding-status -payments -``` - -> You alse need to create a database user with `Write` permissions to ALL databases.
+> ⚠️ **Important!** If you use MongoDB Atlas, you must create user with `Write` permissions before installing Codefresh: > Then, provide the user credentials in the chart values at
`.Values.global.mongodbUser/mongodbRootUserSecretKeyRef`
`.Values.global.mongodbPassword/mongodbRootPasswordSecretKeyRef`
`.Values.seed.mongoSeedJob.mongodbRootUser/mongodbRootUserSecretKeyRef`
`.Values.seed.mongoSeedJob.mongodbRootPassword/mongodbRootPasswordSecretKeyRef`
> Ref:
-> [Create Database in Atlas](https://www.mongodb.com/docs/atlas/atlas-ui/databases/#create-a-database)
> [Create Users in Atlas](https://www.mongodb.com/docs/atlas/security-add-mongodb-users/#configure-database-users) - `values.yaml` for external MongoDB: ```yaml From b290b38b8ea145f81718ce80df09c7a7fb9b5b95 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 6 Jun 2025 17:52:37 +0300 Subject: [PATCH 8/8] onprem: 2.8.3 --- codefresh/README.md | 2 +- codefresh/README.md.gotmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codefresh/README.md b/codefresh/README.md index c1bba9d34..91d4d5033 100644 --- a/codefresh/README.md +++ b/codefresh/README.md @@ -227,7 +227,7 @@ However, you might need to use external services like [MongoDB Atlas Database](h #### External MongoDB -> ⚠️ **Important!** If you use MongoDB Atlas, you must create user with `Write` permissions before installing Codefresh: +> ⚠️ **Important!** If you use MongoDB Atlas, you must create user with `Write` permissions before installing Codefresh:
> Then, provide the user credentials in the chart values at
`.Values.global.mongodbUser/mongodbRootUserSecretKeyRef`
`.Values.global.mongodbPassword/mongodbRootPasswordSecretKeyRef`
diff --git a/codefresh/README.md.gotmpl b/codefresh/README.md.gotmpl index 23e7b925c..4492db31b 100644 --- a/codefresh/README.md.gotmpl +++ b/codefresh/README.md.gotmpl @@ -228,7 +228,7 @@ However, you might need to use external services like [MongoDB Atlas Database](h #### External MongoDB -> ⚠️ **Important!** If you use MongoDB Atlas, you must create user with `Write` permissions before installing Codefresh: +> ⚠️ **Important!** If you use MongoDB Atlas, you must create user with `Write` permissions before installing Codefresh:
> Then, provide the user credentials in the chart values at
`.Values.global.mongodbUser/mongodbRootUserSecretKeyRef`
`.Values.global.mongodbPassword/mongodbRootPasswordSecretKeyRef`