Commit Graph

1640 Commits

Author SHA1 Message Date
Mahmood Ali
abfae77545 Add tags option to datadog telemetry
Expose an global tags option in telemetry config for dogstatsd, for
purposes of distinguishing between multiple nomad cluster metrics.
2018-02-06 12:08:37 -05:00
Kyle Havlovitz
d5d719e5a0 Merge pull request #3812 from hashicorp/autopilot-config-change
Refactor redundancy_zone/upgrade_version out of client meta
2018-01-30 16:14:26 -08:00
Kyle Havlovitz
078c7d9aa9 Fix remaining issues with autopilot change 2018-01-30 15:21:28 -08:00
James Rasell
0a13199471 Update CLI to use ISO_8601 time format.
This change updates the formatTime CLI helper function to return
an ISO_8601 time format which will make CLI time usage more
consistent and easier. Previosuly the time format was in US style
format which was somewhat confusing to non US users.

Closes #3806
2018-01-30 08:57:07 +00:00
Kyle Havlovitz
2c873adba4 Refactor redundancy_zone/upgrade_version out of client meta 2018-01-29 20:03:38 -08:00
Alex Dadgar
bb5120fe98 Merge pull request #3684 from jrasell/f_gh_3678
Update `node-status` verbose command to include node address.
2018-01-29 15:32:14 -08:00
Chelsea Komlo
9d006ecd0d Merge pull request #3492 from hashicorp/f-client-tls-reload
Client/Server TLS dynamic reload
2018-01-23 05:51:32 -05:00
Michael Schurter
6e96c81028 Merge pull request #3682 from hashicorp/b-3681-always-set-driver-ip
Always advertise driver IP when in driver mode
2018-01-22 16:41:34 -08:00
Chelsea Holland Komlo
517030157e swap raft layer tls wrapper 2018-01-19 17:00:15 -05:00
Kyle Havlovitz
0dab89f9ac Merge pull request #3670 from hashicorp/autopilot
Add Autopilot feature from Consul
2018-01-19 12:52:56 -08:00
Michael Schurter
7ae2291572 Improve invalid port error message for services
Related to #3681

If a user specifies an invalid port *label* when using
address_mode=driver they'll get an error message about the label being
an invalid number which is very confusing.

I also added a bunch of testing around Service.AddressMode validation
since I was concerned by the linked issue that there were cases I was
missing. Unfortunately when address_mode=driver is used there's only so
much validation that can be done as structs/structs.go validation never
peeks into the driver config which would be needed to verify the port
labels/map.
2018-01-18 15:35:24 -08:00
Michael Schurter
e0a3687faa Fix test 2018-01-18 15:35:24 -08:00
Michael Schurter
cde796162c Always advertise driver IP when in driver mode
Fixes #3681

When in drive address mode Nomad should always advertise the driver's IP
in Consul even when no network exists. This matches the 0.6 behavior.

When in host address mode Nomad advertises the alloc's network's IP if
one exists. Otherwise it lets Consul determine the IP.

I also added some much needed logging around Docker's network discovery.
2018-01-18 15:35:24 -08:00
Kyle Havlovitz
4962c8bd26 Formatting/test adjustments 2018-01-18 15:03:35 -08:00
Kyle Havlovitz
4e9735d69f Merge branch 'master' into autopilot 2018-01-18 13:29:25 -08:00
Michael Schurter
94e6b9cff6 Make example service name make sense
Switch from global-redis-check for the example job's service name to
redis-cache. The former name is really confusing and someone finally
called us out on it:

https://groups.google.com/d/msg/nomad-tool/3RTh6CyYkWk/vEe_Sj7lAAAJ

Also specifically mention that the `service.name` parameter is what is
advertised in Consul.
2018-01-17 14:08:30 -08:00
Chelsea Holland Komlo
0805c41196 fixing up raft reload tests
close second goroutine in raft-net
2018-01-17 10:29:15 -05:00
Kyle Havlovitz
46254e1a38 Fix comments/text referring to consul 2018-01-17 00:20:13 -08:00
Michael Schurter
96e00a57eb Merge pull request #3718 from hashicorp/b-3713-fix-check-restart
Fix service.check_restart stanza propagation
2018-01-16 16:39:42 -08:00
Kyle Havlovitz
254458703b Add raft remove by id endpoint/command 2018-01-16 13:35:32 -08:00
Chelsea Holland Komlo
bbc56860ac adding additional test assertions; differentiate reloading agent and http server 2018-01-16 07:34:39 -05:00
Alex Dadgar
4c56501aa3 Test listener uses freeport instead of static ports 2018-01-12 15:10:26 -08:00
Michael Schurter
ae61f7308d Fix HTTP code for permission denied errors
Fixes #3697

The existing code and test case only covered the leader behavior. When
querying against non-leaders the error has an "rpc error: " prefix.

To provide consistency in HTTP error response I also strip the "rpc
error: " prefix for 403 responses as they offer no beneficial additional
information (and in theory disclose a tiny bit of data to unauthorized
users, but it would be a pretty weird bit of data to use in a malicious
way).
2018-01-09 15:25:53 -08:00
Michael Schurter
304a037e39 Fix service.check_restart stanza propagation
There was a bug in jobspec parsing, a bug in CheckRestart merging, and a
bug in CheckRestart canonicalization. All are now tested.
2018-01-09 15:15:36 -08:00
Chelsea Holland Komlo
11089b23ce reload raft transport layer
fix up linting
2018-01-08 14:52:28 -05:00
Chelsea Holland Komlo
c70702e802 call reload on agent, client, and server separately 2018-01-08 09:56:31 -05:00
Chelsea Holland Komlo
a4af400fd1 don't ignore error in http reloading
code review feedback
2018-01-08 09:21:06 -05:00
Chelsea Holland Komlo
359358d240 code review fixups 2018-01-08 09:21:06 -05:00
Chelsea Holland Komlo
184fbfe5bd prevent races when reloading, fully shut down raft 2018-01-08 09:21:06 -05:00
Chelsea Holland Komlo
d4754d541b fixups from code review
Revert "close raft long-lived connections"

This reverts commit 3ffda28206fcb3d63ad117fd1d27ae6f832b6625.

reload raft connections on changing tls
2018-01-08 09:21:06 -05:00
Chelsea Holland Komlo
7b749579a2 add ability to upgrade/downgrade nomad agents tls configurations via sighup 2018-01-08 09:21:06 -05:00
Preetha
781408bbf4 Merge branch 'master' into 0.8 2018-01-03 16:06:38 -06:00
James Rasell
3868e88518 Update node-status verbose command to include node address.
This change updates the `nomad node-status -verbose` command to
also include the addreess of the node. This is helpful for cluster
administrators to quickly discover information and access nodes
when required.
2017-12-21 08:58:35 +00:00
Alex Dadgar
742107aa2b bump version and remove generated structs 2017-12-19 17:10:52 -08:00
Alex Dadgar
0b295d399d generated files 2017-12-19 16:57:34 -08:00
Michael Schurter
a4449c84d7 Services should not require a port
Fixes #3673
2017-12-19 15:50:23 -08:00
Kyle Havlovitz
c2d0c11f9e Add autopilot functionality based on Consul's autopilot 2017-12-18 14:29:41 -08:00
Kyle Havlovitz
de90db139a Added support for v2 raft APIs and -raft-protocol option 2017-12-12 10:17:16 -06:00
Alex Dadgar
fcc00ca9f0 remove generated structs 2017-12-11 17:51:41 -08:00
Alex Dadgar
b81a2b64e6 generated assets 2017-12-11 17:30:37 -08:00
Michael Schurter
518261bb9c Merge pull request #3650 from hashicorp/b-lowercase-agent-service-id
Use the Service.Hash() method in agent service ids
2017-12-11 17:12:52 -08:00
Michael Schurter
d0a1ca7ee8 Use the Service.Hash() method in agent service ids
The allocID and taskName parameters are useless for agents, but it's
still nice to reuse the same hash method for agent and task services.
This brings in the lowercase mode for the agent hash as well.
2017-12-11 16:50:15 -08:00
Alex Dadgar
33e71bdce4 Update job_status.go 2017-12-11 16:14:03 -08:00
Alex Dadgar
6731558870 Node Status output includes new modify time 2017-12-11 16:08:25 -08:00
Alex Dadgar
ddee932500 Fix upgrade path of modify time 2017-12-11 15:58:24 -08:00
Michael Schurter
6f124eba7d Be more defensive in port checks 2017-12-08 12:27:57 -08:00
Michael Schurter
afd5bca566 Move service hash logic to Service.Hash method 2017-12-08 12:03:43 -08:00
Michael Schurter
65bfbe54c8 Hash fields used in task service IDs
Fixes #3620

Previously we concatenated tags into task service IDs. This could break
deregistration of tag names that contained double //s like some Fabio
tags.

This change breaks service ID backward compatibility so on upgrade all
users services and checks will be removed and re-added with new IDs.

This change has the side effect of including all service fields in the
ID's hash, so we no longer have to track PortLabel and AddressMode
changes independently.
2017-12-08 12:03:43 -08:00
Michael Schurter
fa5faa5a09 Prevent using port 0 with address_mode=driver 2017-12-08 12:03:43 -08:00
Michael Schurter
b999358892 Validate port label for host address mode
Also skip getting an address for script checks which don't use them.

Fixed a weird invalid reserved port in a TaskRunner test helper as well
as a problem with our mock Alloc/Job. Hopefully the latter doesn't cause
other tests to fail, but we were referencing an invalid PortLabel and
just not catching it before.
2017-12-08 12:03:43 -08:00