-
Notifications
You must be signed in to change notification settings - Fork 9
/
local_ssh.hcl
105 lines (84 loc) · 2.11 KB
/
local_ssh.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
job "ssh-client" {
datacenters = ["city"]
type = "batch"
parameterized {
meta_required = ["ssh_key", "box_name", "base_url", "bandwidth"]
}
group "holepunch" {
count = 1
task "sshd" {
driver = "docker"
config {
image = "cypherpunkarmory/sshd:develop"
network_mode = "holepunch_default"
labels {
"io.holepunch.sshd" = "${NOMAD_META_BOX_NAME}"
}
port_map {
ssh = 22
http = 3000
https = 3001
}
}
env {
"SSH_KEY" = "${NOMAD_META_SSH_KEY}"
"BANDWIDTH" = "${NOMAD_META_BANDWIDTH}"
}
service {
name = "box-${NOMAD_META_BOX_NAME}-ssh"
port = "ssh"
check {
name = "ssh-${NOMAD_META_BOX_NAME}-up"
address_mode = "driver"
port = "ssh"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
service {
name = "box-${NOMAD_META_BOX_NAME}-http"
tags = [
"urlprefix-${NOMAD_META_BOX_NAME}.${NOMAD_META_BASE_URL}/ proto=http",
]
port = "http"
check {
name = "http-$${NOMAD_META_BOX_NAME}-up"
address_mode = "driver"
port = "http"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
service {
name = "box-${NOMAD_META_BOX_NAME}-https"
tags = [
"urlprefix-${NOMAD_META_BOX_NAME}.${NOMAD_META_BASE_URL}/ proto=tcp+sni"
]
port = "https"
check {
name = "https-${NOMAD_META_BOX_NAME}-up"
address_mode = "driver"
port = "https"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
resources {
cpu = 100 # MHz
memory = 2000 # MB
network {
mbits = 1
# This requests a dynamic port named "http". This will
# be something like "46283", but we refer to it via the
# label "http".
port "ssh" {}
port "http" {}
port "https" {}
}
}
}
}
}