Add Redis for Caching (no persistance)
This commit is contained in:
37
nomad_jobs/services/redis/redis-cache.nomad.hcl
Normal file
37
nomad_jobs/services/redis/redis-cache.nomad.hcl
Normal file
@@ -0,0 +1,37 @@
|
||||
job "redis-cache" {
|
||||
datacenters = ["dc1"]
|
||||
|
||||
group "cache" {
|
||||
count = 1
|
||||
|
||||
network {
|
||||
mode = "bridge"
|
||||
port "redis" {
|
||||
to = 6379
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
# Make available to other services by the 'redis-cache' name
|
||||
name = "redis-cache"
|
||||
port = "6379"
|
||||
tags = ["traefik.enable=false"] # Hide redis from traefik
|
||||
|
||||
# Make available through the consul service mesh
|
||||
connect {
|
||||
sidecar_service {
|
||||
tags = ["traefik.enable=false"] # Hide redis envoy from traefik
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task "redis" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "redis:7.2.3-alpine"
|
||||
ports = ["redis"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user