0% found this document useful (0 votes)
9 views1 page

Postgres Nomad Demo Configuration

The document defines a Nomad job configuration for a PostgreSQL service named 'postgres-nomad-demo'. It specifies a single group 'db' with a Docker task that uses a static port mapping for the database service. Additionally, it includes a health check configuration that performs TCP checks on the database port at specified intervals.

Uploaded by

narayanardy5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Postgres Nomad Demo Configuration

The document defines a Nomad job configuration for a PostgreSQL service named 'postgres-nomad-demo'. It specifies a single group 'db' with a Docker task that uses a static port mapping for the database service. Additionally, it includes a health check configuration that performs TCP checks on the database port at specified intervals.

Uploaded by

narayanardy5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

job "postgres-nomad-demo" {

datacenters = ["dc1"]

group "db" {
network {
port "db" {
static = 5432 # Static port mapping for 'db' service
}
}

task "server" {
driver = "docker"

config {
image = "hashicorp/postgres-nomad-demo:latest"
ports = ["db"] # Reference the 'db' port label
}

service {
name = "database"
port = "db" # Use the 'db' port label for service
provider = "nomad"

# Health check configuration inside the 'service' block


check {
type = "tcp" # TCP check on the 'db' port
port = "db" # Use the 'db' port label for health check
interval = "30s" # Interval between checks
timeout = "5s" # Timeout for each check
}
}
}
}
}

You might also like