|
6 | 6 |
|
7 | 7 | ### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey. |
8 | 8 | <br> |
| 9 | +This module is for deploying a highly available MongoDB cluster on Kubernetes using Helm charts. This module provides flexible configuration options to customize the MongoDB deployment such as setting the volume size, architecture, replica count, and more. It also includes options to enable MongoDB backups and restores, and to deploy MongoDB exporters for getting metrics in Grafana. Additionally, this module provides options to create a new namespace, and to configure recovery windows for AWS Secrets Manager. With this module, users can easily deploy a highly available MongoDB cluster on Kubernetes with the flexibility to customize their configurations according to their needs. |
| 10 | + |
| 11 | +## Supported Versions: |
| 12 | + |
| 13 | +| MongoDB Helm Chart Version | K8s supported version | |
| 14 | +| :-----: | :--- | |
| 15 | +| **13.1.5** | **1.23,1.24,1.25** | |
| 16 | + |
9 | 17 |
|
10 | 18 | ## Usage Example |
11 | 19 |
|
12 | 20 | ```hcl |
13 | 21 | module "mongodb" { |
14 | | - source = "../../" |
| 22 | + source = "https://github.com/sq-ia/terraform-kubernetes-mongodb.git" |
15 | 23 | cluster_name = "dev-skaf" |
16 | 24 | mongodb_config = { |
17 | 25 | name = "skaf" |
18 | | - values_yaml = file("./helm/values.yaml") |
| 26 | + values_yaml = "" |
19 | 27 | environment = "prod" |
20 | 28 | volume_size = "10Gi" |
21 | 29 | architecture = "replicaset" |
22 | 30 | replica_count = 2 |
23 | 31 | storage_class_name = "gp2" |
24 | 32 | } |
| 33 | + mongodb_backup_enabled = true |
25 | 34 | mongodb_backup_config = { |
26 | | - s3_bucket_uri = "s3://bucket-name" |
27 | | - s3_bucket_region = "us-east-2" |
28 | | - cron_for_full_backup = "*/2 * * * *" |
| 35 | + s3_bucket_uri = "" |
| 36 | + s3_bucket_region = "" |
| 37 | + cron_for_full_backup = "* * * * *" |
| 38 | + } |
| 39 | +
|
| 40 | + mongodb_restore_enabled = true |
| 41 | + mongodb_restore_config = { |
| 42 | + s3_bucket_uri = "" |
| 43 | + s3_bucket_region = "" |
| 44 | + full_restore_enable = true |
| 45 | + file_name_full = "" |
| 46 | + incremental_restore_enable = false |
| 47 | + file_name_incremental = "" |
29 | 48 | } |
30 | | - mongodb_backup_enabled = true |
31 | 49 | mongodb_exporter_enabled = true |
32 | 50 | } |
33 | 51 |
|
@@ -87,19 +105,19 @@ No modules. |
87 | 105 |
|
88 | 106 | | Name | Description | Type | Default | Required | |
89 | 107 | |------|-------------|------|---------|:--------:| |
90 | | -| <a name="input_app_version"></a> [app\_version](#input\_app\_version) | Enter app version of application | `string` | `"5.0.8-debian-10-r9"` | no | |
91 | | -| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | Enter chart version of application | `string` | `"13.1.5"` | no | |
92 | | -| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the EKS cluster | `string` | `""` | no | |
93 | | -| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Set it to true to create given namespace | `string` | `true` | no | |
94 | | -| <a name="input_mongodb_backup_config"></a> [mongodb\_backup\_config](#input\_mongodb\_backup\_config) | Mongodb Backup configurations | `any` | <pre>{<br> "cron_for_full_backup": "*/5 * * * *",<br> "s3_bucket_region": "us-east-2",<br> "s3_bucket_uri": ""<br>}</pre> | no | |
95 | | -| <a name="input_mongodb_backup_enabled"></a> [mongodb\_backup\_enabled](#input\_mongodb\_backup\_enabled) | Set true to enable mongodb backups | `bool` | `false` | no | |
96 | | -| <a name="input_mongodb_config"></a> [mongodb\_config](#input\_mongodb\_config) | Mongodb configurations | `any` | <pre>{<br> "architecture": "",<br> "environment": "",<br> "name": "",<br> "replica_count": 2,<br> "storage_class_name": "",<br> "values_yaml": "",<br> "volume_size": ""<br>}</pre> | no | |
97 | | -| <a name="input_mongodb_exporter_config"></a> [mongodb\_exporter\_config](#input\_mongodb\_exporter\_config) | Mongodb exporter configuration | `any` | <pre>{<br> "version": "2.9.0"<br>}</pre> | no | |
98 | | -| <a name="input_mongodb_exporter_enabled"></a> [mongodb\_exporter\_enabled](#input\_mongodb\_exporter\_enabled) | Set true to deploy mongodb exporters to get metrics in grafana | `bool` | `false` | no | |
99 | | -| <a name="input_mongodb_restore_config"></a> [mongodb\_restore\_config](#input\_mongodb\_restore\_config) | Mongodb restore configurations | `any` | <pre>{<br> "file_name_full": "",<br> "file_name_incremental": "",<br> "full_restore_enable": false,<br> "incremental_restore_enable": false,<br> "s3_bucket_region": "us-east-2",<br> "s3_bucket_uri": "s3://mymongo/mongodumpfull_20230424_112501.gz"<br>}</pre> | no | |
100 | | -| <a name="input_mongodb_restore_enabled"></a> [mongodb\_restore\_enabled](#input\_mongodb\_restore\_enabled) | Set true to enable mongodb restore | `bool` | `false` | no | |
101 | | -| <a name="input_namespace"></a> [namespace](#input\_namespace) | Enter namespace name | `string` | `"mongodb"` | no | |
102 | | -| <a name="input_recovery_window_aws_secret"></a> [recovery\_window\_aws\_secret](#input\_recovery\_window\_aws\_secret) | Number of days that AWS Secrets Manager waits before it can delete the secret. This value can be 0 to force deletion without recovery or range from 7 to 30 days. | `number` | `0` | no | |
| 108 | +| <a name="input_app_version"></a> [app\_version](#input\_app\_version) | Version of the Mongodb application that will be deployed. | `string` | `"5.0.8-debian-10-r9"` | no | |
| 109 | +| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | Version of the Mongodb chart that will be used to deploy Mongodb application. | `string` | `"13.1.5"` | no | |
| 110 | +| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Specifies the name of the EKS cluster to deploy the Mongodb application on. | `string` | `""` | no | |
| 111 | +| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Specify whether or not to create the namespace if it does not already exist. Set it to true to create the namespace. | `string` | `true` | no | |
| 112 | +| <a name="input_mongodb_backup_config"></a> [mongodb\_backup\_config](#input\_mongodb\_backup\_config) | Configuration options for Mongodb database backups. It includes properties such as the S3 bucket URI, the S3 bucket region, and the cron expression for full backups. | `any` | <pre>{<br> "cron_for_full_backup": "*/5 * * * *",<br> "s3_bucket_region": "us-east-2",<br> "s3_bucket_uri": ""<br>}</pre> | no | |
| 113 | +| <a name="input_mongodb_backup_enabled"></a> [mongodb\_backup\_enabled](#input\_mongodb\_backup\_enabled) | Specifies whether to enable backups for Mongodb database. | `bool` | `false` | no | |
| 114 | +| <a name="input_mongodb_config"></a> [mongodb\_config](#input\_mongodb\_config) | Specify the configuration settings for Mongodb, including the name, environment, storage options, replication settings, and custom YAML values. | `any` | <pre>{<br> "architecture": "",<br> "environment": "",<br> "name": "",<br> "replica_count": 2,<br> "storage_class_name": "",<br> "values_yaml": "",<br> "volume_size": ""<br>}</pre> | no | |
| 115 | +| <a name="input_mongodb_exporter_config"></a> [mongodb\_exporter\_config](#input\_mongodb\_exporter\_config) | Specify whether or not to deploy Mongodb exporter to collect Mongodb metrics for monitoring in Grafana. | `any` | <pre>{<br> "version": "2.9.0"<br>}</pre> | no | |
| 116 | +| <a name="input_mongodb_exporter_enabled"></a> [mongodb\_exporter\_enabled](#input\_mongodb\_exporter\_enabled) | Specify whether or not to deploy Mongodb exporter to collect Mongodb metrics for monitoring in Grafana. | `bool` | `false` | no | |
| 117 | +| <a name="input_mongodb_restore_config"></a> [mongodb\_restore\_config](#input\_mongodb\_restore\_config) | Configuration options for restoring dump to the Mongodb database. | `any` | <pre>{<br> "file_name_full": "",<br> "file_name_incremental": "",<br> "full_restore_enable": false,<br> "incremental_restore_enable": false,<br> "s3_bucket_region": "us-east-2",<br> "s3_bucket_uri": "s3://mymongo/mongodumpfull_20230424_112501.gz"<br>}</pre> | no | |
| 118 | +| <a name="input_mongodb_restore_enabled"></a> [mongodb\_restore\_enabled](#input\_mongodb\_restore\_enabled) | Specifies whether to enable restoring dump to the Mongodb database. | `bool` | `false` | no | |
| 119 | +| <a name="input_namespace"></a> [namespace](#input\_namespace) | Name of the Kubernetes namespace where the Mongodb deployment will be deployed. | `string` | `"mongodb"` | no | |
| 120 | +| <a name="input_recovery_window_aws_secret"></a> [recovery\_window\_aws\_secret](#input\_recovery\_window\_aws\_secret) | Number of days that AWS Secrets Manager will wait before deleting a secret. This value can be set to 0 to force immediate deletion, or to a value between 7 and 30 days to allow for recovery. | `number` | `0` | no | |
103 | 121 |
|
104 | 122 | ## Outputs |
105 | 123 |
|
|
0 commit comments