1. Nomad namespace create
nomad namespace apply -description "Boundary" boundary
2. Postgresql setup
2.1 Postgresql job run
postgresql.nomad
job "postgresql" {
type = "service"
datacenters = ["hashistack"]
namespace = "boundary"
group "postgres" {
count = 1
volume "postgres-vol" {
type = "host"
read_only = false
source = "postgres-vol"
}
task "db" {
driver = "docker"
volume_mount {
volume = "postgres-vol"
destination = "/var/lib/postgresql/data"
read_only = false
}
config {
image = "postgres:13.2"
port_map {
pg = 5432
}
}
env {
POSTGRES_PASSWORD = "postgres"
POSTGRES_USER = "postgres"
PGDATA = "/var/lib/postgresql/data/pgdata"
}
resources {
memory = 1024
network {
port "pg" {
static = 5432
}
}
}
service {
name = "postgresql"
tags = ["db", "boundary"]
port = "pg"
check {
type = "tcp"
interval = "10s"
timeout = "2s"
port = "pg"
}
}
}
}
}
25. 6. 16.약 11 분