-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from picatz/timescaledb-promscale
Add example optional TimescaleDB and Promscale job file
Showing
4 changed files
with
137 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg12 | ||
variable "datacenters" { | ||
type = list(string) | ||
default = ["dc1"] | ||
} | ||
|
||
job "timescaledb" { | ||
datacenters = var.datacenters | ||
|
||
group "timescaledb" { | ||
network { | ||
mode = "bridge" | ||
} | ||
|
||
service { | ||
name = "timescaledb" | ||
port = "5432" | ||
|
||
connect { | ||
sidecar_service {} | ||
} | ||
} | ||
|
||
ephemeral_disk { | ||
size = 10240 # 10 GB | ||
migrate = true | ||
sticky = true | ||
} | ||
|
||
task "timescaledb" { | ||
driver = "docker" | ||
|
||
# Note, configuration is found at: | ||
# /var/lib/postgresql/data/postgresql.conf | ||
|
||
env { | ||
POSTGRES_PASSWORD = "password" | ||
} | ||
|
||
config { | ||
image = "timescale/timescaledb:latest-pg12" | ||
} | ||
} | ||
} | ||
|
||
group "promscale" { | ||
network { | ||
mode = "bridge" | ||
} | ||
|
||
service { | ||
name = "promscale" | ||
port = "9201" | ||
|
||
connect { | ||
sidecar_service { | ||
proxy { | ||
upstreams { | ||
destination_name = "timescaledb" | ||
local_bind_port = 5432 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
ephemeral_disk { | ||
size = 10240 # 10 GB | ||
migrate = true | ||
sticky = true | ||
} | ||
|
||
task "promscale" { | ||
driver = "docker" | ||
|
||
env { | ||
POSTGRES_PASSWORD = "password" | ||
|
||
// PROMSCALE_WEB_TELEMETRY_PATH = "/metrics" | ||
// PROMSCALE_DB_CONNECT_RETRIES = 10 | ||
// PROMSCALE_LOG_LEVEL = "info" | ||
// PROMSCALE_DB_NAME = "timescale" | ||
// PROMSCALE_DB_PORT = 5432 | ||
// PROMSCALE_DB_SSL_MODE = "allow" | ||
// PROMSCALE_DB_HOST="127.0.0.1" | ||
// PROMSCALE_DB_URI = "" | ||
} | ||
|
||
config { | ||
image = "timescale/promscale:latest" | ||
|
||
args = [ | ||
"-db-uri", "postgres://postgres:[email protected]:5432/postgres?sslmode=allow", | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains 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