aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/terraform/1n_nmd
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2020-12-04 08:44:21 +0000
committerpmikus <pmikus@cisco.com>2020-12-04 08:44:21 +0000
commit938d89a6d00a6bd4e2dd9ca870d0f1e62f144f93 (patch)
tree0ae0a30c2e0cc0da4dbb80586a410eaa301d04bd /resources/tools/terraform/1n_nmd
parent523c6e6e24101206ff1318ca17c310dff8b3c9d2 (diff)
Terraform: csit-shim refactor
- remove snergster image dependency Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I76fef60371e35dddc6da56db5f9207e003d1c792
Diffstat (limited to 'resources/tools/terraform/1n_nmd')
-rw-r--r--resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad17
-rw-r--r--resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim.nomad (renamed from resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim_amd.nomad)91
-rw-r--r--resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim_arm.nomad100
-rw-r--r--resources/tools/terraform/1n_nmd/prod_vpp_device/resources.tf9
4 files changed, 95 insertions, 122 deletions
diff --git a/resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad b/resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad
index 6c153ffd03..72d321d3b1 100644
--- a/resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad
+++ b/resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad
@@ -22,19 +22,19 @@ job "prod-nginx" {
# The "max_parallel" parameter specifies the maximum number of updates to
# perform in parallel. In this case, this specifies to update a single task
# at a time.
- max_parallel = 0
+ max_parallel = 0
# The "min_healthy_time" parameter specifies the minimum time the allocation
# must be in the healthy state before it is marked as healthy and unblocks
# further allocations from being updated.
- min_healthy_time = "10s"
+ min_healthy_time = "10s"
# The "healthy_deadline" parameter specifies the deadline in which the
# allocation must be marked as healthy after which the allocation is
# automatically transitioned to unhealthy. Transitioning to unhealthy will
# fail the deployment and potentially roll back the job if "auto_revert" is
# set to true.
- healthy_deadline = "3m"
+ healthy_deadline = "3m"
# The "progress_deadline" parameter specifies the deadline in which an
# allocation must be marked as healthy. The deadline begins when the first
@@ -47,7 +47,7 @@ job "prod-nginx" {
# The "auto_revert" parameter specifies if the job should auto-revert to the
# last stable job on deployment failure. A job is marked as stable if all the
# allocations as part of its deployment were marked healthy.
- auto_revert = false
+ auto_revert = false
# The "canary" parameter specifies that changes to the job that would result
# in destructive updates should create the specified number of canaries
@@ -58,9 +58,16 @@ job "prod-nginx" {
# Further, setting "canary" equal to the count of the task group allows
# blue/green deployments. When the job is updated, a full set of the new
# version is deployed and upon promotion the old version is stopped.
- canary = 0
+ canary = 0
}
+ reschedule {
+ delay = "2m"
+ delay_function = "constant"
+ unlimited = true
+ }
+
+
# The "group" stanza defines a series of tasks that should be co-located on
# the same Nomad client. Any task within a group will be placed on the same
# client.
diff --git a/resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim_amd.nomad b/resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim.nomad
index 1ba24696a4..328f503a0b 100644
--- a/resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim_amd.nomad
+++ b/resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim.nomad
@@ -1,4 +1,4 @@
-job "prod-csit-shim-amd" {
+job "prod-csit-shim" {
# The "region" parameter specifies the region in which to execute the job.
# If omitted, this inherits the default region name of "global".
# region = "global"
@@ -18,11 +18,6 @@ job "prod-csit-shim-amd" {
#
type = "system"
- constraint {
- attribute = "${node.class}"
- value = "csit"
- }
-
# The "group" stanza defines a series of tasks that should be co-located on
# the same Nomad client. Any task within a group will be placed on the same
# client.
@@ -32,11 +27,87 @@ job "prod-csit-shim-amd" {
#
# https://www.nomadproject.io/docs/job-specification/group.html
#
- group "prod-group1-csit-amd" {
+ group "prod-group1-csit-shim-amd" {
+ # The "count" parameter specifies the number of the task groups that should
+ # be running under this group. This value must be non-negative and defaults
+ # to 1.
+ count = 1
+
+ constraint {
+ attribute = "${node.class}"
+ value = "csit"
+ }
+
+ restart {
+ interval = "1m"
+ attempts = 3
+ delay = "15s"
+ mode = "delay"
+ }
+
+ # The "task" stanza creates an individual unit of work, such as a Docker
+ # container, web application, or batch processing.
+ #
+ # For more information and examples on the "task" stanza, please see
+ # the online documentation at:
+ #
+ # https://www.nomadproject.io/docs/job-specification/task.html
+ #
+ task "prod-task1-csit-shim-amd" {
+ # The "driver" parameter specifies the task driver that should be used to
+ # run the task.
+ driver = "docker"
+
+ # The "config" stanza specifies the driver configuration, which is passed
+ # directly to the driver to start the task. The details of configurations
+ # are specific to each driver, so please see specific driver
+ # documentation for more information.
+ config {
+ image = "csit_shim-ubuntu1804:local"
+ network_mode = "host"
+ pid_mode = "host"
+ volumes = [
+ "/var/run/docker.sock:/var/run/docker.sock"
+ ]
+ privileged = true
+ }
+
+ # The "resources" stanza describes the requirements a task needs to
+ # execute. Resource requirements include memory, network, cpu, and more.
+ # This ensures the task will execute on a machine that contains enough
+ # resource capacity.
+ #
+ # For more information and examples on the "resources" stanza, please see
+ # the online documentation at:
+ #
+ # https://www.nomadproject.io/docs/job-specification/resources.html
+ #
+ resources {
+ cpu = 100
+ memory = 128
+ network {
+ mbits = 10
+ port "ssh" {
+ static = 6022
+ }
+ port "ssh2" {
+ static = 6023
+ }
+ }
+ }
+ }
+ }
+
+ group "prod-group1-csit-shim-arm" {
# The "count" parameter specifies the number of the task groups that should
# be running under this group. This value must be non-negative and defaults
# to 1.
- count = 2
+ count = 1
+
+ constraint {
+ attribute = "${node.class}"
+ value = "csitarm"
+ }
restart {
interval = "1m"
@@ -53,7 +124,7 @@ job "prod-csit-shim-amd" {
#
# https://www.nomadproject.io/docs/job-specification/task.html
#
- task "prod-task1-csit-amd" {
+ task "prod-task1-csit-shim-arm" {
# The "driver" parameter specifies the task driver that should be used to
# run the task.
driver = "docker"
@@ -63,7 +134,7 @@ job "prod-csit-shim-amd" {
# are specific to each driver, so please see specific driver
# documentation for more information.
config {
- image = "snergster/csit-shim"
+ image = "csit_shim-ubuntu1804:local"
network_mode = "host"
pid_mode = "host"
volumes = [
diff --git a/resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim_arm.nomad b/resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim_arm.nomad
deleted file mode 100644
index ba7b656d37..0000000000
--- a/resources/tools/terraform/1n_nmd/prod_vpp_device/prod_csit_shim_arm.nomad
+++ /dev/null
@@ -1,100 +0,0 @@
-job "prod-csit-shim-arm" {
- # The "region" parameter specifies the region in which to execute the job.
- # If omitted, this inherits the default region name of "global".
- # region = "global"
- #
- # The "datacenters" parameter specifies the list of datacenters which should
- # be considered when placing this task. This must be provided.
- datacenters = [ "yul1" ]
-
- # The "type" parameter controls the type of job, which impacts the scheduler's
- # decision on placement. This configuration is optional and defaults to
- # "service". For a full list of job types and their differences, please see
- # the online documentation.
- #
- # For more information, please see the online documentation at:
- #
- # https://www.nomadproject.io/docs/jobspec/schedulers.html
- #
- type = "system"
-
- constraint {
- attribute = "${node.class}"
- value = "csitarm"
- }
-
- # The "group" stanza defines a series of tasks that should be co-located on
- # the same Nomad client. Any task within a group will be placed on the same
- # client.
- #
- # For more information and examples on the "group" stanza, please see
- # the online documentation at:
- #
- # https://www.nomadproject.io/docs/job-specification/group.html
- #
- group "prod-group1-csit-arm" {
- # The "count" parameter specifies the number of the task groups that should
- # be running under this group. This value must be non-negative and defaults
- # to 1.
- count = 2
-
- restart {
- interval = "1m"
- attempts = 3
- delay = "15s"
- mode = "delay"
- }
-
- # The "task" stanza creates an individual unit of work, such as a Docker
- # container, web application, or batch processing.
- #
- # For more information and examples on the "task" stanza, please see
- # the online documentation at:
- #
- # https://www.nomadproject.io/docs/job-specification/task.html
- #
- task "prod-task1-csit-arm" {
- # The "driver" parameter specifies the task driver that should be used to
- # run the task.
- driver = "docker"
-
- # The "config" stanza specifies the driver configuration, which is passed
- # directly to the driver to start the task. The details of configurations
- # are specific to each driver, so please see specific driver
- # documentation for more information.
- config {
- image = "snergster/csit-arm-shim"
- network_mode = "host"
- pid_mode = "host"
- volumes = [
- "/var/run/docker.sock:/var/run/docker.sock"
- ]
- privileged = true
- }
-
- # The "resources" stanza describes the requirements a task needs to
- # execute. Resource requirements include memory, network, cpu, and more.
- # This ensures the task will execute on a machine that contains enough
- # resource capacity.
- #
- # For more information and examples on the "resources" stanza, please see
- # the online documentation at:
- #
- # https://www.nomadproject.io/docs/job-specification/resources.html
- #
- resources {
- cpu = 100
- memory = 128
- network {
- mbits = 10
- port "ssh" {
- static = 6022
- }
- port "ssh2" {
- static = 6023
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/resources/tools/terraform/1n_nmd/prod_vpp_device/resources.tf b/resources/tools/terraform/1n_nmd/prod_vpp_device/resources.tf
index 8dc101c12a..dace9094f2 100644
--- a/resources/tools/terraform/1n_nmd/prod_vpp_device/resources.tf
+++ b/resources/tools/terraform/1n_nmd/prod_vpp_device/resources.tf
@@ -1,9 +1,4 @@
-resource "nomad_job" "prod_csit_shim_arm" {
+resource "nomad_job" "prod_csit_shim" {
provider = nomad
- jobspec = file("${path.module}/prod_csit_shim_arm.nomad")
-}
-
-resource "nomad_job" "prod_csit_shim_amd" {
- provider = nomad
- jobspec = file("${path.module}/prod_csit_shim_amd.nomad")
+ jobspec = file("${path.module}/prod_csit_shim.nomad")
} \ No newline at end of file