Update nomad.md
Simplifying the Nomad jobpsec by removing unnecessary volume mapping and using the tasks `local/` directory environment variable.
`${NOMAD_TASK_DIR}` == `local/`
`${NOMAD_SECRETS_DIR}` == `secrets/`
One should use `${NOMAD_SECRETS_DIR}` if the application config file contains sensitive information.
This commit is contained in:
parent
6ec8560afd
commit
dd742982e0
|
|
@ -36,7 +36,7 @@ job "storage-controller" {
|
||||||
args = [
|
args = [
|
||||||
"--csi-version=1.2.0",
|
"--csi-version=1.2.0",
|
||||||
"--csi-name=org.democratic-csi.nfs",
|
"--csi-name=org.democratic-csi.nfs",
|
||||||
"--driver-config-file=/config/driver-config-file.yaml",
|
"--driver-config-file=${NOMAD_TASK_DIR}/driver-config-file.yaml",
|
||||||
"--log-level=debug",
|
"--log-level=debug",
|
||||||
"--csi-mode=controller",
|
"--csi-mode=controller",
|
||||||
"--server-socket=/csi-data/csi.sock",
|
"--server-socket=/csi-data/csi.sock",
|
||||||
|
|
@ -44,10 +44,6 @@ job "storage-controller" {
|
||||||
"--server-port=9000",
|
"--server-port=9000",
|
||||||
]
|
]
|
||||||
|
|
||||||
volumes = [
|
|
||||||
"config/driver-config-file.yaml:/config/driver-config-file.yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
privileged = true
|
privileged = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +54,7 @@ job "storage-controller" {
|
||||||
}
|
}
|
||||||
|
|
||||||
template {
|
template {
|
||||||
destination = "config/driver-config-file.yaml"
|
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
|
||||||
|
|
||||||
data = <<EOH
|
data = <<EOH
|
||||||
config
|
config
|
||||||
|
|
@ -91,16 +87,12 @@ job "storage-node" {
|
||||||
args = [
|
args = [
|
||||||
"--csi-version=1.2.0",
|
"--csi-version=1.2.0",
|
||||||
"--csi-name=org.democratic-csi.nfs",
|
"--csi-name=org.democratic-csi.nfs",
|
||||||
"--driver-config-file=/config/driver-config-file.yaml",
|
"--driver-config-file=${NOMAD_TASK_DIR}/driver-config-file.yaml",
|
||||||
"--log-level=debug",
|
"--log-level=debug",
|
||||||
"--csi-mode=node",
|
"--csi-mode=node",
|
||||||
"--server-socket=/csi-data/csi.sock",
|
"--server-socket=/csi-data/csi.sock",
|
||||||
]
|
]
|
||||||
|
|
||||||
volumes = [
|
|
||||||
"config/driver-config-file.yaml:/config/driver-config-file.yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
privileged = true
|
privileged = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,7 +103,7 @@ job "storage-node" {
|
||||||
}
|
}
|
||||||
|
|
||||||
template {
|
template {
|
||||||
destination = "/config/driver-config-file.yaml"
|
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
|
||||||
|
|
||||||
data = <<EOH
|
data = <<EOH
|
||||||
config
|
config
|
||||||
|
|
@ -178,4 +170,4 @@ resource "nomad_volume" "<volume name>" {
|
||||||
share = "<share>"
|
share = "<share>"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue