Nomad: 1.3.1
Deployed this CSI job on hetzner cloud (hcloud) results in a healthy CSI plugin:
variable "datacenters" {
type = list(string)
default = ["dc1"]
}
variable "namespace" {
type = string
default = "default"
}
job "hcloud-csi" {
datacenters = var.datacenters
namespace = var.namespace
type = "system"
group "node" {
task "plugin" {
driver = "docker"
config {
image = "hetznercloud/hcloud-csi-driver:1.6.0"
privileged = true
}
env {
CSI_ENDPOINT = "unix:///csi/csi.sock"
HCLOUD_TOKEN = "..."
}
csi_plugin {
id = "csi.hetzner.cloud"
type = "monolith"
mount_dir = "/csi"
}
}
}
}
then I successfully created a volume (verified in the hcloud UI)
id = "vol1"
namespace = "default"
name = "vol1"
type = "csi"
plugin_id = "csi.hetzner.cloud"
capacity_min = "10Gi"
capacity_max = "10Gi"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
mount_options {
fs_type = "ext4"
mount_flags = ["noatime"]
}
$ hcloud volume list
ID NAME SIZE SERVER LOCATION
20204336 vol1 10 GB - fsn1
$ hcloud volume describe -o json 20204336 | jq
{
"created": "2022-06-07T22:10:06+00:00",
"format": null,
"id": 20204336,
"labels": {},
"linux_device": "/dev/disk/by-id/scsi-0HC_Volume_20204336",
"location": {
"city": "Falkenstein",
"country": "DE",
"description": "Falkenstein DC Park 1",
"id": 1,
"latitude": 50.47612,
"longitude": 12.370071,
"name": "fsn1",
"network_zone": "eu-central"
},
"name": "vol1",
"protection": {
"delete": false
},
"server": null,
"size": 10,
"status": "available"
}
this results in:
$ nomad volume status
Container Storage Interface
ID Name Plugin ID Schedulable Access Mode
vol1 vol1 csi.hetzner.cloud true <none>
there I already see the missing access mode. When I tried to use the volume in a job:
job "httpd1" {
datacenters = ["dc1"]
group "httpd" {
restart {
attempts = 10
interval = "5m"
delay = "25s"
mode = "delay"
}
volume "vol1" {
type = "csi"
read_only = false
source = "vol1"
}
task "httpd" {
driver = "docker"
volume_mount {
volume = "vol1"
destination = "/srv"
read_only = false
}
config {
image = "httpd:2.4.41-alpine"
}
}
}
}
I get an error
$ nomad job run test/job.nomad
Error submitting job: Unexpected response code: 500 (1 error occurred:
* Task group httpd validation failed: 1 error occurred:
* Task group volume validation for vol1 failed: 2 errors occurred:
* CSI volumes must have an attachment mode
* CSI volumes must have an access mode
)
any hints, what is going wrong?