88 lines
2.0 KiB
HCL
88 lines
2.0 KiB
HCL
job "democratic-csi-controller" {
|
|
datacenters = ["dc1"]
|
|
|
|
group "iscsi" {
|
|
task "iscsi-controller" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
image = "danielberteaud/democratic-csi:latest"
|
|
|
|
args = [
|
|
"--csi-version=1.5.0",
|
|
"--csi-name=org.democratic-csi.iscsi",
|
|
"--driver-config-file=${NOMAD_SECRETS_DIR}/config.yml",
|
|
"--log-level=info",
|
|
"--csi-mode=controller",
|
|
"--server-socket=/csi/csi.sock",
|
|
]
|
|
|
|
network_mode = "host"
|
|
privileged = true
|
|
userns_mode = "host"
|
|
}
|
|
|
|
template {
|
|
data = <<-EOF
|
|
driver: freenas-api-iscsi
|
|
|
|
instance_id:
|
|
|
|
httpConnection:
|
|
protocol: {{ env "TRUENAS_API_SCHEME" }}
|
|
host: {{ env "TRUENAS_API_HOST" }}
|
|
port: {{ env "TRUENAS_API_PORT" }}
|
|
apiKey: {{ with secret (printf "%skv/service/democratic-csi" (env "VAULT_PREFIX")) }}{{ .Data.data.truenas_api_key }}{{ end }}
|
|
allowInsecure: {{ env "TRUENAS_API_INSECURE" }}
|
|
apiVersion: 2
|
|
|
|
zfs:
|
|
datasetParentName: {{ env "ZFS_PARENT" }}
|
|
detachedSnapshotsDatasetParentName: {{ env "ZFS_SNAP_PARENT" }}
|
|
zvolCompression:
|
|
zvolDedup:
|
|
zvolEnableReservation: {{ env "ZFS_RESERVATION" }}
|
|
zvolBlocksize: {{ env "ZFS_BLOCKSIZE" }}
|
|
|
|
iscsi:
|
|
targetPortals:
|
|
{{ range $idx, $portal := (env "ISCSI_PORTALS" | split ",") }}
|
|
- {{ $portal }}{{ end }}
|
|
interface:
|
|
|
|
namePrefix: ""
|
|
nameSuffix: ""
|
|
|
|
targetGroups:
|
|
- targetGroupPortalGroup: 1
|
|
targetGroupInitiatorGroup: 1
|
|
targetGroupAuthType: None
|
|
targetGroupAuthGroup:
|
|
|
|
extentInsecureTpc: true
|
|
extentXenCompat: false
|
|
extentDisablePhysicalBlocksize: false
|
|
extentBlocksize: 512
|
|
extentRpm: "SSD"
|
|
extentAvailThreshold: 0
|
|
|
|
EOF
|
|
|
|
destination = "${NOMAD_SECRETS_DIR}/config.yml"
|
|
}
|
|
|
|
csi_plugin {
|
|
# must match --csi-name arg
|
|
id = "org.democratic-csi.iscsi"
|
|
type = "controller"
|
|
mount_dir = "/csi"
|
|
}
|
|
|
|
resources {
|
|
cpu = 100
|
|
memory = 192
|
|
}
|
|
}
|
|
}
|
|
}
|