open-nomad/website/content/docs/job-specification
Seth Hoenig d026ff1f66 consul/connect: add support for connect mesh gateways
This PR implements first-class support for Nomad running Consul
Connect Mesh Gateways. Mesh gateways enable services in the Connect
mesh to make cross-DC connections via gateways, where each datacenter
may not have full node interconnectivity.

Consul docs with more information:
https://www.consul.io/docs/connect/gateways/mesh-gateway

The following group level service block can be used to establish
a Connect mesh gateway.

service {
  connect {
    gateway {
      mesh {
        // no configuration
      }
    }
  }
}

Services can make use of a mesh gateway by configuring so in their
upstream blocks, e.g.

service {
  connect {
    sidecar_service {
      proxy {
        upstreams {
          destination_name = "<service>"
          local_bind_port  = <port>
          datacenter       = "<datacenter>"
          mesh_gateway {
            mode = "<mode>"
          }
        }
      }
    }
  }
}

Typical use of a mesh gateway is to create a bridge between datacenters.
A mesh gateway should then be configured with a service port that is
mapped from a host_network configured on a WAN interface in Nomad agent
config, e.g.

client {
  host_network "public" {
    interface = "eth1"
  }
}

Create a port mapping in the group.network block for use by the mesh
gateway service from the public host_network, e.g.

network {
  mode = "bridge"
  port "mesh_wan" {
    host_network = "public"
  }
}

Use this port label for the service.port of the mesh gateway, e.g.

service {
  name = "mesh-gateway"
  port = "mesh_wan"
  connect {
    gateway {
      mesh {}
    }
  }
}

Currently Envoy is the only supported gateway implementation in Consul.
By default Nomad client will run the latest official Envoy docker image
supported by the local Consul agent. The Envoy task can be customized
by setting `meta.connect.gateway_image` in agent config or by setting
the `connect.sidecar_task` block.

Gateways require Consul 1.8.0+, enforced by the Nomad scheduler.

Closes #9446
2021-06-04 08:24:49 -05:00
..
hcl2 docs: fix jobspec hcl2 locals example. 2021-05-21 15:20:46 +02:00
affinity.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
artifact.mdx git example - suggest providing real repo 2021-05-03 08:12:10 -04:00
check_restart.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
connect.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
constraint.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
csi_plugin.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
device.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
dispatch_payload.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
env.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
ephemeral_disk.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
expose.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
gateway.mdx consul/connect: add support for connect mesh gateways 2021-06-04 08:24:49 -05:00
group.mdx docs: clarify that a default update strategy is used when update strategy is omitted 2021-05-10 08:27:22 -04:00
index.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
job.mdx docs: clarify that a default update strategy is used when update strategy is omitted 2021-05-10 08:27:22 -04:00
lifecycle.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
logs.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
meta.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
migrate.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
multiregion.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
network.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
parameterized.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
periodic.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
proxy.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
reschedule.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
resources.mdx add a section about memory oversubscription (#10573) 2021-05-13 13:35:51 -04:00
restart.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
scaling.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
service.mdx docs: clarify default check.initial_status behavior 2021-06-03 10:02:25 -04:00
sidecar_service.mdx documentation for disable_default_tcp_check 2021-05-07 13:16:39 -04:00
sidecar_task.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
spread.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
task.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
template.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
update.mdx docs: clarify that a default update strategy is used when update strategy is omitted 2021-05-10 08:27:22 -04:00
upstreams.mdx consul/connect: add support for connect mesh gateways 2021-06-04 08:24:49 -05:00
vault.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
volume.mdx docs: clean up explanation of volume per_alloc 2021-04-09 11:32:00 -04:00
volume_mount.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00