github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/demo/csi/ceph-csi-plugin/ceph-csi-plugin.hcl (about)

     1  job "ceph-csi-plugin" {
     2    datacenters = ["dc1"]
     3    type        = "system"
     4    group "nodes" {
     5      task "ceph-node" {
     6        driver = "docker"
     7        template {
     8          data        = <<EOF
     9  [{
    10      "clusterID": "<clusterid>",
    11      "monitors": [
    12          {{range $index, $service := service "mon.ceph"}}{{if gt $index 0}}, {{end}}"{{.Address}}"{{end}}
    13      ]
    14  }]
    15  EOF
    16          destination = "local/config.json"
    17          change_mode = "restart"
    18        }
    19        config {
    20          image = "quay.io/cephcsi/cephcsi:v2.1.2-amd64"
    21          volumes = [
    22            "./local/config.json:/etc/ceph-csi-config/config.json"
    23          ]
    24          mounts = [
    25            {
    26              type     = "tmpfs"
    27              target   = "/tmp/csi/keys"
    28              readonly = false
    29              tmpfs_options {
    30                size = 1000000 # size in bytes
    31              }
    32            }
    33          ]
    34          args = [
    35            "--type=rbd",
    36            # Name of the driver
    37            "--drivername=rbd.csi.ceph.com",
    38            "--logtostderr",
    39            "--nodeserver=true",
    40            "--endpoint=unix://csi/csi.sock",
    41            "--instanceid=${attr.unique.platform.aws.instance-id}",
    42            "--nodeid=${attr.unique.consul.name}",
    43            # TCP port for liveness metrics requests (/metrics)
    44            "--metricsport=${NOMAD_PORT_prometheus}",
    45          ]
    46          privileged = true
    47          resources {
    48            cpu    = 200
    49            memory = 500
    50            network {
    51              mbits = 1
    52              // prometheus metrics port
    53              port "prometheus" {}
    54            }
    55          }
    56        }
    57        service {
    58          name = "prometheus"
    59          port = "prometheus"
    60          tags = ["ceph-csi"]
    61        }
    62        csi_plugin {
    63          id        = "ceph-csi"
    64          type      = "node"
    65          mount_dir = "/csi"
    66        }
    67      }
    68      task "ceph-controller" {
    69  
    70        template {
    71          data        = <<EOF
    72  [{
    73      "clusterID": "<clusterid>",
    74      "monitors": [
    75          {{range $index, $service := service "mon.ceph"}}{{if gt $index 0}}, {{end}}"{{.Address}}"{{end}}
    76      ]
    77  }]
    78  EOF
    79          destination = "local/config.json"
    80          change_mode = "restart"
    81        }
    82        driver = "docker"
    83        config {
    84          image = "quay.io/cephcsi/cephcsi:v2.1.2-amd64"
    85          volumes = [
    86            "./local/config.json:/etc/ceph-csi-config/config.json"
    87          ]
    88          resources {
    89            cpu    = 200
    90            memory = 500
    91            network {
    92              mbits = 1
    93              // prometheus metrics port
    94              port "prometheus" {}
    95            }
    96          }
    97          args = [
    98            "--type=rbd",
    99            "--controllerserver=true",
   100            "--drivername=rbd.csi.ceph.com",
   101            "--logtostderr",
   102            "--endpoint=unix://csi/csi.sock",
   103            "--metricsport=$${NOMAD_PORT_prometheus}",
   104            "--nodeid=$${attr.unique.platform.aws.hostname}"
   105          ]
   106        }
   107        service {
   108          name = "prometheus"
   109          port = "prometheus"
   110          tags = ["ceph-csi"]
   111        }
   112        csi_plugin {
   113          id        = "ceph-csi"
   114          type      = "controller"
   115          mount_dir = "/csi"
   116        }
   117      }
   118    }
   119  }