X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=terraform-ci-infra%2F1n_nmd%2Fnginx%2Fconf%2Fnomad%2Fnginx.hcl;fp=resources%2Ftools%2Fterraform%2F1n_nmd%2Fprod_storage%2Fprod-nginx.nomad;h=9cb5f8ef45e4eccc44f51902d4136d6f5b100975;hb=fd4d85865e145f12330a4266be48fbdd6e919cf4;hp=2af62a06c32fadcc6cfb37fc3ceeae2342a082d9;hpb=688a68a8f6d8a69a85cb76421a16dff9c4105c52;p=csit.git diff --git a/resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad b/terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl similarity index 75% rename from resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad rename to terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl index 2af62a06c3..9cb5f8ef45 100644 --- a/resources/tools/terraform/1n_nmd/prod_storage/prod-nginx.nomad +++ b/terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl @@ -1,11 +1,11 @@ -job "prod-nginx" { +job "${job_name}" { # 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" ] + datacenters = "${datacenters}" # The "type" parameter controls the type of job, which impacts the scheduler's # decision on placement. This configuration is optional and defaults to @@ -72,7 +72,6 @@ job "prod-nginx" { 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. @@ -97,32 +96,6 @@ job "prod-nginx" { mode = "fail" } - # All groups in this job should be scheduled on different hosts. - constraint { - operator = "distinct_hosts" - value = "false" - } - - # Prioritize one node. - affinity { - attribute = "${attr.unique.hostname}" - value = "s46-nomad" - weight = 100 - } - - # The volume stanza allows the group to specify that it requires a given - # volume from the cluster. - # - # For more information and examples on the "volume" stanza, please see - # the online documentation at: - # - # https://www.nomadproject.io/docs/job-specification/volume - volume "prod-volume1-storage" { - type = "host" - read_only = false - source = "prod-volume-data1-1" - } - # The "task" stanza creates an individual unit of work, such as a Docker # container, web application, or batch processing. # @@ -136,19 +109,13 @@ job "prod-nginx" { # run the task. driver = "docker" - volume_mount { - volume = "prod-volume1-storage" - destination = "/data/" - read_only = true - } - # 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 = "nginx:stable" - dns_servers = [ "${attr.unique.network.ip-address}" ] + dns_servers = [ "$${attr.unique.network.ip-address}" ] port_map { https = 443 } @@ -156,6 +123,7 @@ job "prod-nginx" { volumes = [ "/etc/consul.d/ssl/consul.pem:/etc/ssl/certs/nginx-cert.pem", "/etc/consul.d/ssl/consul-key.pem:/etc/ssl/private/nginx-key.pem", + "custom/upstream.conf:/etc/nginx/conf.d/upstream.conf", "custom/logs.conf:/etc/nginx/conf.d/logs.conf", "custom/docs.conf:/etc/nginx/conf.d/docs.conf" ] @@ -170,6 +138,17 @@ job "prod-nginx" { # # https://www.nomadproject.io/docs/job-specification/template.html # + template { + data = <