Commit Graph

1100 Commits

Author SHA1 Message Date
Chelsea Komlo
c42a07b488 Merge pull request #4328 from hashicorp/r-single-tls-config-constructor
Refactor to prefer using NewTLSConfiguration constructor
2018-05-24 13:46:29 -04:00
Alex Dadgar
58039325b0 Merge pull request #4321 from hashicorp/f-network-info
Display bind/advertise addresses on agent startup
2018-05-24 17:30:56 +00:00
Chelsea Holland Komlo
6733d768f0 refactor NewTLSConfiguration to pass in verifyIncoming/verifyOutgoing
add missing fields to TLS merge method
2018-05-23 18:35:30 -04:00
Alex Dadgar
796e623dde Use Tags when CanaryTags isn't specified
This PR fixes a bug where we weren't defaulting to `tags` when
`canary_tags` was empty and adds documentation.
2018-05-23 13:07:47 -07:00
Alex Dadgar
df70a934b2 Display bind/advertise addresses on agent startup
Sample outputs from demo/vagrant/(server/client1).hcl and `nomad agent -dev` mode

Server:

```
==> Nomad agent configuration:

       Advertise Addrs: HTTP: 192.168.1.75:4646; RPC: 192.168.1.75:4647; Serf: 192.168.1.75:4648
            Bind Addrs: HTTP: 0.0.0.0:4646; RPC: 0.0.0.0:4647; Serf: 0.0.0.0:4648
                Client: false
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: true
               Version: 0.8.4-dev
```

Client:

```
==> Nomad agent configuration:

       Advertise Addrs: HTTP: 192.168.1.75:5656
            Bind Addrs: HTTP: 0.0.0.0:5656
                Client: true
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: false
               Version: 0.8.4-dev
```

Dev:

```
==> Nomad agent configuration:

       Advertise Addrs: HTTP: 127.0.0.1:4646; RPC: 127.0.0.1:4647; Serf: 127.0.0.1:4648
            Bind Addrs: HTTP: 127.0.0.1:4646; RPC: 127.0.0.1:4647; Serf: 127.0.0.1:4648
                Client: true
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: true
               Version: 0.8.4-dev
```
2018-05-22 15:14:33 -07:00
Alex Dadgar
cc0a50b1b6 safety guard 2018-05-22 14:45:34 -07:00
Alex Dadgar
091e628b38 Unit test for dev agent 2018-05-22 14:45:34 -07:00
Alex Dadgar
598596c7f6 Do not bypass normal RPC codepath when running both client and server at once 2018-05-22 14:45:34 -07:00
Alex Dadgar
cfc9d1fbbd Register events 2018-05-22 14:06:33 -07:00
Preetha
447527ab2b Merge pull request #4274 from hashicorp/f-force-rescheduling
Add CLI and API support for forcing rescheduling of failed allocs
2018-05-21 16:24:22 -07:00
Preetha Appan
879c2c93c9 Code review feedback 2018-05-10 14:42:24 -05:00
Chelsea Holland Komlo
509180ee00 add support for configurable TLS minimum version 2018-05-09 18:07:12 -04:00
Chelsea Holland Komlo
0f46208cc1 allow configurable cipher suites
disallow 3DES and RC4 ciphers

add documentation for tls_cipher_suites
2018-05-09 17:15:31 -04:00
Preetha Appan
1bad719612 Added CLI for evaluating job given ID, and modified client API for evaluate to take a request payload 2018-05-09 15:04:27 -05:00
Preetha Appan
242cc191a1 Work in progress - force rescheduling of failed allocs 2018-05-08 17:26:57 -05:00
Preetha
0fdbdfd30b Merge pull request #4259 from hashicorp/f-deployment-improvements 2018-05-08 16:37:10 -05:00
Chelsea Holland Komlo
321b0779d5 only write error log line on error 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
496b5cce38 remove log line for empty addresses which could confuse on initalization 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
d00e096073 retry until all options are exhausted 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
9e78d227e5 ensure provider= is always the string prefix 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
f34d76a7ed update test for more realistic IP address from go-discover 2018-05-07 16:57:07 -04:00
Chelsea Holland Komlo
0d3c6a0441 comments and other fixups 2018-05-07 16:57:06 -04:00
Chelsea Holland Komlo
1e3bb6b21d add go-discover 2018-05-07 16:57:06 -04:00
Chelsea Holland Komlo
5b7027d9ec refactor to retryJoiner interface 2018-05-07 16:57:06 -04:00
Michael Schurter
435a6bddce consul: remove services with/without canary tags
Guard against Canary being set to false at the same time as an
allocation is being stopped: this could cause RemoveTask to be called
with the wrong Canary value and leaking a service.

Deleting both Canary values is the safest route.
2018-05-07 14:55:01 -05:00
Michael Schurter
17c6eb8629 consul: support canary tags for services
Also refactor Consul ServiceClient to take a struct instead of a massive
set of arguments. Meant updating a lot of code but it should be far
easier to extend in the future as you will only need to update a single
struct instead of every single call site.

Adds an e2e test for canary tags.
2018-05-07 14:55:01 -05:00
Alex Dadgar
20df5aea5b Canary tags structs 2018-05-07 14:50:01 -05:00
Alex Dadgar
15c3abf816 Initial implementation 2018-05-07 14:50:01 -05:00
Michael Schurter
bd4e761c29 Merge pull request #4251 from hashicorp/f-grpc-checks
Support Consul gRPC Health Checks
2018-05-04 14:55:16 -07:00
Michael Schurter
905bef8f2d consul: make grpc checks more like http checks 2018-05-04 11:08:11 -07:00
Michael Schurter
93356e7d70 consul: initial grpc implementation
Needs to be more like http.
2018-05-04 11:08:11 -07:00
Michael Schurter
6858c520b2 framer: fix early exit/truncation in framer 2018-05-02 10:46:16 -07:00
Michael Schurter
8776cf8a80 client: use a bytes.Reader for reading a []byte 2018-05-02 10:46:16 -07:00
Michael Schurter
63dad441b4 client: ensure cancel is always called when func exits 2018-05-02 10:46:16 -07:00
Michael Schurter
564854dd97 client: give pipe conns meaningful names 2018-05-02 10:46:16 -07:00
Michael Schurter
a7c71c1cdc client: reset encoders between uses
According to go/codec's docs, Reset(...) should be called on
Decoders/Encoders before reuse:

https://godoc.org/github.com/ugorji/go/codec

I could find no evidence that *not* calling Reset() caused bugs, but
might as well do what the docs say?
2018-05-02 10:46:16 -07:00
Alex Dadgar
9a4295aa9c generated files 2018-04-26 16:28:58 -07:00
Michael Schurter
972e861410 consul: periodically reconcile services/checks
Periodically sync services and checks from Nomad to Consul. This is
mostly useful when testing with the Consul dev agent which does not
persist state across restarts. However, this is a reasonable safety
measure to prevent skew between Consul's state and Nomad's
services+checks.

Also modernized the test suite a bit.
2018-04-19 15:45:42 -07:00
Nick Ethier
95d9eb9bf3 Merge pull request #4138 from hashicorp/i-hcl-json-endpoint
HCL to JSON api endpoint
2018-04-19 14:18:34 -04:00
Michael Schurter
29da24b77b test: build with mock_driver by default
`make release` and `make prerelease` set a `release` tag to disable
enabling the `mock_driver`
2018-04-18 14:45:33 -07:00
Nick Ethier
4303941098 command/agent: fix url in jobs parse ep test 2018-04-16 19:21:09 -04:00
Nick Ethier
c5945204a6 command/agent: fix ptr ref in job endpoint test 2018-04-16 19:21:09 -04:00
Nick Ethier
14c44da757 command/agent: add Canonicalize option to parse args 2018-04-16 19:21:09 -04:00
Nick Ethier
03f5c2f6f9 command/agent: add HCL mock for parse endpoint 2018-04-16 19:21:09 -04:00
Nick Ethier
b2b999249b command/agent: add /v1/jobs/parse endpoint
The parse endpoint accepts a hcl jobspec body within a json object
and returns the parsed json object for the job. This allows users to
register jobs with the nomad json api without specifically needing
a nomad binary to parse their hcl encoded jobspec file.
2018-04-16 19:21:06 -04:00
Alex Dadgar
8a80a5f7c5 Version bump and generated files 2018-04-12 16:21:50 -07:00
Preetha Appan
f8427c847d minor code review fix 2018-04-10 15:33:01 -05:00
Preetha Appan
ffb622fbfd Dev mode should never persist nodeid 2018-04-10 12:34:14 -05:00
Preetha Appan
1ba9feb3b7 Lint fixes 2018-04-10 11:22:16 -05:00
Preetha Appan
86ced8aef2 Use preconfigured nodeID if there isn't a persisted node ID, and persist it if its not persisted. 2018-04-10 08:47:33 -05:00