Skip to content

Commit f94de42

Browse files
Merge pull request #3 from RohitSquareops/main
Updated variable, readme and indentation
2 parents 0c42887 + 6e291ef commit f94de42

File tree

8 files changed

+55
-39
lines changed

8 files changed

+55
-39
lines changed

README.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
1-
## redis
1+
## Redis
22

33
![squareops_avatar]
44

55
[squareops_avatar]: https://squareops.com/wp-content/uploads/2022/12/squareops-logo.png
66

77
### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
88
<br>
9+
This module allows users to customize the deployment by providing various input variables. Users can specify the name and environment of the Redis deployment, the chart and app version, the namespace in which the Redis deployment will be created, and whether to enable Grafana monitoring. The module also allows users to set the recovery window for the AWS Secrets Manager that is used to store the Redis password.
10+
<br><br>
11+
This module creates a Redis master and one or more Redis slaves, depending on the specified architecture. The module creates Kubernetes services for the Redis master and slave deployments, and exposes these services as endpoints that can be used to connect to the Redis database. Users can retrieve these endpoints using the module's outputs.
12+
13+
## Supported Versions :
14+
15+
| Redis Helm Chart Version | K8s supported version |
16+
| :-----: | :--- |
17+
| **16.13.2** | **1.23,1.24,1.25** |
918

1019
## Usage Example
1120

1221
```hcl
1322
module "redis" {
14-
source = "../../"
23+
source = "https://github.com/sq-ia/terraform-kubernetes-redis.git"
1524
redis_config = {
16-
name = "skaf"
25+
name = "redis"
1726
values_yaml = ""
1827
environment = "prod"
1928
architecture = "replication"
20-
storage_class_name = "gp2"
2129
slave_volume_size = "10Gi"
22-
slave_replica_count = 3
23-
master_volume_size = "10Gi"
30+
master_volume_size = "10Gi"
31+
storage_class_name = "gp2"
32+
slave_replica_count = 2
2433
}
25-
grafana_monitoring_enabled = true
34+
grafana_monitoring_enabled = true
2635
recovery_window_aws_secret = 0
2736
}
2837
@@ -73,21 +82,21 @@ No modules.
7382

7483
| Name | Description | Type | Default | Required |
7584
|------|-------------|------|---------|:--------:|
76-
| <a name="input_app_version"></a> [app\_version](#input\_app\_version) | Enter app version of application | `string` | `"6.2.7-debian-11-r11"` | no |
77-
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | Enter chart version of application | `string` | `"16.13.2"` | no |
78-
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Set it to true to create given namespace | `string` | `true` | no |
79-
| <a name="input_grafana_monitoring_enabled"></a> [grafana\_monitoring\_enabled](#input\_grafana\_monitoring\_enabled) | Set true to deploy redis exporter to get metrics in grafana | `bool` | `false` | no |
80-
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Enter namespace name | `string` | `"redis"` | no |
81-
| <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 |
82-
| <a name="input_redis_config"></a> [redis\_config](#input\_redis\_config) | Redis configurations | `any` | <pre>{<br> "architecture": "replication",<br> "environment": "",<br> "master_volume_size": "",<br> "name": "",<br> "slave_replica_count": 1,<br> "slave_volume_size": "",<br> "storage_class_name": "",<br> "values_yaml": ""<br>}</pre> | no |
85+
| <a name="input_app_version"></a> [app\_version](#input\_app\_version) | Version of the Redis application that will be deployed. | `string` | `"6.2.7-debian-11-r11"` | no |
86+
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | Version of the chart for the Redis application that will be deployed. | `string` | `"16.13.2"` | no |
87+
| <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 |
88+
| <a name="input_grafana_monitoring_enabled"></a> [grafana\_monitoring\_enabled](#input\_grafana\_monitoring\_enabled) | Specify whether or not to deploy Redis exporter to collect Redis metrics for monitoring in Grafana. | `bool` | `false` | no |
89+
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace where the Redis resources will be deployed. | `string` | `"redis"` | no |
90+
| <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 it can delete the secret. The value can be 0 to force deletion without recovery, or a range from 7 to 30 days. | `number` | `0` | no |
91+
| <a name="input_redis_config"></a> [redis\_config](#input\_redis\_config) | Specify the configuration settings for Redis, including the name, environment, storage options, replication settings, and custom YAML values. | `any` | <pre>{<br> "architecture": "replication",<br> "environment": "",<br> "master_volume_size": "",<br> "name": "",<br> "slave_replica_count": 1,<br> "slave_volume_size": "",<br> "storage_class_name": "",<br> "values_yaml": ""<br>}</pre> | no |
8392

8493
## Outputs
8594

8695
| Name | Description |
8796
|------|-------------|
88-
| <a name="output_redis_master_endpoint"></a> [redis\_master\_endpoint](#output\_redis\_master\_endpoint) | Redis master pod connection endpoint |
89-
| <a name="output_redis_port"></a> [redis\_port](#output\_redis\_port) | Redis port |
90-
| <a name="output_redis_slave_endpoint"></a> [redis\_slave\_endpoint](#output\_redis\_slave\_endpoint) | Redis slave pod connection endpoint |
97+
| <a name="output_redis_master_endpoint"></a> [redis\_master\_endpoint](#output\_redis\_master\_endpoint) | The endpoint for the Redis Master Service, which is the primary node in the Redis cluster responsible for handling read-write operations. |
98+
| <a name="output_redis_port"></a> [redis\_port](#output\_redis\_port) | The port number on which Redis is running. |
99+
| <a name="output_redis_slave_endpoint"></a> [redis\_slave\_endpoint](#output\_redis\_slave\_endpoint) | The endpoint for the Redis Slave Service, which is a secondary node in the Redis cluster responsible for handling read-only operations. |
91100
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
92101

93102
## Contribution & Issue Reporting

examples/complete/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ No requirements.
2121

2222
| Name | Source | Version |
2323
|------|--------|---------|
24-
| <a name="module_redis"></a> [redis](#module\_redis) | ../../ | n/a |
24+
| <a name="module_redis"></a> [redis](#module\_redis) | https://github.com/sq-ia/terraform-kubernetes-redis.git | n/a |
2525

2626
## Resources
2727

@@ -38,7 +38,7 @@ No inputs.
3838

3939
| Name | Description |
4040
|------|-------------|
41-
| <a name="output_redis_master_endpoint"></a> [redis\_master\_endpoint](#output\_redis\_master\_endpoint) | Redis master pod connection endpoint |
42-
| <a name="output_redis_port"></a> [redis\_port](#output\_redis\_port) | Redis port |
43-
| <a name="output_redis_slave_endpoint"></a> [redis\_slave\_endpoint](#output\_redis\_slave\_endpoint) | Redis slave pod connection endpoint |
41+
| <a name="output_redis_master_endpoint"></a> [redis\_master\_endpoint](#output\_redis\_master\_endpoint) | The endpoint for the Redis Master Service, which is the primary node in the Redis cluster responsible for handling read-write operations. |
42+
| <a name="output_redis_port"></a> [redis\_port](#output\_redis\_port) | The port number on which Redis is running. |
43+
| <a name="output_redis_slave_endpoint"></a> [redis\_slave\_endpoint](#output\_redis\_slave\_endpoint) | The endpoint for the Redis Slave Service, which is a secondary node in the Redis cluster responsible for handling read-only operations. |
4444
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/complete/main.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
locals {
2+
name = "redis"
23
region = "us-east-2"
3-
name = "skaf"
44
environment = "prod"
5+
additional_tags = {
6+
Owner = "organization_name"
7+
Expires = "Never"
8+
Department = "Engineering"
9+
}
510
}
611

712
module "redis" {
8-
source = "../../"
13+
source = "https://github.com/sq-ia/terraform-kubernetes-redis.git"
914
redis_config = {
1015
name = local.name
1116
values_yaml = file("./helm/values.yaml")

examples/complete/output.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
output "redis_port" {
22
value = "6379"
3-
description = "Redis port"
3+
description = "The port number on which Redis is running."
44
}
55

66
output "redis_master_endpoint" {
77
value = module.redis.redis_master_endpoint
8-
description = "Redis master pod connection endpoint"
8+
description = "The endpoint for the Redis Master Service, which is the primary node in the Redis cluster responsible for handling read-write operations."
99
}
1010

1111
output "redis_slave_endpoint" {
1212
value = module.redis.redis_slave_endpoint
13-
description = "Redis slave pod connection endpoint"
13+
description = "The endpoint for the Redis Slave Service, which is a secondary node in the Redis cluster responsible for handling read-only operations."
1414
}

examples/complete/provider.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
provider "aws" {
22
region = local.region
3+
default_tags {
4+
tags = local.additional_tags
5+
}
36
}
47

5-
68
data "aws_eks_cluster" "cluster" {
79
name = ""
810
}

helm/values/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ master:
174174
## - "--maxmemory-policy volatile-ttl"
175175
## - "--repl-backlog-size 1024mb"
176176
##
177-
extraFlags:
177+
extraFlags:
178178
- "--maxmemory 1024mb"
179179
## @param master.extraEnvVars Array with extra environment variables to add to Redis&reg; master nodes
180180
## e.g:
@@ -547,7 +547,7 @@ replica:
547547
## - "--maxmemory-policy volatile-ttl"
548548
## - "--repl-backlog-size 1024mb"
549549
##
550-
extraFlags:
550+
extraFlags:
551551
- "--maxmemory 1024mb"
552552
## @param replica.extraEnvVars Array with extra environment variables to add to Redis&reg; replicas nodes
553553
## e.g:

output.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
output "redis_port" {
22
value = "6379"
3-
description = "Redis port"
3+
description = "The port number on which Redis is running."
44
}
55

66
output "redis_master_endpoint" {
77
value = "redis-master.${var.namespace}.svc.cluster.local"
8-
description = "Redis master pod connection endpoint"
8+
description = "The endpoint for the Redis Master Service, which is the primary node in the Redis cluster responsible for handling read-write operations."
99
}
1010

1111
output "redis_slave_endpoint" {
1212
value = "redis-replicas.${var.namespace}.svc.cluster.local"
13-
description = "Redis slave pod connection endpoint"
13+
description = "The endpoint for the Redis Slave Service, which is a secondary node in the Redis cluster responsible for handling read-only operations."
1414
}

variables.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,41 @@ variable "redis_config" {
1010
storage_class_name = ""
1111
values_yaml = ""
1212
}
13-
description = "Redis configurations"
13+
description = "Specify the configuration settings for Redis, including the name, environment, storage options, replication settings, and custom YAML values."
1414
}
1515

1616
variable "chart_version" {
1717
type = string
1818
default = "16.13.2"
19-
description = "Enter chart version of application"
19+
description = "Version of the chart for the Redis application that will be deployed."
2020
}
2121

2222
variable "app_version" {
2323
type = string
2424
default = "6.2.7-debian-11-r11"
25-
description = "Enter app version of application"
25+
description = "Version of the Redis application that will be deployed."
2626
}
2727

2828
variable "namespace" {
2929
type = string
3030
default = "redis"
31-
description = "Enter namespace name"
31+
description = "Namespace where the Redis resources will be deployed."
3232
}
3333

3434
variable "grafana_monitoring_enabled" {
3535
type = bool
3636
default = false
37-
description = "Set true to deploy redis exporter to get metrics in grafana"
37+
description = "Specify whether or not to deploy Redis exporter to collect Redis metrics for monitoring in Grafana."
3838
}
3939

4040
variable "recovery_window_aws_secret" {
4141
default = 0
4242
type = number
43-
description = "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."
43+
description = "Number of days that AWS Secrets Manager will wait before it can delete the secret. The value can be 0 to force deletion without recovery, or a range from 7 to 30 days."
4444
}
4545

4646
variable "create_namespace" {
4747
type = string
48-
description = "Set it to true to create given namespace"
48+
description = "Specify whether or not to create the namespace if it does not already exist. Set it to true to create the namespace."
4949
default = true
5050
}

0 commit comments

Comments
 (0)