Setup mounting smb shares as volumes using csi

This commit is contained in:
2025-05-01 03:52:34 +10:00
parent 874f17aa74
commit 9c06f0bd80
9 changed files with 588 additions and 22 deletions

View 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"
# }
}
}