Setup mounting smb shares as volumes using csi
This commit is contained in:
76
2-nomad-config/volume-test.nomad.hcl
Normal file
76
2-nomad-config/volume-test.nomad.hcl
Normal file
@@ -0,0 +1,76 @@
|
||||
job "volume-test" {
|
||||
group "web" {
|
||||
network {
|
||||
port "www" {
|
||||
to = 80
|
||||
}
|
||||
}
|
||||
|
||||
volume "unraid_transfer_use" {
|
||||
type = "csi"
|
||||
source = "unraid_transfer_id5"
|
||||
access_mode = "single-node-writer"
|
||||
attachment_mode = "file-system"
|
||||
read_only = true
|
||||
|
||||
mount_options {
|
||||
fs_type = "ext4"
|
||||
mount_flags = ["noatime"]
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
name = "volume-test"
|
||||
port = "www"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
]
|
||||
|
||||
check {
|
||||
name = "alive"
|
||||
type = "tcp"
|
||||
port = "www"
|
||||
interval = "10s"
|
||||
timeout = "2s"
|
||||
}
|
||||
}
|
||||
|
||||
task "webserver" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "nginx:latest"
|
||||
|
||||
ports = ["www"]
|
||||
# volumes = [
|
||||
# "local:/usr/share/nginx/html:ro"
|
||||
# ]
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
volume = "unraid_transfer_use"
|
||||
destination = "/usr/share/nginx/html/transfer"
|
||||
read_only = true
|
||||
}
|
||||
|
||||
# template {
|
||||
# data = "<h1>Volume Test 1</h1>"
|
||||
# destination = "local/index.html"
|
||||
# }
|
||||
|
||||
resources {
|
||||
cpu = 500
|
||||
memory = 256
|
||||
}
|
||||
}
|
||||
|
||||
# volume "local" {
|
||||
# type = "csi"
|
||||
# source = "unraid_transfer"
|
||||
# read_only = true
|
||||
# access_mode = "single-node-writer"
|
||||
# attachment_mode = "file-system"
|
||||
# }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user