-
-
Save bvansomeren/725167bba3967be7d2ed9d36378712cc to your computer and use it in GitHub Desktop.
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
job "minio" { | |
datacenters = ["dc1"] | |
type = "service" | |
group "minio1" { | |
ephemeral_disk { | |
size = 10000 | |
sticky = true | |
migrate = false | |
} | |
task "minio1" { | |
driver = "docker" | |
env { | |
MINIO_ACCESS_KEY = "minio" | |
MINIO_SECRET_KEY = "minio123" | |
} | |
user = "root" | |
config { | |
image = "minio/minio:RELEASE.2020-04-04T05-39-31Z" | |
command = "server" | |
args = [ | |
"http://minio{1...4}.service.consul:9000/data{1...2}" | |
] | |
dns_servers = ["${attr.unique.network.ip-address}"] | |
port_map { | |
http = 9000 | |
} | |
privileged = true | |
mounts = [ | |
# sample volume mount | |
{ | |
type = "volume" | |
target = "/data1" | |
source = "data1-1" | |
readonly = false | |
}, | |
{ | |
type = "volume" | |
target = "/data2" | |
source = "data1-2" | |
readonly = false | |
}, | |
] | |
} | |
service { | |
name = "minio1" | |
port = "http" | |
check { | |
name = "alive" | |
type = "http" | |
port = "http" | |
path = "/minio/health/live" | |
interval = "30s" | |
timeout = "20s" | |
initial_status = "passing" | |
check_restart { | |
limit = 3 | |
grace = "90s" | |
ignore_warnings = false | |
} | |
} | |
} | |
resources { | |
network { | |
port "http" { | |
static = 9000 | |
} | |
} | |
cpu = 20 | |
memory = 100 | |
} | |
} | |
} | |
group "minio2" { | |
ephemeral_disk { | |
size = 10000 | |
sticky = true | |
migrate = false | |
} | |
task "minio2" { | |
driver = "docker" | |
env { | |
MINIO_ACCESS_KEY = "minio" | |
MINIO_SECRET_KEY = "minio123" | |
} | |
user = "root" | |
config { | |
image = "minio/minio:RELEASE.2020-04-04T05-39-31Z" | |
command = "server" | |
args = [ | |
"http://minio{1...4}.service.consul:9000/data{1...2}" | |
] | |
dns_servers = ["${attr.unique.network.ip-address}"] | |
port_map { | |
http = 9000 | |
} | |
privileged = true | |
mounts = [ | |
# sample volume mount | |
{ | |
type = "volume" | |
target = "/data1" | |
source = "data2-1" | |
readonly = false | |
}, | |
{ | |
type = "volume" | |
target = "/data2" | |
source = "data2-2" | |
readonly = false | |
}, | |
] | |
} | |
service { | |
name = "minio2" | |
port = "http" | |
check { | |
name = "alive" | |
type = "http" | |
port = "http" | |
path = "/minio/health/live" | |
interval = "30s" | |
timeout = "20s" | |
initial_status = "passing" | |
check_restart { | |
limit = 3 | |
grace = "90s" | |
ignore_warnings = false | |
} | |
} | |
} | |
resources { | |
network { | |
port "http" { | |
static = 9000 | |
} | |
} | |
cpu = 20 | |
memory = 100 | |
} | |
} | |
} | |
group "minio3" { | |
ephemeral_disk { | |
size = 10000 | |
sticky = true | |
migrate = false | |
} | |
task "minio3" { | |
driver = "docker" | |
env { | |
MINIO_ACCESS_KEY = "minio" | |
MINIO_SECRET_KEY = "minio123" | |
} | |
user = "root" | |
config { | |
image = "minio/minio:RELEASE.2020-04-04T05-39-31Z" | |
command = "server" | |
args = [ | |
"http://minio{1...4}.service.consul:9000/data{1...2}" | |
] | |
dns_servers = ["${attr.unique.network.ip-address}"] | |
port_map { | |
http = 9000 | |
} | |
privileged = true | |
mounts = [ | |
# sample volume mount | |
{ | |
type = "volume" | |
target = "/data1" | |
source = "data3-1" | |
readonly = false | |
}, | |
{ | |
type = "volume" | |
target = "/data2" | |
source = "data3-2" | |
readonly = false | |
}, | |
] | |
} | |
service { | |
name = "minio3" | |
port = "http" | |
check { | |
name = "alive" | |
type = "http" | |
port = "http" | |
path = "/minio/health/live" | |
interval = "30s" | |
timeout = "20s" | |
initial_status = "passing" | |
check_restart { | |
limit = 3 | |
grace = "90s" | |
ignore_warnings = false | |
} | |
} | |
} | |
resources { | |
network { | |
port "http" { | |
static = 9000 | |
} | |
} | |
cpu = 20 | |
memory = 100 | |
} | |
} | |
} | |
group "minio4" { | |
ephemeral_disk { | |
size = 10000 | |
sticky = true | |
migrate = false | |
} | |
task "minio4" { | |
driver = "docker" | |
env { | |
MINIO_ACCESS_KEY = "minio" | |
MINIO_SECRET_KEY = "minio123" | |
} | |
user = "root" | |
config { | |
image = "minio/minio:RELEASE.2020-04-04T05-39-31Z" | |
command = "server" | |
args = [ | |
"http://minio{1...4}.service.consul:9000/data{1...2}" | |
] | |
dns_servers = ["${attr.unique.network.ip-address}"] | |
port_map { | |
http = 9000 | |
} | |
privileged = true | |
mounts = [ | |
# sample volume mount | |
{ | |
type = "volume" | |
target = "/data1" | |
source = "data4-1" | |
readonly = false | |
}, | |
{ | |
type = "volume" | |
target = "/data2" | |
source = "data4-2" | |
readonly = false | |
}, | |
] | |
} | |
service { | |
name = "minio4" | |
port = "http" | |
check { | |
name = "alive" | |
type = "http" | |
port = "http" | |
path = "/minio/health/live" | |
interval = "30s" | |
timeout = "20s" | |
initial_status = "passing" | |
check_restart { | |
limit = 3 | |
grace = "90s" | |
ignore_warnings = false | |
} | |
} | |
} | |
resources { | |
network { | |
port "http" { | |
static = 9000 | |
} | |
} | |
cpu = 20 | |
memory = 100 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment