Commit Graph

21430 Commits

Author SHA1 Message Date
Nomad Release bot
21465a592d Generate files for 1.1.1 release 2021-06-10 08:04:25 -04:00
Mahmood Ali
d9024c3a8d prepare changelog for 1.1.1/1.0.7 release 2021-06-10 08:04:25 -04:00
Shishir Mahajan
b9668e87dc Update containerd task driver options.
- hostname
- auth

Signed-off-by: Shishir Mahajan <smahajan@roblox.com>
2021-06-10 08:03:49 -04:00
Mahmood Ali
122a4cb844 tests: use standard library testing.TB
Glint pulled in an updated version of mitchellh/go-testing-interface
which broke some existing tests because the update added a Parallel()
method to testing.T. This switches to the standard library testing.TB
which doesn't have a Parallel() method.
2021-06-09 16:18:45 -07:00
Isabel Suchanek
0edda116ad cli: add monitor flag to deployment status
Adding '-verbose' will print out the allocation information for the
deployment. This also changes the job run command so that it now blocks
until deployment is complete and adds timestamps to the output so that
it's more in line with the output of node drain.

This uses glint to print in place in running in a tty. Because glint
doesn't yet support cmd/powershell, Windows workflows use a different
library to print in place, which results in slightly different
formatting: 1) different margins, and 2) no spinner indicating
deployment in progress.
2021-06-09 16:18:45 -07:00
Mahmood Ali
66d590c64b golang: update to 1.16.5 (#10733)
1.16.5 contains some security fixes for zip that are notable to get: https://github.com/golang/go/issues?q=milestone%3AGo1.16.5+label%3ACherryPickApproved
2021-06-09 11:51:41 -04:00
Mike Wickett
a4714e1ff4 website: update alert banner (#10728) 2021-06-09 11:02:10 -04:00
Mahmood Ali
322617dfbe driver/docker: ignore cpuset errors for short-lived tasks follow up (#10730)
minor refactor and changelog
2021-06-09 11:00:39 -04:00
Seth Hoenig
0849b03f27 Merge pull request #10732 from hashicorp/docs-update-cl
docs: update cl
2021-06-09 09:57:20 -05:00
Seth Hoenig
0e7c20f0ca docs: update cl 2021-06-09 09:50:29 -05:00
Seth Hoenig
529b722d8d Merge pull request #10729 from hashicorp/f-cns-acl-check_cp-ent
consul: move consul acl tests into ent files
2021-06-09 09:45:13 -05:00
Mahmood Ali
646e8112bc Merge pull request #10416 from hashicorp/b-cores-docker
driver/docker: ignore error if container exists before cgroup can be written
2021-06-09 10:34:02 -04:00
Seth Hoenig
9883b95ae4 consul: move consul acl tests into ent files
(cherry-pick ent back to oss)

This PR moves a lot of Consul ACL token validation tests into ent files,
so that we can verify correct behavior difference between OSS and ENT
Nomad versions.
2021-06-09 08:38:42 -05:00
Michael Schurter
594ceb7022 docs: improve wait_for_index metrics description (#10717)
Old description of `{plan,worker}.wait_for_index` described the metric
in terms of waiting for a snapshot which has two problems:

1. "Snapshot" is an overloaded term in Nomad and operators can't be
   expected to know which use we're referring to here.
2. The most important thing about the metric is what we're waiting *on*
   before taking a snapshot: the raft index of the object to be
   processed (plan or eval).

The new description tries to cram all of that context into the tiny
space provided.

See #5791 for details about the `wait_for_index` mechanism in general.
2021-06-09 08:53:06 -04:00
Seth Hoenig
402b19c3b0 Merge pull request #10720 from hashicorp/f-cns-acl-check
consul: correctly check consul acl token namespace when using consul oss
2021-06-08 15:43:42 -05:00
Seth Hoenig
09c9a17a7f consul: correctly check consul acl token namespace when using consul oss
This PR fixes the Nomad Object Namespace <-> Consul ACL Token relationship
check when using Consul OSS (or Consul ENT without namespace support).

Nomad v1.1.0 introduced a regression where Nomad would fail the validation
when submitting Connect jobs and allow_unauthenticated set to true, with
Consul OSS - because it would do the namespace check against the Consul ACL
token assuming the "default" namespace, which does not work because Consul OSS
does not have namespaces.

Instead of making the bad assumption, expand the namespace check to handle
each special case explicitly.

Fixes #10718
2021-06-08 13:55:57 -05:00
Michael Schurter
f180cf0fa0 Merge pull request #10721 from hashicorp/b-icanthazip
e2e: use api.ipify.org
2021-06-08 09:45:04 -07:00
Tim Gross
f5c71526c1 docs: warn not to set network_mode for Connect-enabled Docker task 2021-06-08 10:14:15 -04:00
James Rasell
007b265674 Merge pull request #10723 from hashicorp/f-changelog-10712
chanagelog: add entry for #10712
2021-06-08 15:05:00 +02:00
James Rasell
bea3661882 chanagelog: add entry for #10712 2021-06-08 14:28:56 +02:00
Brandon Romano
6a532e508f Merge pull request #10679 from hashicorp/ks.website/updates-alert-banner
chore: updates alert-banner — hashiconf
2021-06-08 04:17:27 -07:00
Michael Schurter
57a79de929 e2e: use api.ipify.org
ipv4.icanhazip.com returns ipv6 addresses
2021-06-07 15:12:42 -07:00
Seth Hoenig
c37950f604 Merge pull request #10715 from hashicorp/f-cns-attrs
consul: probe consul namespace feature before using namespace api
2021-06-07 16:11:17 -05:00
Seth Hoenig
4b3ed53511 consul: pr cleanup namespace probe function signatures 2021-06-07 15:41:01 -05:00
Tim Gross
f77b8f218c changelog for backporting #10714 2021-06-07 15:46:15 -04:00
dependabot[bot]
b9e2daa72e build(deps): bump lodash from 4.17.20 to 4.17.21 in /website (#10716)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

---
updated-dependencies:
- dependency-name: lodash
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 15:01:01 -04:00
Kendall Strautman
87429b0086 Update website/data/alert-banner.js 2021-06-07 10:35:31 -07:00
Florian Apolloner
5f968baf0d Fixed global-search keyboard shortcut for non-english keyboard layouts.
Closes #10646
2021-06-07 13:32:38 -04:00
Seth Hoenig
0bc8a33084 consul: probe consul namespace feature before using namespace api
This PR changes Nomad's wrapper around the Consul NamespaceAPI so that
it will detect if the Consul Namespaces feature is enabled before making
a request to the Namespaces API. Namespaces are not enabled in Consul OSS,
and require a suitable license to be used with Consul ENT.

Previously Nomad would check for a 404 status code when makeing a request
to the Namespaces API to "detect" if Consul OSS was being used. This does
not work for Consul ENT with Namespaces disabled, which returns a 500.

Now we avoid requesting the namespace API altogether if Consul is detected
to be the OSS sku, or if the Namespaces feature is not licensed. Since
Consul can be upgraded from OSS to ENT, or a new license applied, we cache
the value for 1 minute, refreshing on demand if expired.

Fixes https://github.com/hashicorp/nomad-enterprise/issues/575

Note that the ticket originally describes using attributes from https://github.com/hashicorp/nomad/issues/10688.
This turns out not to be possible due to a chicken-egg situation between
bootstrapping the agent and setting up the consul client. Also fun: the
Consul fingerprinter creates its own Consul client, because there is no
[currently] no way to pass the agent's client through the fingerprint factory.
2021-06-07 12:19:25 -05:00
James Rasell
bb3a98e00a Merge pull request #10712 from hashicorp/b-gh-10711
cmd: validate the type flag when querying plugin status.
2021-06-07 18:14:20 +02:00
Mahmood Ali
a93da8b455 update changelog for GH-10710 (#10713)
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2021-06-07 10:27:53 -04:00
Mahmood Ali
3f7a5c1474 pool: track usage of incoming streams (#10710)
Track usage of incoming streams on a connection. Connections without
reference counts get marked as unused and reaped in a periodic job.

This fixes a bug where `alloc exec` and `alloc fs` sessions get terminated
unexpectedly. Previously, when a client heartbeats switches between
servers, the pool connection reaper eventually identifies the connection
as unused and closes it even if it has an active exec/fs sessions.

Fixes #10579
2021-06-07 10:22:37 -04:00
James Rasell
2d92e6f521 cmd: validate the type flag when querying plugin status. 2021-06-07 13:53:28 +02:00
Jasmine Dahilig
bdf2555b38 deployment query rate limit (#10706) 2021-06-04 12:38:46 -07:00
Mahmood Ali
7e19e27a0e Merge pull request #10704 from hashicorp/e2e-terraform-tweaks-20210604
e2e terraform tweaks: 2021-06 edition
2021-06-04 11:51:09 -04:00
Mahmood Ali
9c8f7624c9 remove unused Spark security group rules 2021-06-04 11:49:43 -04:00
Seth Hoenig
52e73c1506 Merge pull request #10658 from hashicorp/f-cc-mesh-gw
consul/connect: add support for connect mesh gateways
2021-06-04 09:50:08 -05:00
Mahmood Ali
f6d503ddd0 e2e: pass nomad_url variable 2021-06-04 10:32:51 -04:00
Seth Hoenig
67d801b821 consul/connect: fix tests for mesh gateway mode 2021-06-04 09:31:38 -05:00
Mahmood Ali
8d03f4ccbc e2e: NOMAD_VERSION is not set when installing url 2021-06-04 10:31:37 -04:00
Mahmood Ali
b73b136c2a restrict ingress ip 2021-06-04 10:31:35 -04:00
Seth Hoenig
1ad0212a34 consul/connect: use range on upstream canonicalize
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2021-06-04 08:55:05 -05:00
Seth Hoenig
37b49ba573 consul/connect: fix upstream mesh gateway default mode setting
This PR fixes the API to _not_ set the default mesh gateway mode. Before,
the mode would be set to "none" in Canonicalize, which is incorrect. We
should pass through the empty string so that folks can make use of Consul
service-defaults Config entries to configure the default mode.
2021-06-04 08:53:12 -05:00
Seth Hoenig
312161c5fc 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
Seth Hoenig
b0ac228ad0 Merge pull request #10702 from hashicorp/f-cc-constraints
consul/connect: use additional constraints in scheduling connect tasks
2021-06-04 08:11:21 -05:00
Tim Gross
9a8c68f6cd csi: accept list of caps during validation in volume register
When `nomad volume create` was introduced in Nomad 1.1.0, we changed the
volume spec to take a list of capabilities rather than a single capability, to
meet the requirements of the CSI spec. When a volume is registered via `nomad
volume register`, we should be using the same fields to validate the volume
with the controller plugin.
2021-06-04 07:57:26 -04:00
Seth Hoenig
c90471d770 consul/connect: use additional constraints in scheduling connect tasks
This PR adds two additional constraints on Connect sidecar and gateway tasks,
making sure Nomad schedules them only onto nodes where Connect is actually
enabled on the Consul agent.

Consul requires `connect.enabled = true` and `ports.grpc = <number>` to be
explicitly set on agent configuration before Connect APIs will work. Until
now, Nomad would only validate a minimum version of Consul, which would cause
confusion for users who try to run Connect tasks on nodes where Consul is not
yet sufficiently configured. These contstraints prevent job scheduling on nodes
where Connect is not actually use-able.

Closes #10700
2021-06-03 15:43:34 -05:00
Seth Hoenig
24e963f26c Merge pull request #10699 from hashicorp/f-consul-fp
fingerprint: update consul fingerprinter with additional attributes
2021-06-03 15:14:25 -05:00
Seth Hoenig
7c6c23dbf4 Merge branch 'main' into f-consul-fp 2021-06-03 15:14:02 -05:00
Seth Hoenig
b35fde468b Apply suggestions from code review
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2021-06-03 15:12:23 -05:00