This module is IaC - infrastructure as code which contains a nomad job of Redis.
Software | OSS Version | Enterprise Version |
---|---|---|
Terraform | 0.13.1 or newer | |
Consul | 1.8.3 or newer | 1.8.3 or newer |
Vault | 1.5.2.1 or newer | 1.5.2.1 or newer |
Nomad | 0.12.3 or newer | 0.12.3 or newer |
Module | Version |
---|---|
None | - |
All software is provided and run with docker. See the Makefile for inspiration.
The following command will run Redis in the example/standalone folder.
make up
You can verify the setup by connention to Redis using the Nomad UI at localhost:4646. Follow the steps below:
- Locate and click the redis nomad-job.
- Click the exec button and connect to the redis --> redis-service-task.
- Run
redis-cli
to connect to Redis Cli. - Run
ping
. Your output should look like this:
127.0.0.1:6379> ping
PONG
Example-code that shows how to use the module and, if applicable, its different use cases.
module "redis" {
source = "../.."
# nomad
nomad_datacenters = ["dc1"]
nomad_namespace = "default"
# redis
service_name = "redis"
host = "127.0.0.1"
port = 6379
container_image = "redis:3-alpine"
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
nomad_datacenters | Nomad data centers | list(string) | ["dc1"] | yes |
nomad_namespace | [Enterprise] Nomad namespace | string | "default" | yes |
service_name | Redis service name | string | "redis" | yes |
host | Redis host | string | "127.0.0.1" | yes |
port | Redis container port | number | 6379 | yes |
container_image | Redis container image | string | "redis:3-alpine" | yes |
resource | Resource allocations for cpu and memory | obj(number, number) | { cpu = 200, memory = 128 } |
no |
resource_proxy | Resource allocations for proxy | obj(number, number) | { cpu = 200, memory = 128 } |
no |
use_canary | Uses canary deployment for Redis | bool | false | no |
Name | Description | Type |
---|---|---|
redis_service | Redis service name | string |
redis_port | Redis port number | number |
redis_host | Redis host | string |
This work is licensed under Apache 2 License. See LICENSE for full details.