Skip to content

Commit 6753290

Browse files
Added docs for configuration for standalone and replicated cluster (#28)
Signed-off-by: iamabhishek-dubey <abhishekbhardwaj510@gmail.com>
1 parent c4024d7 commit 6753290

File tree

6 files changed

+210
-6
lines changed

6 files changed

+210
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Configuration"
3+
linkTitle: "Configuration"
4+
weight: 3
5+
description: >
6+
Configuration Options for Helm Chart and CRD parameters
7+
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: "MongoDB Replicated Cluster"
3+
weight: 3
4+
linkTitle: "MongoDB Replicated Cluster"
5+
description: >
6+
MongoDB replicated cluster configuration for CRD and helm chart
7+
---
8+
9+
MongoDB cluster configuration is easily customizable using `helm` as well `kubectl`. Since all the configurations are in the form YAML file, it can be easily changed and customized.
10+
11+
The `values.yaml` file for MongoDB cluster setup can be found [here](https://github.com/OT-CONTAINER-KIT/helm-charts/tree/main/charts/mongodb-cluster). But if the setup is not done using `Helm`, in that case Kubernetes manifests needs to be customized.
12+
13+
## Parameters for Helm Chart
14+
15+
| **Name** | **Value** | **Description** |
16+
|-------------------------------------------|:------------------------:|---------------------------------------------------|
17+
| `clusterSize` | 3 | Size of the MongoDB cluster |
18+
| `image.name` | quay.io/opstree/mongo | Name of the MongoDB image |
19+
| `image.tag` | v5.0 | Tag for the MongoDB image |
20+
| `image.imagePullPolicy` | IfNotPresent | Image Pull Policy of the MongoDB |
21+
| `resources` | {} | Request and limits for MongoDB statefulset |
22+
| `storage.enabled` | true | Storage is enabled for MongoDB or not |
23+
| `storage.accessModes` | ["ReadWriteOnce"] | AccessMode for storage provider |
24+
| `storage.storageSize` | 1Gi | Size of storage for MongoDB |
25+
| `storage.storageClass` | gp2 | Name of the storageClass to create storage |
26+
| `mongoDBMonitoring.enabled` | true | MongoDB exporter should be deployed or not |
27+
| `mongoDBMonitoring.image.name` | bitnami/mongodb-exporter | Name of the MongoDB exporter image |
28+
| `mongoDBMonitoring.image.tag` | 0.11.2-debian-10-r382 | Tag of the MongoDB exporter image |
29+
| `mongoDBMonitoring.image.imagePullPolicy` | IfNotPresent | Image Pull Policy of the MongoDB exporter image |
30+
| `serviceMonitor.enabled` | false | Servicemonitor to monitor MongoDB with Prometheus |
31+
| `serviceMonitor.interval` | 30s | Interval at which metrics should be scraped. |
32+
| `serviceMonitor.scrapeTimeout` | 10s | Timeout after which the scrape is ended |
33+
| `serviceMonitor.namespace` | monitoring | Namespace in which Prometheus operator is running |
34+
35+
## Parameters for CRD Object Definition
36+
37+
These are the parameters that are currently supported by the MongoDB operator for the cluster MongoDB database setup:-
38+
39+
- clusterSize
40+
- kubernetesConfig
41+
- storage
42+
- mongoDBSecurity
43+
- mongoDBMonitoring
44+
45+
### clusterSize
46+
47+
`clusterSize` is the size of MongoDB replicated cluster. We have to provide the number of node count that we want to make part of MongoDB cluster. For example:- 1 primary and 2 secondary is 3 as pod count.
48+
49+
```yaml
50+
clusterSize: 3
51+
```
52+
53+
### kubernetesConfig
54+
55+
`kubernetesConfig` is the general configuration paramater for MongoDB CRD in which we are defining the Kubernetes related configuration details like- image, tag, imagePullPolicy, and resources.
56+
57+
```yaml
58+
kubernetesConfig:
59+
image: quay.io/opstree/mongo:v5.0
60+
imagePullPolicy: IfNotPresent
61+
resources:
62+
requests:
63+
cpu: 1
64+
memory: 8Gi
65+
limits:
66+
cpu: 1
67+
memory: 8Gi
68+
```
69+
70+
### storage
71+
72+
`storage` is the storage specific configuration for MongoDB CRD. With this parameter we can make enable persistence inside the MongoDB statefulset. In this parameter, we will provide inputs like- accessModes, size of the storage, and storageClass.
73+
74+
```yaml
75+
storage:
76+
accessModes: ["ReadWriteOnce"]
77+
storageSize: 1Gi
78+
storageClass: csi-cephfs-sc
79+
```
80+
81+
### mongoDBSecurity
82+
83+
`mongoDBSecurity` is the security specification for MongoDB CRD. If we want to enable our MongoDB database authenticated, in that case, we can enable this configuration. To enable the authentication we need to provide paramaters like- admin username, secret reference in Kubernetes.
84+
85+
```yaml
86+
mongoDBSecurity:
87+
mongoDBAdminUser: admin
88+
secretRef:
89+
name: mongodb-secret
90+
key: password
91+
```
92+
93+
### mongoDBMonitoring
94+
95+
`mongoDBMonitoring` is the monitoring feature for MongoDB CRD. By using this parameter we can enable the MongoDB monitoring using **[MongoDB Exporter](https://github.com/percona/mongodb_exporter)**. In this parameter, we need to provide image, imagePullPolicy and resources for mongodb exporter.
96+
97+
```yaml
98+
mongoDBMonitoring:
99+
enableExporter: true
100+
image: bitnami/mongodb-exporter:0.11.2-debian-10-r382
101+
imagePullPolicy: IfNotPresent
102+
resources: {}
103+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: "MongoDB Standalone"
3+
weight: 2
4+
linkTitle: "MongoDB Standalone"
5+
description: >
6+
MongoDB standalone configuration for CRD and helm chart
7+
---
8+
9+
MongoDB standalone configuration is easily customizable using `helm` as well `kubectl`. Since all the configurations are in the form YAML file, it can be easily changed and customized.
10+
11+
The `values.yaml` file for MongoDB standalone setup can be found [here](https://github.com/OT-CONTAINER-KIT/helm-charts/tree/main/charts/mongodb). But if the setup is not done using `Helm`, in that case Kubernetes manifests needs to be customized.
12+
13+
## Parameters for Helm Chart
14+
15+
| **Name** | **Value** | **Description** |
16+
|---------------------------------------------|:------------------------:|----------------------------------------------------|
17+
| `image.name` | quay.io/opstree/mongo | Name of the MongoDB image |
18+
| `image.tag` | v5.0 | Tag for the MongoDB image |
19+
| `image.imagePullPolicy` | IfNotPresent | Image Pull Policy of the MongoDB |
20+
| `resources` | {} | Request and limits for MongoDB statefulset |
21+
| `storage.enabled` | true | Storage is enabled for MongoDB or not |
22+
| `storage.accessModes` | ["ReadWriteOnce"] | AccessMode for storage provider |
23+
| `storage.storageSize` | 1Gi | Size of storage for MongoDB |
24+
| `storage.storageClass` | gp2 | Name of the storageClass to create storage |
25+
| `mongoDBMonitoring.enabled` | true | MongoDB exporter should be deployed or not |
26+
| `mongoDBMonitoring.image.name` | bitnami/mongodb-exporter | Name of the MongoDB exporter image |
27+
| `mongoDBMonitoring.image.tag` | 0.11.2-debian-10-r382 | Tag of the MongoDB exporter image |
28+
| `mongoDBMonitoring.image.imagePullPolicy` | IfNotPresent | Image Pull Policy of the MongoDB exporter image |
29+
| `serviceMonitor.enabled` | false | Servicemonitor to monitor MongoDB with Prometheus |
30+
| `serviceMonitor.interval` | 30s | Interval at which metrics should be scraped. |
31+
| `serviceMonitor.scrapeTimeout` | 10s | Timeout after which the scrape is ended |
32+
| `serviceMonitor.namespace` | monitoring | Namespace in which Prometheus operator is running |
33+
34+
35+
## Parameters for CRD Object Definition
36+
37+
These are the parameters that are currently supported by the MongoDB operator for the standalone MongoDB database setup:-
38+
39+
- kubernetesConfig
40+
- storage
41+
- mongoDBSecurity
42+
- mongoDBMonitoring
43+
44+
### kubernetesConfig
45+
46+
`kubernetesConfig` is the general configuration paramater for MongoDB CRD in which we are defining the Kubernetes related configuration details like- image, tag, imagePullPolicy, and resources.
47+
48+
```yaml
49+
kubernetesConfig:
50+
image: quay.io/opstree/mongo:v5.0
51+
imagePullPolicy: IfNotPresent
52+
resources:
53+
requests:
54+
cpu: 1
55+
memory: 8Gi
56+
limits:
57+
cpu: 1
58+
memory: 8Gi
59+
```
60+
61+
### storage
62+
63+
`storage` is the storage specific configuration for MongoDB CRD. With this parameter we can make enable persistence inside the MongoDB statefulset. In this parameter, we will provide inputs like- accessModes, size of the storage, and storageClass.
64+
65+
```yaml
66+
storage:
67+
accessModes: ["ReadWriteOnce"]
68+
storageSize: 1Gi
69+
storageClass: csi-cephfs-sc
70+
```
71+
72+
### mongoDBSecurity
73+
74+
`mongoDBSecurity` is the security specification for MongoDB CRD. If we want to enable our MongoDB database authenticated, in that case, we can enable this configuration. To enable the authentication we need to provide paramaters like- admin username, secret reference in Kubernetes.
75+
76+
```yaml
77+
mongoDBSecurity:
78+
mongoDBAdminUser: admin
79+
secretRef:
80+
name: mongodb-secret
81+
key: password
82+
```
83+
84+
### mongoDBMonitoring
85+
86+
`mongoDBMonitoring` is the monitoring feature for MongoDB CRD. By using this parameter we can enable the MongoDB monitoring using **[MongoDB Exporter](https://github.com/percona/mongodb_exporter)**. In this parameter, we need to provide image, imagePullPolicy and resources for mongodb exporter.
87+
88+
```yaml
89+
mongoDBMonitoring:
90+
enableExporter: true
91+
image: bitnami/mongodb-exporter:0.11.2-debian-10-r382
92+
imagePullPolicy: IfNotPresent
93+
resources: {}
94+
```

docs/content/en/docs/Getting Started/installation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Setup of MongoDB operator can be easily done by using simple [helm](https://helm
1919

2020
{{< alert title="Note" >}}The recommded of way of installation is helm.{{< /alert >}}
2121

22-
## Helm Installation
22+
## Operator Setup by Helm
2323

2424
The setup can be done by using helm. The mongodb-operator can easily get installed using helm commands.
2525

@@ -70,7 +70,7 @@ NAME READY STATUS RESTARTS AGE
7070
mongodb-operator-fc88b45b5-8rmtj 1/1 Running 0 21d
7171
```
7272

73-
## Kubectl Installation
73+
## Operator Setup by Kubectl
7474

7575
In any case using helm chart is not a possiblity, the MongoDB operator can be installed by `kubectl` commands as well.
7676

docs/content/en/docs/Overview/mongodb-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ A document can contain a number of fields (value), regarding the details of the
2525
## MongoDB Database
2626

2727
<div align="center">
28-
<img src="https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/docs-update/static/mongo-db.drawio.png">
28+
<img src="https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/main/static/mongo-db.drawio.png">
2929
</div>

docs/content/en/docs/Overview/mongodb-setup.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ MongoDB is a NoSQL document database system that scales well horizontally and im
1515

1616
Just like any database mongodb also supports the standalone setup in which a single standalone instance is created and we setup MongoDB software on top of it. For small data chunks and development environment this setup can be ideal but in production grade environment this setup is not recommended because of the scalability and failover issues.
1717

18-
![](https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/docs-update/static/mongodb-standalone.png)
18+
![](https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/main/static/mongodb-standalone.png)
1919

2020
## Replicated Setup
2121

2222
A replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments.
2323
These Mongod processes usually run on different nodes(machines) which together form a Replica set cluster.
2424

25-
![](https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/docs-update/static/mongodb-replicated.png)
25+
![](https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/main/static/mongodb-replicated.png)
2626

2727
## Sharded Setup
2828

@@ -32,4 +32,4 @@ Sharding is a method for distributing data across multiple machines. MongoDB use
3232
- Mongos: The mongos acts as a query router, providing an interface between client applications and the sharded cluster.
3333
- Config Servers: Config servers store metadata and configuration settings for the cluster. They are also deployed as a replica set.
3434

35-
![](https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/docs-update/static/mongodb-sharded.png)
35+
![](https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/main/static/mongodb-sharded.png)

0 commit comments

Comments
 (0)