Skip to content

Commit

Permalink
feat: add memcached nomad job (#99)
Browse files Browse the repository at this point in the history
Co-authored-by: Mirio <[email protected]>
  • Loading branch information
Mirio and Mirio authored Feb 1, 2024
1 parent a1d47c5 commit c3b3b48
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions memcached.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
variable "memcached_version" {
type = string
default = "1.6.23-alpine"
}

job "memcached" {
datacenters = ["dc1"]
type = "service"
name = "memcached"
priority = 100

update {
max_parallel = 1
health_check = "checks"
min_healthy_time = "5s"
healthy_deadline = "300s"
progress_deadline = "10m"
auto_revert = true
auto_promote = true
canary = 1
}

migrate {
max_parallel = 2
health_check = "checks"
min_healthy_time = "10s"
healthy_deadline = "5m"
}

group "server" {
count = 1

network {
port "memcached" {
to = 11211
}
}
service {
name = "memcached-server"
port = "memcached"
on_update = "require_healthy"

check {
name = "memcached_ready"
type = "tcp"
port = "memcached"
interval = "10s"
timeout = "3s"
}
}

task "server" {
driver = "docker"
config {
image = "docker.io/memcached:${var.memcached_version}"
ports = ["memcached"]
}

resources {
cpu = 1000
memory = 200
}
}
}
}

0 comments on commit c3b3b48

Please sign in to comment.