Michael Schurter
cc13e733ac
cli: expand drain info for node status
2018-05-04 10:32:25 -07:00
Nick Ethier
8d73d90cd7
command: remove all comments from short init jobspec
2018-05-03 15:34:56 -04:00
Michael Schurter
526af6a246
framer: fix early exit/truncation in framer
2018-05-02 10:46:16 -07:00
Michael Schurter
5d6bf2938f
client: use a bytes.Reader for reading a []byte
2018-05-02 10:46:16 -07:00
Michael Schurter
e00e265da5
client: ensure cancel is always called when func exits
2018-05-02 10:46:16 -07:00
Michael Schurter
d21b749c68
client: give pipe conns meaningful names
2018-05-02 10:46:16 -07:00
Michael Schurter
5ef0a82e6e
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
Nick Ethier
842ed14e3f
command: add '-short' flag to init command that emits minimal jobspec
2018-05-01 12:51:13 -04:00
Alex Dadgar
43192cefae
generated files
2018-04-26 16:28:58 -07:00
Alex Dadgar
15ad3f94af
Fix command line
2018-04-26 15:46:22 -07:00
James Rasell
b7c2ce2991
Update node-drain logging message to clearer for operators.
...
This change updates the console log message when performing a node
drain and particulary when a node has marked all allocs for
migration. Previously it logged 'drain complete' which was a little
confusing to operators as the node is not drained at this point.
Closes #4183
2018-04-24 07:50:01 +01:00
Michael Schurter
ec201d5f19
Merge pull request #4178 from hashicorp/f-sort-drivers
...
cli: sort drivers in `node status <node_id>`
2018-04-20 14:03:26 -07:00
Michael Schurter
cfcbb9fa21
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
2e6c95f511
Merge pull request #4138 from hashicorp/i-hcl-json-endpoint
...
HCL to JSON api endpoint
2018-04-19 14:18:34 -04:00
Nick Ethier
c67c4f2d6e
Merge pull request #4176 from hashicorp/i-cli-error-help
...
Improve help text when invalid arguments are given
2018-04-19 12:45:22 -04:00
Nick Ethier
50bab2dd83
command: fix job dispatch arg check
2018-04-18 21:21:43 -04:00
Michael Schurter
d3650fb2cd
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
Michael Schurter
8ece6b7163
cli: sort drivers in node status <node_id>
2018-04-18 14:30:44 -07:00
Nick Ethier
d0326503ac
command: use ':' instead of ',' in error msg
2018-04-18 13:55:51 -04:00
Nick Ethier
bde560a863
command: update tests to check for new error message
2018-04-18 13:51:17 -04:00
Nick Ethier
71fd07d4d0
command: fix misspelling in comment
2018-04-18 12:19:53 -04:00
Nick Ethier
182e3bec1b
command: improve help text when invalid arguments are given
2018-04-18 12:02:11 -04:00
Nick Ethier
555b036369
command/agent: fix url in jobs parse ep test
2018-04-16 19:21:09 -04:00
Nick Ethier
0baf9ba385
command/agent: fix ptr ref in job endpoint test
2018-04-16 19:21:09 -04:00
Nick Ethier
de4176606d
command/agent: add Canonicalize option to parse args
2018-04-16 19:21:09 -04:00
Nick Ethier
31da01856a
command/agent: add HCL mock for parse endpoint
2018-04-16 19:21:09 -04:00
Nick Ethier
f2db03e56c
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
663c4d0433
Version bump and generated files
2018-04-12 16:21:50 -07:00
Alex Dadgar
73bf52f203
Non-verbose driver formatting and don't display non-detected
2018-04-12 11:26:00 -07:00
Preetha Appan
4f9a52e4a4
Add link to autopilot guide in operator autopilot CLI help text
2018-04-12 09:02:32 -05:00
Preetha
eeb065cb21
Merge pull request #4136 from hashicorp/f-eval-status-show-waituntil
...
Show wait until value in eval status if it is set
2018-04-11 14:49:29 -05:00
Preetha Appan
affaa12260
Show wait until value in eval status if it is set
2018-04-11 14:01:42 -05:00
Preetha
c88fef4c4b
Merge pull request #4127 from hashicorp/b-autopilot-removepeer-fixes
...
Add node id persistence
2018-04-10 16:05:00 -05:00
Preetha Appan
f04c9d2b19
minor code review fix
2018-04-10 15:33:01 -05:00
Preetha Appan
6b6e97e50c
Dev mode should never persist nodeid
2018-04-10 12:34:14 -05:00
Preetha Appan
e1c3c7ab6c
Lint fixes
2018-04-10 11:22:16 -05:00
Preetha Appan
6d0e1c9fea
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
Alex Dadgar
d179a09b83
WIP: Not setting node id properlperly
2018-04-09 18:01:28 -07:00
Michael Schurter
efb9a02430
cli: remove outdated hints
...
Hints no longer apply in the 0.8 Node RPC world.
2018-04-09 12:09:47 -07:00
Chelsea Holland Komlo
7043595b67
correctly initialize array length
2018-04-09 10:51:08 -04:00
Alex Dadgar
9ab32ab7e6
Fix eval status output for alloc failure
2018-04-06 17:16:43 -07:00
Chelsea Komlo
d0361ee428
Merge pull request #4098 from hashicorp/f-driver-health-ux-improvements
...
Driver health UX improvements
2018-04-05 18:51:00 -04:00
Chelsea Holland Komlo
fda8fd81bb
remove stray comma
2018-04-05 18:20:52 -04:00
Chelsea Holland Komlo
59416f6416
Display truncated driver list in non-verbose mode
...
separate drivers by commas
2018-04-05 14:25:59 -04:00
Alex Dadgar
235a61cdd3
fix flaky pretty time test
2018-04-03 18:15:12 -07:00
Chelsea Holland Komlo
ad4a11f3b4
display driver status only in verbose mode or if the driver is unhealthy
2018-04-03 11:23:12 -04:00
Michael Schurter
3495df7da9
Merge pull request #4085 from hashicorp/docs-node-drain
...
Initial Node drain docs
2018-03-30 16:34:49 -07:00
Alex Dadgar
6871a068cb
Fix prefix output of agent metadata
2018-03-30 16:27:18 -07:00
Michael Schurter
ac8969ea38
docs: add migrate to example.nomad
2018-03-30 16:18:46 -07:00
Alex Dadgar
af81349dbe
Generated files
2018-03-30 16:14:40 -07:00
Michael Schurter
8e7870b590
cli: remove info color on monitored output
2018-03-30 15:51:48 -07:00
Michael Schurter
6b94029740
Merge pull request #4084 from hashicorp/f-drain-timestamps
...
drain: add timestamps to cli output
2018-03-30 15:07:43 -07:00
Michael Schurter
b5aa71a517
cli: fix drain monitoring formating
2018-03-30 14:20:30 -07:00
Michael Schurter
7199a2b960
cli: differentiate normal output vs info
2018-03-30 11:42:11 -07:00
Michael Schurter
0260bda046
cli: add color to drain output
2018-03-30 11:15:12 -07:00
Alex Dadgar
886f7feaef
Generic handling of server region errors
2018-03-30 10:57:32 -07:00
Michael Schurter
88d0cdbb72
drain: add timestamps to cli output
...
Also toggle eligibility output based on value
2018-03-30 10:26:43 -07:00
Chelsea Komlo
2e3cb28cc5
Merge pull request #4013 from hashicorp/node-events-documentation
...
Add node events to documentation
2018-03-29 17:16:26 -04:00
Michael Schurter
ee3eddbac3
drain: block cli until all allocs stop
...
Before the drain CLI would block until the node was marked as completing
drain operations. While technically correct, it could lead operators (or
more likely: scripts) to shutdown drained nodes before all of its
allocations had *actually* terminated.
This change makes the CLI block until all allocations have terminated
(unless ignoring system jobs).
2018-03-29 10:56:09 -07:00
Chelsea Holland Komlo
48765d334c
add further driver info; driver name with subsystem
2018-03-29 13:34:30 -04:00
Chelsea Holland Komlo
baeadae990
Revert "omit driver key/val from details"
...
This reverts commit 74fc5543babc85e3fa16c048bce92e71826e53cc.
2018-03-29 12:49:46 -04:00
Chelsea Holland Komlo
a17f0d8875
omit driver key/val from details
2018-03-29 12:30:12 -04:00
Chelsea Komlo
607e631714
Merge pull request #4046 from hashicorp/tls-same-file-reload
...
Check file contents when determining if agent should reload TLS confi…
2018-03-29 10:51:32 -04:00
Chelsea Holland Komlo
be15c07110
make check fix
2018-03-28 19:11:51 -04:00
Chelsea Holland Komlo
58ada9bc42
return error when setting checksum; don't reload
2018-03-28 18:15:50 -04:00
Chelsea Holland Komlo
38c7a38549
output warning for error in creating TLS checksum
2018-03-28 17:44:23 -04:00
Chelsea Komlo
7812ac5abf
Merge pull request #4057 from hashicorp/specify-docker-msg
...
Specify docker name in driver health messages
2018-03-28 13:32:36 -04:00
Chelsea Holland Komlo
770ac13bc4
check for nil, remove unnecessary set checksum call
2018-03-28 13:29:53 -04:00
Preetha
177d2d6010
Merge pull request #4052 from hashicorp/f-specify-total-memory
...
Allow to specify total memory on agent configuration
2018-03-28 12:28:41 -05:00
Chelsea Holland Komlo
d3d686b58a
fix up test for file content changes
2018-03-28 13:18:13 -04:00
Preetha Appan
5c2fc6d46b
Fix compilation fail in test after rebase
2018-03-28 11:54:34 -05:00
Chelsea Holland Komlo
263544bf52
reformat message
2018-03-28 12:28:16 -04:00
Chelsea Holland Komlo
efc03e252c
specify driver health messages
2018-03-28 11:35:21 -04:00
Chelsea Holland Komlo
2d5af7ff4d
set TLS checksum when parsing config
...
Refactor checksum comparison, always set checksum if it is empty
2018-03-28 09:56:11 -04:00
Michael Schurter
79a2781585
Merge pull request #4053 from hashicorp/b-drain-sys-jobs-2
...
drain: fix draining of system jobs
2018-03-27 16:26:45 -07:00
Alex Dadgar
de4b3772f1
Create evals for system jobs when drain is unset
...
This PR creates evals for system jobs when:
* Drain is unset and mark eligible is true
* Eligibility is restored to the node
2018-03-27 15:53:24 -07:00
Michael Schurter
559dae984f
drain: give cli more time before exiting
...
May want to bump this a bit more as the drain often completes amidst a
flurry of alloc updates.
2018-03-27 14:24:02 -07:00
Mildred Ki'Lya
1017cbe8ab
Allow to specify total memory on agent configuration
...
Allow to set the total memory of an agent in its configuration file. This
can be used in case the automatic detection doesn't work or in specific
environments when memory overcommit (using swap for example) can be
desirable.
2018-03-27 15:46:18 -05:00
Chelsea Holland Komlo
003bc209b9
use time.Time for node events for compatibility
2018-03-27 15:43:57 -04:00
Chelsea Holland Komlo
ee96bbbe1d
properly formatting unix timestamps
2018-03-27 15:43:57 -04:00
Chelsea Holland Komlo
6e6d6b7e33
check file contents when determining if agent should reload TLS configuration
2018-03-27 15:42:20 -04:00
Alex Dadgar
432784dae3
Fix alloc watcher snapshot streaming
2018-03-27 11:14:53 -07:00
Chelsea Komlo
57e2cd04bd
Merge pull request #4025 from hashicorp/reload-http-tls
...
Allow TLS configurations for HTTP and RPC connections to be reloaded …
2018-03-26 18:00:30 -04:00
Preetha Appan
33e170c15d
s/linear/constant/g
2018-03-26 14:45:09 -05:00
Chelsea Holland Komlo
96df419fff
code review feedback
2018-03-26 10:55:22 -04:00
Alex Dadgar
98d3e8a1a7
sort driver output
2018-03-23 10:59:18 -07:00
Alex Dadgar
da27fc3880
Driver Info output
2018-03-22 17:18:32 -07:00
Alex Dadgar
65b3548219
Fix spelling error
2018-03-22 15:18:09 -07:00
Alex Dadgar
a0195d8d41
remove comment
2018-03-22 14:49:08 -07:00
Alex Dadgar
7192498ea9
Merge pull request #4027 from hashicorp/f-common
...
New Command Line Groupings
2018-03-22 13:57:37 -07:00
Alex Dadgar
34211f00a7
Allow separate enterprise config overlay
2018-03-22 13:53:08 -07:00
Alex Dadgar
17fc9a6283
Fix old references
2018-03-22 13:39:18 -07:00
Alex Dadgar
ee463f1a28
Grouped commands help description
2018-03-21 20:27:32 -07:00
Alex Dadgar
742382146e
color
2018-03-21 20:27:32 -07:00
Alex Dadgar
aa85b61fc8
Deprecated commands
2018-03-21 20:27:32 -07:00
Alex Dadgar
de08c1891a
aliases
2018-03-21 20:27:32 -07:00
Alex Dadgar
d2af5d22e4
rename files
2018-03-21 20:27:32 -07:00
Alex Dadgar
6faa136e03
common commands
2018-03-21 20:27:32 -07:00
Alex Dadgar
b5bee9e06b
use subcommands
2018-03-21 20:27:32 -07:00
Michael Schurter
0e0b04afec
test: fix by using mock.BatchJob
2018-03-21 16:51:45 -07:00
Michael Schurter
39cef16c73
test: don't call t.Fatal from within a goroutine
2018-03-21 16:51:45 -07:00
Michael Schurter
cb61a4bdc7
Fix linting errors
2018-03-21 16:51:45 -07:00
Michael Schurter
be7c759867
Improve drain log messages
...
Also delay "node complete" after the node has been marked complete to
capture a few more alloc events. There are other ways to implement this
that could trade off correctness for responsiveness as technically a
node is considered drained when all of its allocs have been marked to
stop and not when they've actually stopped (which may not happen for a
long time).
2018-03-21 16:51:45 -07:00
Michael Schurter
5eebd53223
Monitor node drains until completion in CLI
...
allow -detach like other commands
2018-03-21 16:51:45 -07:00
Michael Schurter
3907766b6d
Fix node eligibility test
2018-03-21 16:51:45 -07:00
Alex Dadgar
7b2bad8c5e
Toggle Drain allows resetting eligibility
...
This PR allows marking a node as eligible for scheduling while toggling
drain. By default the `nomad node drain -disable` commmand will mark it
as eligible but the drainer will maintain in-eligibility.
2018-03-21 16:51:44 -07:00
Alex Dadgar
02019f216a
Correct defaulting
2018-03-21 16:51:44 -07:00
Alex Dadgar
78c7c36e65
code review
2018-03-21 16:51:44 -07:00
Alex Dadgar
ac4975cef4
Small refactor and cleanups
2018-03-21 16:51:44 -07:00
Alex Dadgar
d47c68f764
Add eligibility to node view
2018-03-21 16:51:44 -07:00
Alex Dadgar
c0f808205e
node eligibility command
2018-03-21 16:51:44 -07:00
Alex Dadgar
8289cc3c6f
HTTP and API
2018-03-21 16:51:44 -07:00
Alex Dadgar
f44fbac66a
flag comment
2018-03-21 16:51:44 -07:00
Alex Dadgar
b3d2346419
Upgrade path
2018-03-21 16:51:43 -07:00
Alex Dadgar
010228577e
Drain cli, api, http
2018-03-21 16:51:43 -07:00
Chelsea Holland Komlo
66e44cdb73
Allow TLS configurations for HTTP and RPC connections to be reloaded separately
2018-03-21 17:51:08 -04:00
Preetha
01898b2c25
Merge pull request #4007 from hashicorp/f-show-rescheduling-cli-job-status
...
Show a section on upcoming delayed evaluations when applicable
2018-03-21 14:37:38 -05:00
Preetha Appan
ba217e5224
More code review feedback
2018-03-21 14:28:14 -05:00
Preetha Appan
496ff26d32
Fix test
2018-03-21 09:24:28 -05:00
Preetha Appan
26b6e70d13
Addressed code review feedback
2018-03-21 09:15:29 -05:00
Michael Schurter
70c370c6fe
Merge pull request #4003 from jrasell/f_gh_3988
...
Allow Nomads Consul health check names to be configurable.
2018-03-20 16:44:08 -07:00
Preetha Appan
30fff15de7
Show reschedule policy in addition to when the eval will get rescheduled
2018-03-20 13:34:29 -05:00
James Rasell
121c3bc997
Update Consul check params from using health-check to check.
2018-03-20 16:03:58 +01:00
Preetha Appan
ec13089be9
Unit test and linting fix
2018-03-19 22:11:07 -05:00
Preetha Appan
31a3c81c3b
Show a section on upcoming delayed evaluations when applicable
2018-03-19 21:42:37 -05:00
Preetha
5cbcd6f8a2
Merge pull request #4006 from hashicorp/b-alloc-status-cli-hide-unlimited-attempts
...
Hide the number of reschedule attempts for unlimited rescheduling
2018-03-19 18:25:20 -05:00
Preetha Appan
96b49cb491
Hide the number of reschedule attempts for unlimited rescheduling
2018-03-19 18:06:15 -05:00
Michael Schurter
86ccdb9115
Fix generating static assets
...
Broke due to a change in go-bindata-assetfs
2018-03-19 15:52:38 -07:00
James Rasell
15afef9b77
Allow Nomads Consul health checks to be configurable.
...
This change allows the client HTTP and the server HTTP, Serf and
RPC health check names within Consul to be configurable with the
defaults as previous. The configuration can be done via either a
config file or using CLI flags.
Closes #3988
2018-03-19 19:37:56 +01:00
Preetha
6df57c177c
Merge pull request #4002 from hashicorp/b-reschedule-systemjob-panic
...
Fix incorrect initialization of reschedule policy for system jobs.
2018-03-19 13:06:55 -05:00
Preetha Appan
161bc66355
Fix incorrect initialization of reschedule policy for system jobs.
2018-03-19 12:16:13 -05:00
Alex Dadgar
9e05c9a50e
Merge pull request #3997 from hashicorp/b-serf-addr
...
RPC Advertise used exclusively for Clients
2018-03-19 09:30:20 -07:00
Alex Dadgar
9ef23ff277
enable server in test
2018-03-16 16:52:37 -07:00
Alex Dadgar
b8607ad6d6
Heartbeat uses client rpc advertise and server defaults server rpc advertise addr
2018-03-16 16:47:08 -07:00
Alex Dadgar
52b7fb5361
Separate client and server rpc advertise addresses
2018-03-16 16:47:08 -07:00
Michael Schurter
86f562be3a
Remove unnecessary conversions
2018-03-16 16:32:59 -07:00
Michael Schurter
c3e8f6319c
gofmt -s (simplify) files
2018-03-16 16:31:16 -07:00
Michael Schurter
1044bc0feb
Merge pull request #3984 from hashicorp/f-loosen-consul-skipverify
...
Replace Consul TLSSkipVerify handling
2018-03-16 11:21:28 -07:00
Michael Schurter
0971114f0c
Replace Consul TLSSkipVerify handling
...
Instead of checking Consul's version on startup to see if it supports
TLSSkipVerify, assume that it does and only log in the job service
handler if we discover Consul does not support TLSSkipVerify.
The old code would break TLSSkipVerify support if Nomad started before
Consul (such as on system boot) as TLSSkipVerify would default to false
if Consul wasn't running. Since TLSSkipVerify has been supported since
Consul 0.7.2, it's safe to relax our handling.
2018-03-14 17:43:06 -07:00
Alex Dadgar
3537c73289
Merge pull request #3978 from hashicorp/b-core-sched
...
Always add core scheduler
2018-03-14 16:13:15 -07:00
Preetha Appan
fa8863b51a
fix method comment
2018-03-14 16:10:32 -05:00
Preetha Appan
ffa0b7b1ed
Show reschedule eligibility time in alloc-status when followup evalid is available
2018-03-14 16:10:32 -05:00
Preetha Appan
e75630f8e8
Fix formatting
2018-03-14 16:10:32 -05:00
Preetha Appan
9a5e6edf1f
Rename DelayCeiling to MaxDelay
2018-03-14 16:10:32 -05:00
Preetha Appan
5f50c3d618
Add new reschedule options to API layer and unit tests
2018-03-14 16:10:32 -05:00
Alex Dadgar
92cb552ff6
Always add core scheduler and detect invalid schedulers
2018-03-14 10:53:27 -07:00
Alex Dadgar
63e14b7d63
nodeevents -> events
2018-03-13 18:08:22 -07:00
Alex Dadgar
d3c3deffad
fixes
2018-03-13 18:08:22 -07:00
Chelsea Holland Komlo
b41501e442
code review feedback
2018-03-13 18:08:21 -07:00
Chelsea Holland Komlo
1488b076d1
code review feedback
2018-03-13 18:08:21 -07:00