From 0df92c80db7e0de4557e015609c9d274dcab9641 Mon Sep 17 00:00:00 2001 From: Tracey Jaquith Date: Tue, 27 Feb 2024 20:46:55 -0800 Subject: [PATCH] NOMAD_VAR_BIND_MOUNTS => NOMAD_VOLUMES --- hashiconf/index.html | 2 +- hashiconf/talk.htm | 4 ++-- hashitalks-2022/index.html | 2 +- hashitalks/index.html | 30 +++++++++--------------------- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/hashiconf/index.html b/hashiconf/index.html index 99fee97..c14bd3f 100644 --- a/hashiconf/index.html +++ b/hashiconf/index.html @@ -340,7 +340,6 @@ [project.nomad](https://gitlab.com/internetarchive/nomad/-/blob/master/project.nomad) ``` -NOMAD_VAR_BIND_MOUNTS NOMAD_VAR_CHECK_PROTOCOL NOMAD_VAR_COUNT NOMAD_VAR_CPU @@ -353,6 +352,7 @@ NOMAD_VAR_PORTS NOMAD_VAR_PV NOMAD_VAR_PV_DB +NOMAD_VOLUMES ```
Add any ☝🏽 to your `.gitlab-ci.yml`
diff --git a/hashiconf/talk.htm b/hashiconf/talk.htm index a612784..3998e14 100644 --- a/hashiconf/talk.htm +++ b/hashiconf/talk.htm @@ -954,7 +954,6 @@ [project.nomad](https://gitlab.com/internetarchive/nomad/-/blob/master/project.nomad) ``` -NOMAD_VAR_BIND_MOUNTS NOMAD_VAR_CHECK_PROTOCOL NOMAD_VAR_COUNT NOMAD_VAR_CPU @@ -967,6 +966,7 @@ NOMAD_VAR_PORTS NOMAD_VAR_PV NOMAD_VAR_PV_DB +NOMAD_VOLUMES ```
 
@@ -980,7 +980,6 @@
 [project.nomad](https://gitlab.com/internetarchive/nomad/-/blob/master/project.nomad)
 
 ```
-NOMAD_VAR_BIND_MOUNTS
 NOMAD_VAR_CHECK_PROTOCOL
 NOMAD_VAR_COUNT
 NOMAD_VAR_CPU
@@ -993,6 +992,7 @@
 NOMAD_VAR_PORTS
 NOMAD_VAR_PV
 NOMAD_VAR_PV_DB
+NOMAD_VOLUMES
 ```
 
Add any ☝🏽 to your `.gitlab-ci.yml`
diff --git a/hashitalks-2022/index.html b/hashitalks-2022/index.html index 5dc0ca9..4b5e6a3 100644 --- a/hashitalks-2022/index.html +++ b/hashitalks-2022/index.html @@ -393,7 +393,6 @@

🚀

[project.nomad](https://gitlab.com/internetarchive/nomad/-/blob/master/project.nomad) ``` -NOMAD_VAR_BIND_MOUNTS NOMAD_VAR_CHECK_PATH NOMAD_VAR_CHECK_PROTOCOL NOMAD_VAR_CHECK_TIMEOUT @@ -409,6 +408,7 @@

🚀

NOMAD_VAR_PORTS NOMAD_VAR_PV NOMAD_VAR_PV_DB +NOMAD_VOLUMES ```
Add any ☝🏽 to your `cicd.yml`
diff --git a/hashitalks/index.html b/hashitalks/index.html index 536ce22..0a597fe 100644 --- a/hashitalks/index.html +++ b/hashitalks/index.html @@ -528,12 +528,11 @@ default = ["group-project-branch-slug.example.com"] } -variable "BIND_MOUNTS" { - # Pass in a list of [host VM => container] direct pass through of readonly volumes, eg: - # NOMAD_VAR_BIND_MOUNTS='["/opt/something", "/tmp/beer"]' - # As of now you have to pass in 2 and only 2... 🤦‍♀️ +variable "VOLUMES" { + # Pass in a list of [host VM => container] direct pass through volumes, eg: + # NOMAD_VAR_VOLUMES='["/opt/something:/opt/something", "/var/work:/var/work:ro"]' type = list(string) - default = ["/usr/games", "/usr/local/games"] + default = [] } variable "PG" { @@ -677,25 +676,14 @@ ports = [for portnumber, portname in var.PORTS : portname] - volumes = [ - "/kv/${var.SLUG}:/kv" - ] + volumes = concat( + ["/kv/${var.SLUG}:/kv"], + var.VOLUMES + ) # The MEMORY var now becomes a **soft limit** # We will 10x that for a **hard limit** memory_hard_limit = "${var.MEMORY * 10}" - - mounts = [{ - type = "bind" - readonly = true - source = "${var.BIND_MOUNTS[0]}" - target = "${var.BIND_MOUNTS[0]}" - }, { - type = "bind" - readonly = true - source = "${var.BIND_MOUNTS[1]}" - target = "${var.BIND_MOUNTS[1]}" - }] } resources { @@ -983,7 +971,6 @@ Optional CI/CD variables to customize the `project.nomad`. Add one or more key/values to your `.gitlab-ci.yml`. ``` -NOMAD_VAR_BIND_MOUNTS NOMAD_VAR_CHECK_PROTOCOL NOMAD_VAR_COUNT NOMAD_VAR_CPU @@ -997,6 +984,7 @@ NOMAD_VAR_PORTS NOMAD_VAR_PV NOMAD_VAR_PV_DB +NOMAD_VOLUMES ``` ---