This commit is contained in:
vincent 2024-01-13 18:35:18 +01:00
parent a0214d0d74
commit 28fc2bf6a7
4 changed files with 85 additions and 4 deletions

View File

@ -0,0 +1,26 @@
job "csi-nfs-controller" {
datacenters = ["homelab"]
group "controller" {
task "csi-nfs-controller" {
driver = "docker"
config {
image = "registry.k8s.io/sig-storage/nfsplugin:v4.5.0"
args = [
"--v=5",
"--nodeid=${attr.unique.hostname}",
"--endpoint=unix:///csi/csi.sock",
"--drivername=nfs.csi.k8s.io"
]
}
csi_plugin {
id = "nfs"
type = "controller"
mount_dir = "/csi"
}
resources {
memory = 32
cpu = 100
}
}
}
}

View File

@ -0,0 +1,29 @@
job "csi-nfs-nodes" {
datacenters = ["homelab","hetzner"]
type = "system"
group "csi-nfs-nodes" {
task "plugin" {
driver = "docker"
config {
image = "registry.k8s.io/sig-storage/nfsplugin:v4.5.0"
args = [
"--v=5",
"--nodeid=${attr.unique.hostname}",
"--endpoint=unix:///csi/csi.sock",
"--drivername=nfs.csi.k8s.io"
]
# node plugins must run as privileged jobs because they
# mount disks to the host
privileged = true
}
csi_plugin {
id = "nfs"
type = "node"
mount_dir = "/csi"
}
resources {
memory = 50
}
}
}
}

View File

@ -3,7 +3,7 @@ job "grafana" {
priority = 50 priority = 50
type = "service" type = "service"
meta { meta {
forcedeploiement = 1 forcedeploiement = 2
} }
group "grafana" { group "grafana" {
network { network {
@ -11,7 +11,12 @@ job "grafana" {
to = 3000 to = 3000
} }
} }
volume "grafana" {
type = "csi"
source = "grafana"
access_mode = "multi-node-multi-writer"
attachment_mode = "file-system"
}
service { service {
name = "grafana" name = "grafana"
port = "http" port = "http"
@ -34,13 +39,17 @@ job "grafana" {
} }
task "dashboard" { task "dashboard" {
volume_mount {
volume = "grafana"
destination = "/grafana"
}
driver = "docker" driver = "docker"
config { config {
image = "grafana/grafana" image = "grafana/grafana"
ports = ["http"] ports = ["http"]
volumes = [ volumes = [
"/mnt/diskstation/nomad/grafana/config:/etc/grafana", "grafana:/etc/grafana",
"/mnt/diskstation/nomad/grafana/lib:/var/lib/grafana" "grafana:/var/lib/grafana"
] ]
} }
resources { resources {

View File

@ -0,0 +1,17 @@
type = "csi"
id = "grafana"
name = "grafana"
plugin_id = "nfs"
external_id = "grafana"
capability {
access_mode = "multi-node-multi-writer"
attachment_mode = "file-system"
}
context {
server = "nfs.service.consul"
share = "/var/local/volume1/nomad/grafana"
}
mount_options {
fs_type = "nfs"
mount_flags = [ "timeo=30", "intr", "vers=3", "_netdev" , "nolock" ]
}