From be7784893538ff0544ea671b8dfa59ce2604bb79 Mon Sep 17 00:00:00 2001 From: RohitSquareops Date: Mon, 8 May 2023 17:00:52 +0530 Subject: [PATCH 1/5] Updated variables, output description and README --- README.md | 35 +++++++++++++++++++---------------- examples/complete/README.md | 8 ++++---- examples/complete/main.tf | 9 +++++++-- examples/complete/output.tf | 6 +++--- examples/complete/provider.tf | 4 +++- helm/values/values.yaml | 4 ++-- output.tf | 6 +++--- variables.tf | 14 +++++++------- 8 files changed, 48 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 4ef398f..3d379e5 100644 --- a/README.md +++ b/README.md @@ -6,23 +6,26 @@ ### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
+The 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. + +The 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. ## 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 +76,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 } From d64ee38405eec094ae99c884b2ed839ed228ba05 Mon Sep 17 00:00:00 2001 From: RohitSquareops Date: Mon, 8 May 2023 17:04:22 +0530 Subject: [PATCH 2/5] Updated Redis description in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d379e5..4955901 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ ### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
-The 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. - -The 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. +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. ## Usage Example From 989c0f4417d89b00f542e6432e08d6ff53576e4b Mon Sep 17 00:00:00 2001 From: Rohit Singh <107384244+RohitSquareops@users.noreply.github.com> Date: Mon, 8 May 2023 17:07:22 +0530 Subject: [PATCH 3/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4955901..31086c9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## redis +## Redis ![squareops_avatar] @@ -7,7 +7,7 @@ ### [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. ## Usage Example From 03bdcdde456cf4ccebeaedd75ca8685ac7180251 Mon Sep 17 00:00:00 2001 From: RohitSquareops Date: Wed, 10 May 2023 10:46:54 +0530 Subject: [PATCH 4/5] Updated module with supported version --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 31086c9..37abd9b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ This module allows users to customize the deployment by providing various input

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 Table: + +| Redis Helm Chart Version | K8s supported version | +| :-----: | :--- | +| **16.13.2** | 1.23,1.24,1.25 | + ## Usage Example ```hcl From 6e291eff6ce9e0961ceb949ab3ecdaabc48d5e4f Mon Sep 17 00:00:00 2001 From: RohitSquareops Date: Wed, 10 May 2023 10:48:00 +0530 Subject: [PATCH 5/5] updated module --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37abd9b..6fab7d6 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ This module allows users to customize the deployment by providing various input

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 Table: +## Supported Versions : | Redis Helm Chart Version | K8s supported version | | :-----: | :--- | -| **16.13.2** | 1.23,1.24,1.25 | +| **16.13.2** | **1.23,1.24,1.25** | ## Usage Example