Created
September 26, 2019 22:45
-
-
Save f4rx/ff7819cd8a7f17070e945e68fb89625f to your computer and use it in GitHub Desktop.
redis.nomad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| job "redis" { | |
| datacenters = ["dc1"] | |
| group "redis-server" { | |
| count = 6 | |
| update { | |
| max_parallel = 1 | |
| min_healthy_time = "10s" | |
| healthy_deadline = "10m" | |
| progress_deadline = "11m" | |
| } | |
| task "server" { | |
| driver = "docker" | |
| service { | |
| name = "my-redis-service-name" | |
| port = "redis_port" | |
| check { | |
| type = "tcp" | |
| port = "redis_port" | |
| interval = "10s" | |
| timeout = "2s" | |
| } | |
| } | |
| resources { | |
| network { | |
| port "redis_port" { | |
| } | |
| } | |
| } | |
| config { | |
| image = "redis:5.0.1" | |
| port_map { | |
| redis_port = 6379 | |
| } | |
| } | |
| env { | |
| foo = "bar3" | |
| } | |
| template { | |
| data = <<EOH | |
| --- | |
| node_dc: {{ env "node.datacenter" }} | |
| node_cores: {{ env "attr.cpu.numcores" }} | |
| meta_key: {{ env "meta.node_meta_key" }} | |
| service_key: {{ key "apps/my-app/config/var1" }} | |
| EOH | |
| destination = "local/redis.conf" | |
| change_mode = "signal" | |
| change_signal = "SIGINT" | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment