github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/demo/csi/hostpath/README.md (about)

     1  # Hostpath CSI Plugin
     2  
     3  Author: @hashicorp/nomad-eng
     4  
     5  This directory includes a demo using the [CSI host path
     6  driver](https://github.com/kubernetes-csi/csi-driver-host-path) to create
     7  local "host path" volumes that can be mounted via the Nomad CSI
     8  implementation.
     9  
    10  ## What Is This For?
    11  
    12  The hostpath plugin is for demonstration and development purposes only. It
    13  shouldn't be used for production. If you want to get a quick idea of how CSI
    14  works on Nomad in a Vagrant environment, this demo is a good option.
    15  
    16  ## Requirements
    17  
    18  * A running Nomad cluster with `docker.privileged.enabled = true`. The Nomad
    19    developer [Vagrantfile](https://github.com/hashicorp/nomad/blob/main/Vagrantfile)
    20    in this repo is suitable.
    21  
    22  Running the `run.sh` script in this directory will output the Nomad command
    23  used to run the demo, as well as their outputs:
    24  
    25  ```
    26  $ nomad job run ./plugin.nomad
    27  ==> Monitoring evaluation "7ac3cc8d"
    28      Evaluation triggered by job "csi-plugin"
    29      Allocation "bbd34b72" created: node "917b009b", group "csi"
    30  ==> Monitoring evaluation "7ac3cc8d"
    31      Allocation "bbd34b72" status changed: "pending" -> "running" (Tasks are running)
    32      Evaluation status changed: "pending" -> "complete"
    33  ==> Evaluation "7ac3cc8d" finished with status "complete"
    34  Nodes Healthy        = 1
    35  
    36  $ nomad plugin status hostpath
    37  ID                   = hostpath-plugin0
    38  Provider             = csi-hostpath
    39  Version              = v1.2.0-0-g83590990
    40  Controllers Healthy  = 1
    41  Controllers Expected = 1
    42  Nodes Healthy        = 1
    43  Nodes Expected       = 1
    44  
    45  Allocations
    46  ID        Node ID   Task Group  Version  Desired  Status   Created  Modified
    47  bbd34b72  917b009b  csi         0        run      running  3s ago   2s ago
    48  
    49  $ cat hostpath.hcl | sed | nomad volume create -
    50  Created external volume 7185cd16-993f-11eb-a052-0242ac110002 with ID test-volume[0]
    51  
    52  $ cat hostpath.hcl | sed | nomad volume create -
    53  Created external volume 718bd6b4-993f-11eb-a052-0242ac110002 with ID test-volume[1]
    54  
    55  $ nomad job run ./redis.nomad
    56  ==> Monitoring evaluation "3178513e"
    57      Evaluation triggered by job "example"
    58      Evaluation within deployment: "ffb161f4"
    59      Allocation "139caa78" created: node "917b009b", group "cache"
    60      Allocation "5e1b57f5" created: node "917b009b", group "cache"
    61      Evaluation status changed: "pending" -> "complete"
    62  ==> Evaluation "3178513e" finished with status "complete"
    63  
    64  $ nomad volume status
    65  Container Storage Interface
    66  ID              Name            Plugin ID         Schedulable  Access Mode
    67  test-volume[0]  test-volume[0]  hostpath-plugin0  true         single-node-reader-only
    68  test-volume[1]  test-volume[1]  hostpath-plugin0  true         single-node-reader-only
    69  ```