init csi
This commit is contained in:
parent
a0214d0d74
commit
28fc2bf6a7
26
nomad-job/csi-nfs-controler.nomad
Normal file
26
nomad-job/csi-nfs-controler.nomad
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
nomad-job/csi-nfs-node.nomad
Normal file
29
nomad-job/csi-nfs-node.nomad
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ job "grafana" {
|
||||
priority = 50
|
||||
type = "service"
|
||||
meta {
|
||||
forcedeploiement = 1
|
||||
forcedeploiement = 2
|
||||
}
|
||||
group "grafana" {
|
||||
network {
|
||||
@ -11,7 +11,12 @@ job "grafana" {
|
||||
to = 3000
|
||||
}
|
||||
}
|
||||
|
||||
volume "grafana" {
|
||||
type = "csi"
|
||||
source = "grafana"
|
||||
access_mode = "multi-node-multi-writer"
|
||||
attachment_mode = "file-system"
|
||||
}
|
||||
service {
|
||||
name = "grafana"
|
||||
port = "http"
|
||||
@ -34,13 +39,17 @@ job "grafana" {
|
||||
}
|
||||
|
||||
task "dashboard" {
|
||||
volume_mount {
|
||||
volume = "grafana"
|
||||
destination = "/grafana"
|
||||
}
|
||||
driver = "docker"
|
||||
config {
|
||||
image = "grafana/grafana"
|
||||
ports = ["http"]
|
||||
volumes = [
|
||||
"/mnt/diskstation/nomad/grafana/config:/etc/grafana",
|
||||
"/mnt/diskstation/nomad/grafana/lib:/var/lib/grafana"
|
||||
"grafana:/etc/grafana",
|
||||
"grafana:/var/lib/grafana"
|
||||
]
|
||||
}
|
||||
resources {
|
||||
|
17
nomad-volume/volume-grafana.hcl
Normal file
17
nomad-volume/volume-grafana.hcl
Normal 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" ]
|
||||
}
|
Loading…
Reference in New Issue
Block a user