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:
@@ -797,64 +806,6 @@ cfapi-test-reporting:
797
806
enabled: true
798
807
```
799
808
800
-
⚠️ ⚠️ ⚠️
801
-
### Indexes in MongoDB
802
-
⚠️ ⚠️ ⚠️
803
-
804
-
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.
805
-
806
-
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.
807
-
808
-
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.
809
-
810
-
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.
811
-
The indexes are stored in JSON files with keys and options specified.
812
-
813
-
The directory structure is:
814
-
815
-
```console
816
-
codefresh-onprem-helm
817
-
├── indexes
818
-
│ ├── <DB_NAME> # MongoDB database name
819
-
│ │ ├── <COLLECTION_NAME>.json # MongoDB indexes for the specified collection
820
-
```
821
-
822
-
#### Enabling auto-index creation
823
-
824
-
For first-time installations, you **must** enable auto-index creation by setting the following values:
825
-
826
-
```yaml
827
-
global:
828
-
env:
829
-
MONGOOSE_AUTO_INDEX: "true"
830
-
MONGO_AUTOMATIC_INDEX_CREATION: "true"
831
-
```
832
-
833
-
You **should** disable it for the next upgrades by setting these variables to `false`:
834
-
835
-
```yaml
836
-
global:
837
-
env:
838
-
MONGOOSE_AUTO_INDEX: "false"
839
-
MONGO_AUTOMATIC_INDEX_CREATION: "false"
840
-
```
841
-
842
-
#### Creating Indexes manually
843
-
844
-
> **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.
845
-
846
-
Depending on your MongoDB service (e.g., Atlas, self-hosted), you can create indexes using the MongoDB shell or the Atlas UI.
847
-
848
-
Ref:
849
-
- [Create an Index in Atlas DB](https://www.mongodb.com/docs/atlas/atlas-ui/indexes/#create-an-index)
850
-
- [Create an Index with mongosh](https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/)
851
-
852
-
##### ⚠️ Upgrading when the indexes are maintained manually
853
-
854
-
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.
855
-
856
-
You can follow [Upgrading section](#upgrading) to see what changes were made for indexes in every specific release.
857
-
858
809
### High Availability
859
810
860
811
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.
@@ -1504,6 +1455,87 @@ To see all the claims supported by Codefresh OIDC provider, see `claims_supporte
1504
1455
1505
1456
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.
1506
1457
1458
+
## Maintaining MongoDB Indexes
1459
+
1460
+
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.
1461
+
1462
+
> ℹ️ 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.
1463
+
1464
+
### Index alignment
1465
+
1466
+
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.
1473
+
1474
+
The directory structure is:
1475
+
1476
+
```console
1477
+
indexes
1478
+
├── <DB_NAME> # MongoDB database name
1479
+
│ ├── <COLLECTION_NAME>.json # MongoDB indexes for the specified collection
1480
+
```
1481
+
1482
+
**Overview of the index alignment process:**
1483
+
1484
+
1. Identify the differences between the indexes in your MongoDB instance and the required index definitions.
1485
+
2. Create any missing indexes one by one. (It's important not to create them in bulk.)
1486
+
3. Perform the upgrade of Codefresh On-Prem installation.
1487
+
4. Then remove any unnecessary indexes.
1488
+
1489
+
> ⚠️ **Note! Any changes to indexes should be performed during a defined maintenance window or during periods of lowest traffic to MongoDB.**
1490
+
>
1491
+
> 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/manual/core/index-creation/#index-build-impact-on-database-performance))
1492
+
>
1493
+
> 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/manual/core/query-plans/#plan-cache-flushes))
1494
+
1495
+
#### Self-hosted MongoDB
1496
+
1497
+
For self-hosted MongoDB, follow the instructions below:
1498
+
1499
+
- 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:
1500
+
1501
+
```shell
1502
+
mongosh "<connection_string>"
1503
+
```
1504
+
1505
+
- 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
1512
+
1513
+
**Index creation**
1514
+
1515
+
> ⚠ **Note! Always create indexes sequentially, one by one. Don't create them in bulk.**
1516
+
1517
+
- 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.
1536
+
1537
+
> ⚠️ **Important!** In Atlas, for production environments, it is recommended to use rolling index builds by enabling the "Build index via rolling process" checkbox. ([*MongoDB official documentation*](https://www.mongodb.com/docs/v6.0/tutorial/build-indexes-on-replica-sets/))
1538
+
1507
1539
## Upgrading
1508
1540
1509
1541
### To 2-0-0
@@ -2039,24 +2071,22 @@ cfapi:
2039
2071
2040
2072
### To 2-6-0
2041
2073
2074
+
> ⚠️ **WARNING! MongoDB indexes changed!**
2075
+
>
2076
+
> Please, follow [Maintaining MongoDB indexes](#maintaining-mongodb-indexes) guide to meet index requirements **BEFORE** the upgrade process.
2077
+
2042
2078
### [What's new in 2.6.x](https://codefresh.io/docs/docs/whats-new/on-prem-release-notes/#on-premises-version-26)
2043
2079
2044
2080
#### Affected values
2045
2081
2046
2082
[Image digests in containers](#image-digests-in-containers)
2047
2083
2048
-
#### Auto-index creation in MongoDB
2049
-
2050
-
[Auto-index creation in MongoDB](#auto-index-creation-in-mongodb)
2051
-
2052
-
#### ⚠️ New indexes in MongoDB
2053
-
2054
-
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.
2089
+
2060
2090
### [What's new in 2.7.x](https://codefresh.io/docs/docs/whats-new/on-prem-release-notes/#on-premises-version-27)
2061
2091
2062
2092
#### Affected values
@@ -2086,17 +2116,12 @@ global:
2086
2116
- "value"
2087
2117
```
2088
2118
2089
-
#### ⚠️ New indexes in MongoDB
2090
-
2091
-
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:
2092
-
2093
-
> ⚠ **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.
2124
+
2100
2125
### [What's new in 2.8.x](https://codefresh.io/docs/docs/whats-new/on-prem-release-notes/#on-premises-version-28)
2101
2126
2102
2127
### ⚠️ ⚠️ ⚠️ Breaking changes. Read before upgrading!
@@ -2135,13 +2160,6 @@ mongodb:
2135
2160
enabled: false
2136
2161
```
2137
2162
2138
-
#### ⚠️ New indexes in MongoDB
2139
-
2140
-
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