You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once your Codefresh On-Prem instance is installed, configured, and confirmed to be ready for production use, the following variables must be set to `false` or removed:
185
+
186
+
```yaml
187
+
global:
188
+
env:
189
+
MONGOOSE_AUTO_INDEX: "false"
190
+
MONGO_AUTOMATIC_INDEX_CREATION: "false"
191
+
```
192
+
184
193
## Chart Configuration
185
194
186
195
See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:
@@ -785,64 +794,6 @@ cfapi-test-reporting:
785
794
enabled: true
786
795
```
787
796
788
-
⚠️ ⚠️ ⚠️
789
-
### Indexes in MongoDB
790
-
⚠️ ⚠️ ⚠️
791
-
792
-
Indexes in MongoDB are essential for efficient query performance, especially as your data grows. Without proper indexes, MongoDB must perform full collection scans to find matching documents, which can significantly slow down operations and increase resource usage. For production environments, ensuring that all frequently queried fields are indexed is vital to maintain optimal performance and scalability.
793
-
794
-
Auto-index creation in MongoDB is disabled by default in Codefresh On-Prem to prevent unexpected performance issues in production environments during upgrades. When enabled, MongoDB will automatically create indexes for fields used in queries, which can lead to high CPU and disk usage, increased I/O, and potential service disruptions—especially on large datasets. By requiring manual index management, administrators can plan index creation during maintenance windows, ensuring system stability and predictable performance before upgrading Codefresh On-Prem.
795
-
796
-
It is critical to ensure that your MongoDB indexes are always aligned with the latest recommended state for your Codefresh On-Prem version. Outdated or missing indexes can lead to degraded performance, slow queries, and increased resource consumption. Always review release notes and update or create indexes as specified during upgrades or when new collections/fields are introduced. Regularly auditing and maintaining your indexes helps ensure optimal system reliability and scalability.
797
-
798
-
The indexes list is located at the [codefresh-io/codefresh-onprem-helm](https://github.com/codefresh-io/codefresh-onprem-helm/tree/release-2.8/indexes) repository.
799
-
The indexes are stored in JSON files with keys and options specified.
800
-
801
-
The directory structure is:
802
-
803
-
```console
804
-
codefresh-onprem-helm
805
-
├── indexes
806
-
│ ├── <DB_NAME> # MongoDB database name
807
-
│ │ ├── <COLLECTION_NAME>.json # MongoDB indexes for the specified collection
808
-
```
809
-
810
-
#### Enabling auto-index creation
811
-
812
-
For first-time installations, you **must** enable auto-index creation by setting the following values:
813
-
814
-
```yaml
815
-
global:
816
-
env:
817
-
MONGOOSE_AUTO_INDEX: "true"
818
-
MONGO_AUTOMATIC_INDEX_CREATION: "true"
819
-
```
820
-
821
-
You **should** disable it for the next upgrades by setting these variables to `false`:
822
-
823
-
```yaml
824
-
global:
825
-
env:
826
-
MONGOOSE_AUTO_INDEX: "false"
827
-
MONGO_AUTOMATIC_INDEX_CREATION: "false"
828
-
```
829
-
830
-
#### Creating Indexes manually
831
-
832
-
> **Note!** If you have a large amount of MongoDB data, it is recommended to create indexes manually. Enabling auto-index creation can cause performance degradation during the index creation process with large datasets.
833
-
834
-
Depending on your MongoDB service (e.g., Atlas, self-hosted), you can create indexes using the MongoDB shell or the Atlas UI.
835
-
836
-
Ref:
837
-
- [Create an Index in Atlas DB](https://www.mongodb.com/docs/atlas/atlas-ui/indexes/#create-an-index)
838
-
- [Create an Index with mongosh](https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/)
839
-
840
-
##### ⚠️ Upgrading when the indexes are maintained manually
841
-
842
-
If you maintain indexes manually and you upgrade your On-Prem installation you must create all indexes which were introduced from your current version up to the version you upgrade to manually.
843
-
844
-
You can follow [Upgrading section](#upgrading) to see what changes were made for indexes in every specific release.
845
-
846
797
### High Availability
847
798
848
799
The chart installs the non-HA version of Codefresh by default. If you want to run Codefresh in HA mode, use the example values below.
@@ -1492,6 +1443,86 @@ To see all the claims supported by Codefresh OIDC provider, see `claims_supporte
1492
1443
1493
1444
Use [obtain-oidc-id-token](https://github.com/codefresh-io/steps/blob/822afc0a9a128384e76459c6573628020a2cf404/incubating/obtain-oidc-id-token/step.yaml#L27-L58) and [aws-sts-assume-role-with-web-identity](https://github.com/codefresh-io/steps/blob/822afc0a9a128384e76459c6573628020a2cf404/incubating/aws-sts-assume-role-with-web-identity/step.yaml#L29-L63) steps to exchange the OIDC token (JWT) for a cloud access token.
1494
1445
1446
+
## Maintaining MongoDB Indexes
1447
+
1448
+
Sometimes, in new releases of Codefresh On-Prem, index requirements change. When this happens, it's mentioned in the [Upgrading section](#upgrading) for the specific release.
1449
+
1450
+
> ℹ️ If you're upgrading from version `X` to version `Y`, and index requirements were updated in any of the intermediate versions, you only need to align your indexes with the index requirements of version `Y`. To do that, follow [Index alignment](#index-alignment) instructions.
1451
+
1452
+
### Index alignment
1453
+
1454
+
The required index definitions for each release can be found at the following resources:
The indexes are stored in JSON files with keys and options specified.
1461
+
1462
+
The directory structure is:
1463
+
1464
+
```console
1465
+
indexes
1466
+
├── <DB_NAME> # MongoDB database name
1467
+
│ ├── <COLLECTION_NAME>.json # MongoDB indexes for the specified collection
1468
+
```
1469
+
1470
+
**Overview of the index alignment process:**
1471
+
1472
+
1. Identify the differences between the indexes in your MongoDB instance and the required index definitions.
1473
+
2. Create any missing indexes one by one. (It's important not to create them in bulk.)
1474
+
3. Then remove any unnecessary indexes.
1475
+
1476
+
> ⚠️ **Note! Any changes to indexes should be performed during a defined maintenance window or during periods of lowest traffic to MongoDB.**
1477
+
>
1478
+
> Building indexes during time periods where the target collection is under heavy write load can result in reduced write performance and longer index builds. ([*Source: MongoDB official documentation*](https://www.mongodb.com/docs/v6.0/core/index-creation/#index-build-impact-on-database-performance))
1479
+
>
1480
+
> Even minor changes to indexes (e.g., index removal) can cause brief but noticeable performance degradationю ([*Source: MongoDB official documentation*](https://www.mongodb.com/docs/v6.0/core/query-plans/#plan-cache-flushes))
1481
+
1482
+
#### Self-hosted MongoDB
1483
+
1484
+
For self-hosted MongoDB, follow the instructions below:
1485
+
1486
+
- Connect to the MongoDB server using the [mongosh](https://www.mongodb.com/docs/mongodb-shell/install/) shell. Open your terminal or command prompt and run the following command, replacing `<connection_string>` with the appropriate MongoDB connection string for your server:
1487
+
1488
+
```shell
1489
+
mongosh "<connection_string>"
1490
+
```
1491
+
1492
+
- Retrieve the list of indexes for a specific collection:
- Compare your indexes with the required indexes for the target release, and adjust them by creating any missing indexes or removing any unnecessary ones
1499
+
1500
+
**Index creation**
1501
+
1502
+
> ⚠ **Note! Always create indexes sequentially, one by one. Don't create them in bulk.**
1503
+
1504
+
- To create an index, use the `createIndex()` method:
If you're hosting MongoDB on [Atlas](https://www.mongodb.com/atlas/database), use the following [Manage Indexes](https://www.mongodb.com/docs/atlas/atlas-ui/indexes/) guide to View, Create or Remove indexes.
1523
+
1524
+
> ⚠️ **Important!** In Atlas in production environment the indexes must be created in *a rolling fashion* mode, i.e., with `Build index via rolling process` checkbox enabled.
1525
+
1495
1526
## Upgrading
1496
1527
1497
1528
### To 2-0-0
@@ -2027,24 +2058,22 @@ cfapi:
2027
2058
2028
2059
### To 2-6-0
2029
2060
2061
+
> ⚠️ **WARNING! MongoDB indexes changed!**
2062
+
>
2063
+
> Please, follow [Maintaining MongoDB indexes](#maintaining-mongodb-indexes) guide to meet index requirements **BEFORE** the upgrade process.
2064
+
2030
2065
### [What's new in 2.6.x](https://codefresh.io/docs/docs/whats-new/on-prem-release-notes/#on-premises-version-26)
2031
2066
2032
2067
#### Affected values
2033
2068
2034
2069
[Image digests in containers](#image-digests-in-containers)
2035
2070
2036
-
#### Auto-index creation in MongoDB
2037
-
2038
-
[Auto-index creation in MongoDB](#auto-index-creation-in-mongodb)
2039
-
2040
-
#### ⚠️ New indexes in MongoDB
2041
-
2042
-
If you maintain indexes manually (i.e. [Auto-index creation](#enabling-auto-index-creation) is off) you must create the following index **before** the upgrade:
> Please, follow [Maintaining MongoDB indexes](#maintaining-mongodb-indexes) guide to meet index requirements **BEFORE** the upgrade process.
2076
+
2048
2077
### [What's new in 2.7.x](https://codefresh.io/docs/docs/whats-new/on-prem-release-notes/#on-premises-version-27)
2049
2078
2050
2079
#### Affected values
@@ -2074,17 +2103,12 @@ global:
2074
2103
- "value"
2075
2104
```
2076
2105
2077
-
#### ⚠️ New indexes in MongoDB
2078
-
2079
-
If you maintain indexes manually (i.e. [Auto-index creation](#enabling-auto-index-creation) is off) you must create the following indexes **before or right after** the upgrade:
2080
-
2081
-
> ⚠ **Note!** In case if you create indexes **before** the upgrade, please, create `codefresh.feature-store-versioned` collection manually in advance.
> Please, follow [Maintaining MongoDB indexes](#maintaining-mongodb-indexes) guide to meet index requirements **BEFORE** the upgrade process.
2111
+
2088
2112
### [What's new in 2.8.x](https://codefresh.io/docs/docs/whats-new/on-prem-release-notes/#on-premises-version-28)
2089
2113
2090
2114
### ⚠️ ⚠️ ⚠️ Breaking changes. Read before upgrading!
@@ -2123,13 +2147,6 @@ mongodb:
2123
2147
enabled: false
2124
2148
```
2125
2149
2126
-
#### ⚠️ New indexes in MongoDB
2127
-
2128
-
If you maintain indexes manually (i.e. [Auto-index creation](#enabling-auto-index-creation) is off) you must create the following indexes **before** the upgrade:
0 commit comments