This module allows users to customize the deployment with various input variables. Users can specify the name and environment of the Redis deployment, the chart and app version, the namespace for the Redis deployment, and whether to enable Grafana monitoring. The module offers options to create a new namespace and configure recovery windows for AWS Secrets Manager, Azure Key Vault, and GCP Secrets Manager. Users can deploy a highly available Redis on AWS EKS, Azure AKS, and GCP GKE Kubernetes clusters with flexible configurations.
This module creates a Redis master and one or more Redis slaves, based on the specified architecture. It sets up Kubernetes services for the Redis master and slave deployments and exposes these services as endpoints for connecting to the Redis database. Users can retrieve these endpoints using the module's outputs.
Redis Helm Chart Version | K8s supported version (EKS, AKS & GKE) |
---|---|
16.13.2 | 1.23,1.24,1.25,1.26,1.27 |
locals {
name = "redis"
region = "eastus"
environment = "prod"
additional_tags = {
Owner = "organization_name"
Expires = "Never"
Department = "Engineering"
}
create_namespace = true
namespace = "redis"
store_password_to_secret_manager = true
custom_credentials_enabled = true
custom_credentials_config = {
password = "aajdhgduy3873683dh"
}
}
module "azure" {
source = "saturnops/redis/kubernetes//modules/resources/azure"
resource_group_name = "prod-skaf-rg"
resource_group_location = local.region
environment = local.environment
name = local.name
store_password_to_secret_manager = local.store_password_to_secret_manager
custom_credentials_enabled = local.custom_credentials_enabled
custom_credentials_config = local.custom_credentials_config
}
module "redis" {
source = "saturnops/redis/kubernetes"
create_namespace = local.create_namespace
namespace = local.namespace
redis_config = {
name = local.name
values_yaml = ""
environment = local.environment
app_version = "6.2.7-debian-11-r11"
architecture = "replication"
slave_volume_size = "10Gi"
master_volume_size = "10Gi"
storage_class_name = "infra-service-sc"
slave_replica_count = 2
store_password_to_secret_manager = local.store_password_to_secret_manager
secret_provider_type = "azure"
}
grafana_monitoring_enabled = true
custom_credentials_enabled = local.custom_credentials_enabled
custom_credentials_config = local.custom_credentials_config
redis_password = local.custom_credentials_enabled ? "" : module.azure.redis_password
}
- Refer AWS examples for more details.
- Refer Azure examples for more details.
- Refer GCP examples for more details.
The required IAM permissions to create resources from this module can be found here
- In order to enable the exporter, it is required to deploy Prometheus/Grafana first.
- The exporter is a tool that extracts metrics data from an application or system and makes it available to be scraped by Prometheus.
- Prometheus is a monitoring system that collects metrics data from various sources, including exporters, and stores it in a time-series database.
- Grafana is a data visualization and dashboard tool that works with Prometheus and other data sources to display the collected metrics in a user-friendly way.
- To deploy Prometheus/Grafana, please follow the installation instructions for each tool in their respective documentation.
- Once Prometheus and Grafana are deployed, the exporter can be configured to scrape metrics data from your application or system and send it to Prometheus.
- Finally, you can use Grafana to create custom dashboards and visualize the metrics data collected by Prometheus.
- This module is compatible with EKS, AKS & GKE which is great news for users deploying the module on an AWS, Azure & GCP cloud. Review the module's documentation, meet specific configuration requirements, and test thoroughly after deployment to ensure everything works as expected.
No requirements.
Name | Version |
---|---|
helm | n/a |
kubernetes | n/a |
No modules.
Name | Type |
---|---|
helm_release.redis | resource |
kubernetes_namespace.redis | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
app_version | Version of the Redis application that will be deployed. | string |
"6.2.7-debian-11-r11" |
no |
chart_version | Version of the chart for the Redis application that will be deployed. | string |
"16.13.2" |
no |
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 |
custom_credentials_config | Specify the configuration settings for Redis to pass custom credentials during creation. | any |
{ |
no |
custom_credentials_enabled | Specifies whether to enable custom credentials for Redis. | bool |
false |
no |
grafana_monitoring_enabled | Specify whether or not to deploy Redis exporter to collect Redis metrics for monitoring in Grafana. | bool |
false |
no |
namespace | Namespace where the Redis resources will be deployed. | string |
"redis" |
no |
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 | Specify the configuration settings for Redis, including the name, environment, storage options, replication settings, store password to secret manager and custom YAML values. | any |
{ |
no |
redis_password | n/a | string |
"" |
no |
Name | Description |
---|---|
redis_credential | Redis credentials used for accessing the database. |
redis_endpoints | Redis endpoints in the Kubernetes cluster. |
Please give our GitHub repository a ⭐️ to show your support and increase its visibility.