github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/demo/csi/cinder-csi-plugin/cinder-csi-plugin.hcl (about) 1 job "cinder-csi-plugin" { 2 datacenters = ["dc1"] 3 type = "system" 4 group "nodes" { 5 vault { 6 policies = ["openstack-secrets-read"] 7 change_mode = "restart" 8 } 9 task "cinder-node" { 10 driver = "docker" 11 template { 12 data = <<EOF 13 [Global] 14 username = {{ with secret "kv/data/openstack/credentials"}}{{ .Data.data.username }}{{ end }} 15 password = {{ with secret "kv/data/openstack/credentials"}}{{ .Data.data.password }}{{ end }} 16 domain-name = default 17 auth-url = https://service01a-c2.example.com:5001/ 18 tenant-id = 5sd6f4s5df6sd6fs5ds65fd4f65s 19 region = RegionOne 20 EOF 21 destination = "local/cloud.conf" 22 change_mode = "restart" 23 } 24 config { 25 image = "docker.io/k8scloudprovider/cinder-csi-plugin:latest" 26 devices = [{ 27 host_path = "/dev" 28 container_path = "/dev" 29 }] 30 volumes = [ 31 "./local/cloud.conf:/etc/config/cloud.conf" 32 ] 33 34 args = [ 35 "/bin/cinder-csi-plugin", 36 "-v=4", 37 "--endpoint=${CSI_ENDPOINT}", 38 "--cloud-config=/etc/config/cloud.conf", 39 "--nodeid=${node.unique.name}", 40 ] 41 privileged = true 42 } 43 44 csi_plugin { 45 id = "cinder-csi" 46 type = "node" 47 mount_dir = "/csi" 48 } 49 } 50 task "cinder-controller" { 51 52 template { 53 data = <<EOF 54 [Global] 55 username = {{ with secret "kv/data/openstack/credentials"}}{{ .Data.data.username }}{{ end }} 56 password = {{ with secret "kv/data/openstack/credentials"}}{{ .Data.data.password }}{{ end }} 57 domain-name = default 58 auth-url = https://service01a-c2.example.com:5001/ 59 tenant-id = asdfasdfasdfa09asd8fa09sdf8009as8df0sa98 60 region = RegionOne 61 EOF 62 destination = "local/cloud.conf" 63 change_mode = "restart" 64 } 65 driver = "docker" 66 67 config { 68 image = "docker.io/k8scloudprovider/cinder-csi-plugin:latest" 69 volumes = [ 70 "./local/cloud.conf:/etc/config/cloud.conf" 71 ] 72 73 args = [ 74 "/bin/cinder-csi-plugin", 75 "-v=4", 76 "--endpoint=${CSI_ENDPOINT}", 77 "--cloud-config=/etc/config/cloud.conf", 78 "--nodeid=${node.unique.name}", 79 "--cluster=${NOMAD_DC}" 80 ] 81 } 82 83 csi_plugin { 84 id = "cinder-csi" 85 type = "controller" 86 mount_dir = "/csi" 87 } 88 } 89 } 90 }