further Nomad documentation

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2021-12-01 22:24:59 -07:00
parent d45f7077e9
commit 8376880f2d
4 changed files with 102 additions and 0 deletions

14
docs/Nomad/README.md Normal file
View File

@ -0,0 +1,14 @@
# setup
```
cat <<EOF > /etc/nomad.d/csi.hcl
plugin "docker" {
config {
allow_privileged = true
volumes {
# required for bind mounting host directories
enabled = true
}
}
}
```

View File

@ -0,0 +1,66 @@
job "mysql-server" {
datacenters = ["dc1"]
type = "service"
group "mysql-server" {
count = 1
volume "mysql" {
type = "csi"
read_only = false
# iscsi
source = "csi-volume-iscsi"
access_mode = "single-node-writer"
attachment_mode = "file-system"
# nfs
#source = "csi-volume-nfs"
#access_mode = "multi-node-multi-writer"
#attachment_mode = "file-system"
}
network {
port "db" {
static = 3306
}
}
restart {
attempts = 10
interval = "5m"
delay = "25s"
mode = "delay"
}
task "mysql-server" {
driver = "docker"
volume_mount {
volume = "mysql"
destination = "/srv"
read_only = false
}
env {
MYSQL_ROOT_PASSWORD = "password"
}
config {
image = "hashicorp/mysql-portworx-demo:latest"
args = ["--datadir", "/srv/mysql"]
ports = ["db"]
}
resources {
cpu = 500
memory = 1024
}
service {
name = "mysql-server"
port = "db"
}
}
}
}

View File

@ -0,0 +1,11 @@
type = "csi"
id = "csi-volume-iscsi"
name = "csi-volume-iscsi"
plugin_id = "org.democratic-csi.iscsi"
capacity_min = "1GiB"
capacity_max = "1GiB"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}

View File

@ -0,0 +1,11 @@
type = "csi"
id = "csi-volume-nfs"
name = "csi-volume-nfs"
plugin_id = "org.democratic-csi.nfs"
capacity_min = "1GiB"
capacity_max = "1GiB"
capability {
access_mode = "multi-node-multi-writer"
attachment_mode = "file-system"
}