Today I Learned

Upgrading to Nomad 1.1.0 and above when using CSI

Nomad v1.1.0 introduced few backward incompatibilites - one related to CSI.

When upgrading you need to change your nomad_volume resources from:

resource "nomad_volume" "grafana" {
  # ...
  access_mode     = "single-node-writer"
  attachment_mode = "file-system"

to:

resource "nomad_volume" "grafana" {
  # ...
  capability {
    access_mode     = "single-node-writer"
    attachment_mode = "file-system"
  }

That might require nomad provider to be upgraded. Then simply add attachment_mode and access_mode to nomad jobs:

  # ...
  group "monitoring" {
    volume "${volume_id}" {
      type            = "csi"
      read_only       = false
      source          = "${volume_id}"
      attachment_mode = "file-system"
      access_mode     = "single-node-writer"
    }

  # ...