-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseaweedfs-plugin.job.nomad
56 lines (49 loc) · 1.22 KB
/
seaweedfs-plugin.job.nomad
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
job "seaweedfs-plugin" {
datacenters = ["dc1"]
type = "system"
# only one plugin of a given type and ID should be deployed on
# any given client node
constraint {
operator = "distinct_hosts"
value = true
}
group "nodes" {
task "plugin" {
driver = "docker"
template {
destination = "config/.env"
env = true
data = <<-EOF
{{ range $i, $s := service "http.seaweedfs-filer" }}
{{- if eq $i 0 -}}
SEAWEEDFS_FILER_IP_http={{ .Address }}
SEAWEEDFS_FILER_PORT_http={{ .Port }}
{{- end -}}
{{ end }}
{{ range $i, $s := service "grpc.seaweedfs-filer" }}
{{- if eq $i 0 -}}
SEAWEEDFS_FILER_IP_grpc={{ .Address }}
SEAWEEDFS_FILER_PORT_grpc={{ .Port }}
{{- end -}}
{{ end }}
EOF
}
config {
image = "chrislusf/seaweedfs-csi-driver"
args = [
"--endpoint=unix://csi/csi.sock",
"--filer=${SEAWEEDFS_FILER_IP_http}:${SEAWEEDFS_FILER_PORT_http}.${SEAWEEDFS_FILER_PORT_grpc}",
"--nodeid=${node.unique.name}",
"--cacheCapacityMB=1000",
"--cacheDir=/tmp",
]
privileged = true
}
csi_plugin {
id = "seaweedfs"
type = "monolith"
mount_dir = "/csi"
}
}
}
}