Commit Graph

22535 Commits

Author SHA1 Message Date
Michael Schurter
62ea60d02f docs: add changelog for #11600 2022-02-18 16:16:19 -08:00
Michael Schurter
2411d3afd2 core: remove all traces of unused protocol version
Nomad inherited protocol version numbering configuration from Consul and
Serf, but unlike those projects Nomad has never used it. Nomad's
`protocol_version` has always been `1`.

While the code is effectively unused and therefore poses no runtime
risks to leave, I felt like removing it was best because:

1. Nomad's RPC subsystem has been able to evolve extensively without
   needing to increment the version number.
2. Nomad's HTTP API has evolved extensively without increment
   `API{Major,Minor}Version`. If we want to version the HTTP API in the
   future, I doubt this is the mechanism we would choose.
3. The presence of the `server.protocol_version` configuration
   parameter is confusing since `server.raft_protocol` *is* an important
   parameter for operators to consider. Even more confusing is that
   there is a distinct Serf protocol version which is included in `nomad
   server members` output under the heading `Protocol`. `raft_protocol`
   is the *only* protocol version relevant to Nomad developers and
   operators. The other protocol versions are either deadcode or have
   never changed (Serf).
4. If we were to need to version the RPC, HTTP API, or Serf protocols, I
   don't think these configuration parameters and variables are the best
   choice. If we come to that point we should choose a versioning scheme
   based on the use case and modern best practices -- not this 6+ year
   old dead code.
2022-02-18 16:12:36 -08:00
Adrián López
1ad08c2eed Update autoscaler AWS ASG target docs: AWS keypair can be empty (#11977) 2022-02-18 17:29:19 -05:00
James Rasell
36cc17024c docs: add autoscaler hcloud target plugin link. (#12087) 2022-02-18 17:28:38 -05:00
Michael Schurter
bdeea4b0db Merge pull request #11975 from hashicorp/f-connect-debugging
connect: write envoy bootstrap debugging info
2022-02-18 13:56:22 -08:00
Seth Hoenig
5138f00b4d Merge pull request #12011 from hashicorp/cc-use-proxyid
connect: bootstrap envoy using -proxy-id
2022-02-18 15:42:21 -06:00
Seth Hoenig
efee15f13f connect: bootstrap envoy using -proxy-id
This PR modifies the Consul CLI arguments used to bootstrap envoy for
Connect sidecars to make use of '-proxy-id' instead of '-sidecar-for'.

Nomad registers the sidecar service, so we know what ID it has. The
'-sidecar-for' was intended for use when you only know the name of the
service for which the sidecar is being created.

The improvement here is that using '-proxy-id' does not require an underlying
request for listing Consul services. This will make make the interaction
between Nomad and Consul more efficient.

Closes #10452
2022-02-18 14:58:23 -06:00
Michael Schurter
d47678074b connect: write envoy bootstrap debugging info
When Consul Connect just works, it's wonderful. When it doesn't work it
can be exceeding difficult to debug: operators have to check task
events, Nomad logs, Consul logs, Consul APIs, and even then critical
information is missing.

Using Consul to generate a bootstrap config for Envoy is notoriously
difficult. Nomad doesn't even log stderr, so operators are left trying
to piece together what went wrong.

This patch attempts to provide *maximal* context which unfortunately
includes secrets. **Secrets are always restricted to the secrets/
directory.** This makes debugging a little harder, but allows operators
to know exactly what operation Nomad was trying to perform.

What's added:

- stderr is sent to alloc/logs/envoy_bootstrap.stderr.0
- the CLI is written to secrets/.envoy_bootstrap.cmd
- the environment is written to secrets/.envoy_bootstrap.env as JSON

Accessing this information is unfortunately awkward:
```
nomad alloc exec -task connect-proxy-count-countdash b36a cat secrets/.envoy_bootstrap.env
nomad alloc exec -task connect-proxy-count-countdash b36a cat secrets/.envoy_bootstrap.cmd
nomad alloc fs b36a alloc/logs/envoy_bootstrap.stderr.0
```

The above assumes an alloc id that starts with `b36a` and a Connect
sidecar proxy for a service named `count-countdash`.

If the alloc is unable to start successfully, the debugging files are
only accessible from the host filesystem.
2022-02-18 12:02:36 -08:00
Seth Hoenig
dd4a3a9faa Merge pull request #12079 from hashicorp/deps-update-raft
deps: upgrade hashicorp/raft to v1.3.5
2022-02-18 10:03:21 -06:00
Seth Hoenig
49b97eb530 deps: upgrade hashicorp/raft to v1.3.5 2022-02-17 13:49:56 -06:00
Seth Hoenig
1c1ffe4e93 Merge pull request #12080 from hashicorp/b-fix-gobin-circle
build: BIN value must use single-path GOPATH value
2022-02-17 13:48:36 -06:00
Jai
cc3a7bf894 Merge pull request #12082 from hashicorp/f-ui/refactor-namespace
namespace refactoring
2022-02-17 11:04:36 -05:00
Seth Hoenig
6c7a934033 build: use single-path GOPATH set in makefile
When GOBIN is not set, BIN must be set to the single-path workaround
value of GOPATH, because Circle.
2022-02-17 09:26:13 -06:00
Michael Klein
02218c6c7c fix: linting issues and remove remainidn pauseTest 2022-02-17 16:06:49 +01:00
Michael Klein
a1b201312a fix: reflect namespace change volume-detail-test 2022-02-17 15:20:11 +01:00
Michael Klein
af6da28f7c fix: prettier related volume-list - test 2022-02-17 15:19:45 +01:00
Michael Klein
c475e375d0 fix: prettier related test-failutre task-group-detail 2022-02-17 15:19:20 +01:00
Michael Klein
6dae23bc17 fix: task-group-detail tests due to namespace changes
URLs have changed - tests need to reflect that.
2022-02-17 14:50:05 +01:00
Michael Klein
23f1cb54b4 fix: breadcrumbs allocations due to recent namespace changes
* change the breadcrumbs generation to use `idWithNamespace`
* adapt tests to reflect new URLs for jobs with namespaces
2022-02-17 14:38:27 +01:00
Michael Klein
550a5c01e8 fix: use @<namespace> with remaining JobDetail.visits 2022-02-17 13:22:15 +01:00
Michael Klein
221311da79 fix: pack-detail test
We need to change the way we access `JobDetail`-pages based on recent
namespace changes.
2022-02-17 12:59:58 +01:00
Michael Klein
dadbb0e16f fix: anonymous policy test job-details
We need to access job-details differently when they have a namespace
due to recent namespace changes - we need to make the tests reflect
that.
2022-02-17 12:45:01 +01:00
Michael Klein
31cbd77a7a fix: less cleverness™ when checking currentURL job-details
There is no need to check the namespace query-param anymore with
`urlWithNamespace` but some tests still are using this. We refactor
the tests to be less clever and check the URL in a more manual approach
by explicitly defining how the URL should look like if a job belongs
to a namespace.
2022-02-17 12:42:23 +01:00
Michael Klein
51775a04b2 fix: client-detail-test no default namespace param
Recent changes changed the behavior of not adding the `@default`
-namespace - we need to adapt the tests accordingly
2022-02-17 12:41:33 +01:00
Michael Klein
efbf42b36b fix: allocations page tests regarding job links
Default namespaced jobs don't append the `@default`-id anymore due
to recent `jobs.job#serialize` changes.
2022-02-17 11:56:29 +01:00
Luiz Aoqui
36e31c51cb initial base work for implementing sorting and filter across API endpoints (#12076) 2022-02-16 14:34:36 -05:00
Seth Hoenig
3ebfd7b414 Merge pull request #12077 from hashicorp/b-makefile-use-gobin
build: respect GOBIN when using make targets
2022-02-16 13:25:03 -06:00
Seth Hoenig
06613d652b build: respect GOBIN when using make targets
This PR updates GNUMakefile to respect $GOBIN if it is set in the
environment or via an $GOENV file. Previously we hard-coded the output
to $GOPATH/bin, which is not necessarily the desired behavior.
2022-02-16 12:05:55 -06:00
Michael Klein
a4244e63de fix: some test fixes module-for-job
* less clever™ metaprogramming when checking for expectedURL
* clicking slices job-client-status-summary needs to change its
  behavior and not pass the namespace query-param anymore.
2022-02-16 17:47:29 +01:00
Michael Klein
70f855e5da refact: don't pass namespace as query-param in job-subnav
The new ID handling gives us this behavior for free and we don't need
to drill the namespace down through all the route-layers anymore.
2022-02-16 17:44:16 +01:00
Michael Klein
4c38757436 refact: use idWithNamespace in serialize hook jobs.job
This will give us 'correct' URLs for free when we only pass a `job`-model
to a `LinkTo` that links to the `jobs.job.*`-routes.
2022-02-16 17:42:26 +01:00
Luiz Aoqui
fafb7cecce Add go-bexpr filters to evals and deployment list endpoints (#12034) 2022-02-16 11:40:30 -05:00
Michael Klein
5db6da4c59 fix: job-versions-test
We need to adapt the test due to recent namespace changes.
2022-02-16 15:31:10 +01:00
Michael Klein
6b142f8b0d fix: job-dispatch tests after namespace changes 2022-02-16 15:22:41 +01:00
Michael Klein
134fdf9682 feat: improve namespace handling job-route 2022-02-16 15:03:02 +01:00
Michael Klein
12339d718a refact: use idWithNamespace in job-row links 2022-02-16 15:02:39 +01:00
Michael Klein
87e49559f8 refact: render jobs.index template again 2022-02-16 15:02:06 +01:00
Michael Klein
498187b2da feat: add idWithNamespace-getter job model 2022-02-16 15:01:25 +01:00
Tiernan
1fabefd27e interpolate network.dns block on client (#12021) 2022-02-16 08:39:44 -05:00
Tim Gross
b775a73ded CSI: make gRPC client creation more robust (#12057)
Nomad communicates with CSI plugin tasks via gRPC. The plugin
supervisor hook uses this to ping the plugin for health checks which
it emits as task events. After the first successful health check the
plugin supervisor registers the plugin in the client's dynamic plugin
registry, which in turn creates a CSI plugin manager instance that has
its own gRPC client for fingerprinting the plugin and sending mount
requests.

If the plugin manager instance fails to connect to the plugin on its
first attempt, it exits. The plugin supervisor hook is unaware that
connection failed so long as its own pings continue to work. A
transient failure during plugin startup may mislead the plugin
supervisor hook into thinking the plugin is up (so there's no need to
restart the allocation) but no fingerprinter is started.

* Refactors the gRPC client to connect on first use. This provides the
  plugin manager instance the ability to retry the gRPC client
  connection until success.
* Add a 30s timeout to the plugin supervisor so that we don't poll
  forever waiting for a plugin that will never come back up.

Minor improvements:
* The plugin supervisor hook creates a new gRPC client for every probe
  and then throws it away. Instead, reuse the client as we do for the
  plugin manager.
* The gRPC client constructor has a 1 second timeout. Clarify that this
  timeout applies to the connection and not the rest of the client
  lifetime.
2022-02-15 16:57:29 -05:00
Seth Hoenig
07f4227d76 Merge pull request #12054 from hashicorp/b-creation-indexes
api: return sorted results in certain list endpoints
2022-02-15 15:08:38 -06:00
Seth Hoenig
b432f377cf api: return sorted results in certain list endpoints
These API endpoints now return results in chronological order. They
can return results in reverse chronological order by setting the
query parameter ascending=true.

- Eval.List
- Deployment.List
2022-02-15 13:48:28 -06:00
Seth Hoenig
53577ea398 Merge pull request #11955 from hashicorp/f-update-gopsutil
Update gopsutil to 3.21.12
2022-02-15 08:31:57 -06:00
Seth Hoenig
5ac59de999 cl: shorten changelog entry 2022-02-15 08:31:25 -06:00
Tim Gross
7c02750308 changelog entry (#12072) 2022-02-15 09:00:30 -05:00
Seth Hoenig
a56b79589a Merge pull request #12066 from hashicorp/f-make-golint-faster
build: allow golangci-lint to use more than 1 core
2022-02-15 08:00:07 -06:00
Alex Holyoake
11dcb87512 config: merge ReservableCores in clientConfig (#12044) 2022-02-15 08:36:37 -05:00
Seth Hoenig
34de8b5676 Merge pull request #12069 from alrs/scheduler-test-err
scheduler: fix dropped test error
2022-02-15 07:29:50 -06:00
Lars Lehtonen
f8d472a18c scheduler: fix dropped test error 2022-02-14 22:11:45 -08:00
Seth Hoenig
9ec605ea83 build: allow golangci-lint to use more than 1 core
Since switching to `golangci-lint` we have set the `-j 1` flag, which
restricts the tool to using 1 CPU thread.

This PR removes the flag so `make check` takes less time on good
computers.
2022-02-14 16:56:58 -06:00