Michael Schurter
22690c5f4c
Add check watcher for restarting unhealthy tasks
2017-09-14 16:46:54 -07:00
Alex Dadgar
d86b3977b9
Fix alloc health with checks using interpolation
...
Fixes an issue in which the allocation health watcher was checking for
allocations health based on un-interpolated services and checks. Change
the interface for retrieving check information from Consul to retrieving
all registered services and checks by allocation. In the future this
will allow us to output nicer messages.
Fixes https://github.com/hashicorp/nomad/issues/2969
2017-08-07 16:27:08 -07:00
Alex Dadgar
067ed86a47
Client watches for allocation health using task state and Consul checks
...
This PR adds watching of allocation health at the client. The client can
watch for health based on the tasks running on time and also based on
the consul checks passing.
2017-07-07 12:10:04 -07:00
Michael Schurter
c0eff81383
Fix Service.AddressMode changes during task updates
2017-06-21 17:19:08 -07:00
Michael Schurter
b9bfb84b53
Implement DriverNetwork and Service.AddressMode
...
Ideally DriverNetwork would be fully populated in Driver.Prestart, but
Docker doesn't assign the container's IP until you start the container.
However, it's important to setup the port env vars before calling
Driver.Start, so Prestart should populate that.
2017-06-21 17:19:08 -07:00
Michael Schurter
745ad9521f
Move ScriptExecutor to driver
2017-04-19 12:42:47 -07:00
Michael Schurter
244251490a
Add UpdateTask method instead of Remove/Add
2017-04-19 12:42:47 -07:00
Michael Schurter
e204a287ed
Refactor Consul Syncer into new ServiceClient
...
Fixes #2478 #2474 #1995 #2294
The new client only handles agent and task service advertisement. Server
discovery is mostly unchanged.
The Nomad client agent now handles all Consul operations instead of the
executor handling task related operations. When upgrading from an
earlier version of Nomad existing executors will be told to deregister
from Consul so that the Nomad agent can re-register the task's services
and checks.
Drivers - other than qemu - now support an Exec method for executing
abritrary commands in a task's environment. This is used to implement
script checks.
Interfaces are used extensively to avoid interacting with Consul in
tests that don't assert any Consul related behavior.
2017-04-19 12:42:47 -07:00
Diptanu Choudhury
54a5e795a5
Hooking up the executor in all drivers
2016-03-23 13:19:45 -07:00
Alex Dadgar
e4c7c9f8b6
Remove a concurrent map access
2016-03-02 13:57:08 -08:00
Alex Dadgar
c744e2f4f1
Update the consul service when the task/alloc changes
2016-02-06 17:08:20 -08:00
Ryan Slade
e8b3ee3c69
Fix a typo
2016-01-27 17:49:32 +02:00
Diptanu Choudhury
b1d1e966ba
Printing error message if check is not valid
2016-01-07 17:51:57 -08:00
Diptanu Choudhury
b7f556fabc
Changed some comments
2015-12-14 18:05:58 -08:00
Diptanu Choudhury
2eb03e1d23
Renamed serviceId to serviceID
2015-12-14 15:57:56 -08:00
Diptanu Choudhury
76486d71e2
Making the allocs hold service ids
2015-12-14 15:08:35 -08:00
Diptanu Choudhury
3c01a4de27
Fixed log printing logic
2015-12-11 15:45:49 -08:00
Diptanu Choudhury
e389674d34
Exctracted nomad- to a constant
2015-12-11 14:06:51 -08:00
Diptanu Choudhury
c7c0748cea
Making a struct to hold consul service config
2015-12-11 14:06:51 -08:00
Diptanu Choudhury
a53e035b49
Deregister services and checks which are managed by Nomad
2015-12-11 14:06:51 -08:00
Diptanu Choudhury
8e97e7d85f
Not continuing sync if we couldn't get services and checks from consul
2015-12-11 13:10:20 -08:00
Diptanu Choudhury
7094ea53d6
Printing most of the consul messages only when the agent is available
2015-12-11 09:22:47 -08:00
Diptanu Choudhury
d54ccfb0ec
Muted the consul debug messages
2015-12-11 09:06:03 -08:00
Diptanu Choudhury
4395438400
Changing naming and debug message schemes
2015-12-10 16:47:43 -08:00
Diptanu Choudhury
b3c161a7d5
Generate check names, check id and service id on the server side
2015-12-10 16:07:17 -08:00
Charlie Drage
bbae520a38
Fix minor spelling error
2015-12-10 18:09:14 -05:00
Diptanu Choudhury
0bd552edb9
Added some extra log lines
2015-12-10 06:05:07 -08:00
Diptanu Choudhury
a2ef63a67d
Fixing some log lines
2015-12-07 06:25:00 -08:00
Halil Kaskavalci
8957a47ec4
Fixed git vet error on formatting
2015-11-30 10:27:26 +00:00
Diptanu Choudhury
fbe3bd0724
Fixed some docs
2015-11-26 13:47:02 -08:00
Diptanu Choudhury
7bab4d191a
Added more docs
2015-11-26 11:25:09 -08:00
Diptanu Choudhury
86a45b5b39
Added a mock consul api client
2015-11-26 01:03:16 -08:00
Diptanu Choudhury
f71a664faa
Fixed a few tests
2015-11-26 00:26:10 -08:00
Diptanu Choudhury
01ca982f92
Added a test for modifying check
2015-11-25 18:37:51 -08:00
Diptanu Choudhury
db8c4170b3
Fixed merge conflicts
2015-11-25 18:32:37 -08:00
Diptanu Choudhury
634e856c1f
Added some comments
2015-11-25 18:31:11 -08:00
Diptanu Choudhury
5eb8a26376
Fixed tests
2015-11-25 18:23:47 -08:00
Diptanu Choudhury
9cf10d64a5
making the service checks in service pointers
2015-11-25 17:44:57 -08:00
Diptanu Choudhury
32f0a80701
Made the logic to track checks simpler
2015-11-25 17:28:44 -08:00
Diptanu Choudhury
f66069a08d
Using the service id in check hash
2015-11-25 15:17:27 -08:00
Diptanu Choudhury
3f82deff60
Added options for adding more consul configuration
2015-11-25 13:39:16 -08:00
Diptanu Choudhury
95942b4179
Improved tests
2015-11-25 12:06:14 -08:00
Diptanu Choudhury
576a6f402e
Added a test to make sure we are adding a check to a service
2015-11-25 11:20:36 -08:00
Diptanu Choudhury
5480a2bd0f
Saving the host and port in tracked service
2015-11-24 18:58:53 -08:00
Diptanu Choudhury
6353dde236
Fixing comment and syntax
2015-11-24 18:43:23 -08:00
Diptanu Choudhury
28a21061ce
Implemented syncing of checks
2015-11-24 18:39:38 -08:00
Diptanu Choudhury
2c0822284b
Tracking the tasks too
2015-11-24 17:26:30 -08:00
Diptanu Choudhury
919f763ca8
Added a test to re-sync services
2015-11-24 14:37:14 -08:00
Diptanu Choudhury
135006699b
Renamed consul client to service
2015-11-24 12:34:26 -08:00
Diptanu Choudhury
a3d5b266a0
Registering Checks independently
2015-11-24 10:02:33 -08:00