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

@@ -18,3 +18,46 @@ resource "nomad_job" "traefik" {
resource "nomad_job" "webapp" {
jobspec = file("webapp.nomad.hcl")
}
resource "nomad_job" "csi-smb" {
jobspec = file("csi-smb.nomad.hcl")
}
data "nomad_plugin" "smb" {
plugin_id = "smb"
wait_for_healthy = true
}
resource "nomad_volume" "unraid_transfer" {
depends_on = [data.nomad_plugin.smb]
plugin_id = "smb"
type = "csi"
volume_id = "unraid_transfer_id5"
name = "unraid_transfer_name"
external_id = "unraid_transfer_ext"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
context = {
source = "//192.168.1.192/transfer"
}
parameters = {
source = "//192.168.1.192/transfer"
"csi.storage.k8s.io/node-stage-secret-name" = "smbcreds"
"csi.storage.k8s.io/node-stage-secret-namespace" = "default"
}
secrets = {
"username" = "anon"
"password" = ""
}
}
resource "nomad_job" "volume_test" {
jobspec = file("volume-test.nomad.hcl")
}