diff --git a/README.md b/README.md
index 4ef398f..6fab7d6 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## redis
+## Redis
![squareops_avatar]
@@ -6,23 +6,32 @@
### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
+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.
+
+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.
+
+## Supported Versions :
+
+| Redis Helm Chart Version | K8s supported version |
+| :-----: | :--- |
+| **16.13.2** | **1.23,1.24,1.25** |
## Usage Example
```hcl
module "redis" {
- source = "../../"
+ source = "https://github.com/sq-ia/terraform-kubernetes-redis.git"
redis_config = {
- name = "skaf"
+ name = "redis"
values_yaml = ""
environment = "prod"
architecture = "replication"
- storage_class_name = "gp2"
slave_volume_size = "10Gi"
- slave_replica_count = 3
- master_volume_size = "10Gi"
+ master_volume_size = "10Gi"
+ storage_class_name = "gp2"
+ slave_replica_count = 2
}
- grafana_monitoring_enabled = true
+ grafana_monitoring_enabled = true
recovery_window_aws_secret = 0
}
@@ -73,21 +82,21 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
-| [app\_version](#input\_app\_version) | Enter app version of application | `string` | `"6.2.7-debian-11-r11"` | no |
-| [chart\_version](#input\_chart\_version) | Enter chart version of application | `string` | `"16.13.2"` | no |
-| [create\_namespace](#input\_create\_namespace) | Set it to true to create given namespace | `string` | `true` | no |
-| [grafana\_monitoring\_enabled](#input\_grafana\_monitoring\_enabled) | Set true to deploy redis exporter to get metrics in grafana | `bool` | `false` | no |
-| [namespace](#input\_namespace) | Enter namespace name | `string` | `"redis"` | no |
-| [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 |
-| [redis\_config](#input\_redis\_config) | Redis configurations | `any` |
{
"architecture": "replication",
"environment": "",
"master_volume_size": "",
"name": "",
"slave_replica_count": 1,
"slave_volume_size": "",
"storage_class_name": "",
"values_yaml": ""
} | no |
+| [app\_version](#input\_app\_version) | Version of the Redis application that will be deployed. | `string` | `"6.2.7-debian-11-r11"` | no |
+| [chart\_version](#input\_chart\_version) | Version of the chart for the Redis application that will be deployed. | `string` | `"16.13.2"` | no |
+| [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 |
+| [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 |
+| [namespace](#input\_namespace) | Namespace where the Redis resources will be deployed. | `string` | `"redis"` | no |
+| [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 |
+| [redis\_config](#input\_redis\_config) | Specify the configuration settings for Redis, including the name, environment, storage options, replication settings, and custom YAML values. | `any` | {
"architecture": "replication",
"environment": "",
"master_volume_size": "",
"name": "",
"slave_replica_count": 1,
"slave_volume_size": "",
"storage_class_name": "",
"values_yaml": ""
} | no |
## Outputs
| Name | Description |
|------|-------------|
-| [redis\_master\_endpoint](#output\_redis\_master\_endpoint) | Redis master pod connection endpoint |
-| [redis\_port](#output\_redis\_port) | Redis port |
-| [redis\_slave\_endpoint](#output\_redis\_slave\_endpoint) | Redis slave pod connection endpoint |
+| [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. |
+| [redis\_port](#output\_redis\_port) | The port number on which Redis is running. |
+| [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. |
## Contribution & Issue Reporting
diff --git a/examples/complete/README.md b/examples/complete/README.md
index c92eaba..b52e1db 100644
--- a/examples/complete/README.md
+++ b/examples/complete/README.md
@@ -21,7 +21,7 @@ No requirements.
| Name | Source | Version |
|------|--------|---------|
-| [redis](#module\_redis) | ../../ | n/a |
+| [redis](#module\_redis) | https://github.com/sq-ia/terraform-kubernetes-redis.git | n/a |
## Resources
@@ -38,7 +38,7 @@ No inputs.
| Name | Description |
|------|-------------|
-| [redis\_master\_endpoint](#output\_redis\_master\_endpoint) | Redis master pod connection endpoint |
-| [redis\_port](#output\_redis\_port) | Redis port |
-| [redis\_slave\_endpoint](#output\_redis\_slave\_endpoint) | Redis slave pod connection endpoint |
+| [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. |
+| [redis\_port](#output\_redis\_port) | The port number on which Redis is running. |
+| [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. |
diff --git a/examples/complete/main.tf b/examples/complete/main.tf
index 7526040..bb0d15c 100644
--- a/examples/complete/main.tf
+++ b/examples/complete/main.tf
@@ -1,11 +1,16 @@
locals {
+ name = "redis"
region = "us-east-2"
- name = "skaf"
environment = "prod"
+ additional_tags = {
+ Owner = "organization_name"
+ Expires = "Never"
+ Department = "Engineering"
+ }
}
module "redis" {
- source = "../../"
+ source = "https://github.com/sq-ia/terraform-kubernetes-redis.git"
redis_config = {
name = local.name
values_yaml = file("./helm/values.yaml")
diff --git a/examples/complete/output.tf b/examples/complete/output.tf
index 21b86b8..38add55 100644
--- a/examples/complete/output.tf
+++ b/examples/complete/output.tf
@@ -1,14 +1,14 @@
output "redis_port" {
value = "6379"
- description = "Redis port"
+ description = "The port number on which Redis is running."
}
output "redis_master_endpoint" {
value = module.redis.redis_master_endpoint
- description = "Redis master pod connection endpoint"
+ description = "The endpoint for the Redis Master Service, which is the primary node in the Redis cluster responsible for handling read-write operations."
}
output "redis_slave_endpoint" {
value = module.redis.redis_slave_endpoint
- description = "Redis slave pod connection endpoint"
+ description = "The endpoint for the Redis Slave Service, which is a secondary node in the Redis cluster responsible for handling read-only operations."
}
diff --git a/examples/complete/provider.tf b/examples/complete/provider.tf
index 7d0a354..82ac4d9 100644
--- a/examples/complete/provider.tf
+++ b/examples/complete/provider.tf
@@ -1,8 +1,10 @@
provider "aws" {
region = local.region
+ default_tags {
+ tags = local.additional_tags
+ }
}
-
data "aws_eks_cluster" "cluster" {
name = ""
}
diff --git a/helm/values/values.yaml b/helm/values/values.yaml
index a0a4bb4..b4d521e 100644
--- a/helm/values/values.yaml
+++ b/helm/values/values.yaml
@@ -174,7 +174,7 @@ master:
## - "--maxmemory-policy volatile-ttl"
## - "--repl-backlog-size 1024mb"
##
- extraFlags:
+ extraFlags:
- "--maxmemory 1024mb"
## @param master.extraEnvVars Array with extra environment variables to add to Redis® master nodes
## e.g:
@@ -547,7 +547,7 @@ replica:
## - "--maxmemory-policy volatile-ttl"
## - "--repl-backlog-size 1024mb"
##
- extraFlags:
+ extraFlags:
- "--maxmemory 1024mb"
## @param replica.extraEnvVars Array with extra environment variables to add to Redis® replicas nodes
## e.g:
diff --git a/output.tf b/output.tf
index db22f67..6541c06 100644
--- a/output.tf
+++ b/output.tf
@@ -1,14 +1,14 @@
output "redis_port" {
value = "6379"
- description = "Redis port"
+ description = "The port number on which Redis is running."
}
output "redis_master_endpoint" {
value = "redis-master.${var.namespace}.svc.cluster.local"
- description = "Redis master pod connection endpoint"
+ description = "The endpoint for the Redis Master Service, which is the primary node in the Redis cluster responsible for handling read-write operations."
}
output "redis_slave_endpoint" {
value = "redis-replicas.${var.namespace}.svc.cluster.local"
- description = "Redis slave pod connection endpoint"
+ description = "The endpoint for the Redis Slave Service, which is a secondary node in the Redis cluster responsible for handling read-only operations."
}
diff --git a/variables.tf b/variables.tf
index 4623c71..0eca562 100644
--- a/variables.tf
+++ b/variables.tf
@@ -10,41 +10,41 @@ variable "redis_config" {
storage_class_name = ""
values_yaml = ""
}
- description = "Redis configurations"
+ description = "Specify the configuration settings for Redis, including the name, environment, storage options, replication settings, and custom YAML values."
}
variable "chart_version" {
type = string
default = "16.13.2"
- description = "Enter chart version of application"
+ description = "Version of the chart for the Redis application that will be deployed."
}
variable "app_version" {
type = string
default = "6.2.7-debian-11-r11"
- description = "Enter app version of application"
+ description = "Version of the Redis application that will be deployed."
}
variable "namespace" {
type = string
default = "redis"
- description = "Enter namespace name"
+ description = "Namespace where the Redis resources will be deployed."
}
variable "grafana_monitoring_enabled" {
type = bool
default = false
- description = "Set true to deploy redis exporter to get metrics in grafana"
+ description = "Specify whether or not to deploy Redis exporter to collect Redis metrics for monitoring in Grafana."
}
variable "recovery_window_aws_secret" {
default = 0
type = number
- 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."
+ 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."
}
variable "create_namespace" {
type = string
- description = "Set it to true to create given namespace"
+ description = "Specify whether or not to create the namespace if it does not already exist. Set it to true to create the namespace."
default = true
}