open-nomad/demo/csi/cinder-csi-plugin
Tim Gross e687a21da9
CSI: set plugin CSI_ENDPOINT env var only if unset by user (#12257)
* Use unix:// prefix for CSI_ENDPOINT variable by default
* Some plugins have strict validation over the format of the
  `CSI_ENDPOINT` variable, and unfortunately not all plugins
  agree. Allow the user to override the `CSI_ENDPOINT` to workaround
  those cases.
* Update all demos and tests with CSI_ENDPOINT
2022-03-21 11:48:47 -04:00
..
cinder-csi-plugin.hcl CSI: set plugin CSI_ENDPOINT env var only if unset by user (#12257) 2022-03-21 11:48:47 -04:00
example_volume.hcl Update Cinder CSI example docs (#9267) 2020-11-05 08:19:16 -05:00
README.md CSI: set plugin CSI_ENDPOINT env var only if unset by user (#12257) 2022-03-21 11:48:47 -04:00

Openstack Cinder CSI-Plugin

Requirements

The containers that run the Node/Controller applications require a cloud-config file be mounted in the containers and the path specified in the containers args.

The example plugin job creates a file at local/cloud.conf using a template stanza which pulls the necessary credentials from a Vault kv-v2 secrets store. However, other methods, such as using the artifact stanza, will work as well for delivering the cloud.conf file to the CSI drivers.

Example cloud.conf

[Global]
username = openstack-user
password =  superSecret123
domain-name = default
auth-url = https://service01a-c2.example.com:5001/
tenant-id = 5sd6f4s5df6sd6fs5ds65fd4f65s
region = RegionOne

Docker Privileged Mode

The Cinder CSI Node task requires that privileged = true be set. This is not needed for the Controller task.

Container Arguments

  • --endpoint=${CSI_ENDPOINT}: If you don't use the CSI_ENDPOINT environment variable, this option must match the mount_dir specified in the csi_plugin stanza for the task.

  • --cloud-config=/etc/config/cloud.conf: The location that the cloud.conf file was mounted inside the container

  • --nodeid=${node.unique.name}: A unique ID for the node the task is running on. Recommend using ${node.unique.name}

  • --cluster=${NOMAD_DC}: The cluster the Controller/Node is a part of. Recommend using ${NOMAD_DC}

Deployment

Plugin

export NOMAD_ADDR=https://nomad.example.com:4646
export NOMAD_TOKEN=34534-3sdf3-szfdsafsdf3423-zxdfsd3
nomad job run cinder-csi-plugin.hcl

Volume Registration

export NOMAD_ADDR=https://nomad.example.com:4646
export NOMAD_TOKEN=34534-3sdf3-szfdsafsdf3423-zxdfsd3
nomad volume register example_volume.hcl

Cinder CSI Driver Source