Sean Chittenden
ca0f2d982d
Nuke a.consulConfig in favor of a.consul.Config
2016-06-10 15:50:11 -04:00
Sean Chittenden
3d22c22bf5
Remove types.ShutdownChannel and replace with chan struct{}
2016-06-10 15:50:11 -04:00
Sean Chittenden
4d47eedd58
Teach Client to reuse an Agent's consulSyncer.
...
"There can be only one."
2016-06-10 15:50:11 -04:00
Sean Chittenden
bc86e897ed
Register two services each for clients and servers, http and rpc.
...
In order to give clients a fighting chance to talk to the right port,
differentiate RPC services from HTTP services by registering two
services with different tags. This yields
`rpc.nomad-server.service.consul` and
`http.nomad-server.service.consul` which is immensely more useful to
clients attempting to bootstrap their world.
2016-06-10 15:50:11 -04:00
Sean Chittenden
ce8c03d708
Advertise the server's RPC endpoint, not its HTTP endpoint.
...
Rename c.serverRpcAddr to serverRpcAddr. This will be broken out
into in additional set of services in a subsequent commit.
2016-06-10 15:50:11 -04:00
Sean Chittenden
7cdf0edcfe
Rename the package from client/rpc_proxy to client/rpcproxy
...
Also rename `NewRpcProxy()` to just `New()` to avoid package stutter.
2016-06-10 15:50:11 -04:00
Sean Chittenden
1fa43a09dd
Reduce all forms of ConsulConfig down to a single struct
...
nomad/structs/config/consul.go's ConsulConfig is the canonical definition
for all things Consul now.
2016-06-10 15:50:11 -04:00
Sean Chittenden
4d30c98aa6
Rename consulConfig to consulAgentConfig
2016-06-10 15:50:11 -04:00
Sean Chittenden
5e0d76f7ce
Rename client/config/config's ConsulConfig to ConsulAgentConfig
...
A follow up commit to the previous rename. More to come.
2016-06-10 15:50:11 -04:00
Sean Chittenden
e6397da738
Centralize the creation of a consul/api.Config struct.
...
While documented, the consul.timeout parameter wasn't ever set
except one-off in the Consul fingerprinter.
2016-06-10 15:50:11 -04:00
Sean Chittenden
71dde1b584
Reconcile consul's address configuration section.
...
There were conflicting directives previously, both consul.addr and
consul.address were required to achieve the desired behavior. The
documentation said `consul.address` was the canonical name for the
parameter, so consolidate configuration parameters to `consul.address`.
2016-06-10 15:50:11 -04:00
Sean Chittenden
05bbbd2d55
Reconcile renamed structures during rebase
2016-06-10 15:50:11 -04:00
Sean Chittenden
c159e77fe3
An Agent's consulSyncer is always not nil now.
2016-06-10 15:50:11 -04:00
Sean Chittenden
89d48c8e82
Revise Agent.syncAgentServicesWithConsul()'s interface
...
Reduce down to its lowest common helper function denominator.
2016-06-10 15:50:11 -04:00
Sean Chittenden
8da18b60f3
Alpha sort config keys for Consul
2016-06-10 15:50:11 -04:00
Sean Chittenden
d268dcb85d
Reduce all forms of ConsulConfig down to a single struct
...
nomad/structs/config/consul.go's ConsulConfig is the canonical definition
for all things Consul now.
2016-06-10 15:50:11 -04:00
Sean Chittenden
f6e3587321
Define a type for the PeriodicCallback handlers and ShutdownChannel
2016-06-10 15:50:11 -04:00
Sean Chittenden
ffcd2332d4
Rebalance Nomad client RPCs among different Nomad servers.
...
Implement client/rpc_proxy.RpcProxy.
2016-06-10 15:50:11 -04:00
Sean Chittenden
7c6ad53d89
Rename NewConsulService to NewSyncer
2016-06-10 15:49:37 -04:00
Sean Chittenden
f280c59633
Rename client/consul/sync.PeriodicSync to Run
2016-06-10 15:49:37 -04:00
Sean Chittenden
d84d71847c
Rename client/consul/sync.ConsulService to client/consul/sync.Syncer
...
Syncer describes the responsibility and actions of the type.
2016-06-10 15:49:37 -04:00
Sean Chittenden
092e07f334
Create a nomad/structs/config to break an import cycle.
...
Flattening and normalizing the various Consul config structures and
services has led to an import cycle. Break this by creating a new package
that is intended to be terminal in the import DAG.
2016-06-10 15:48:36 -04:00
Sean Chittenden
af72200cf4
Distill config.Config.ConsulConfig down to config.Config.Consul
...
The enclosed struct provides the necessary context
2016-06-10 15:48:36 -04:00
Sean Chittenden
1f7bfb30d9
Rename consulConfig to consulAgentConfig
2016-06-10 15:48:36 -04:00
Sean Chittenden
4fed6b0ab5
Rename client/config/config's ConsulConfig to ConsulAgentConfig
...
A follow up commit to the previous rename. More to come.
2016-06-10 15:48:36 -04:00
Sean Chittenden
0e1bdad2a0
Rename consul.ConsulConfig to consul.AgentConfig
...
There were two `ConsulConfig` structs running around, one of them
needed to go away. Rely on the package's path to provide context
for the type of AgentConfig.
2016-06-10 15:48:36 -04:00
Sean Chittenden
7db2eb03c4
Use consul/lib's RandomStagger
...
Removes four redundant copies of the method in the process.
2016-06-10 15:48:36 -04:00
Jeff Mitchell
4a389c53e7
Use upstream high-level SCADA provider
2016-06-01 18:25:09 -04:00
Diptanu Choudhury
f1a534874d
Fixed a test
2016-05-31 01:58:32 +02:00
Diptanu Choudhury
c760d5910f
Renamed error message in alloc endpoint
2016-05-28 20:03:52 -07:00
Diptanu Choudhury
0782803543
Added a test for alloc stats api endpoint
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
4611540182
Added a test for the clients stats endpoint
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
15e79c3783
Changing the api of the stats endpoints
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
f16191c297
comments
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
c99733e8c7
Fixed the compilation on linux
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
31af4e0ac4
Changed signature of Allocation Stats Reporter
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
bf6c034fec
Making the stats collection interval and number of data points to keep in memory configurable
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
b755ab9341
Changed the stats endpoints
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
c85b4de46a
Adding a query param to return time series of stats
2016-05-28 19:42:34 -07:00
Diptanu Choudhury
72c60d6b99
Added some docs to resource stats endpoint
2016-05-28 19:42:34 -07:00
Diptanu Choudhury
fe8f640cc8
Collecting host stats
2016-05-28 19:42:34 -07:00
Diptanu Choudhury
f390261cd0
Reporting time series of stats
2016-05-28 19:42:34 -07:00
Diptanu Choudhury
01e0ae7753
Added a client API to display resource usage of an allocation
2016-05-28 19:42:34 -07:00
Diptanu Choudhury
9d8f6d0837
Added a test for generation of the server addr
2016-05-24 21:29:13 -07:00
Diptanu Choudhury
f1c96df3f3
Using the bind addr as server's IP if advertise addr and addresses.HTTP is not specified
2016-05-24 17:27:09 -07:00
Alex Dadgar
05ea2bd583
Compress HTTP API responses and have the api client utilize this
2016-05-24 10:26:53 -07:00
Alex Dadgar
4133157afb
Merge pull request #1182 from hashicorp/f-json-encoder
...
Use codegen for json marshalling
2016-05-20 14:30:25 -07:00
Alex Dadgar
819eaca09e
Use codegen for json marshalling: 20% faster, 12% less bytes allocated, 85% less allocations
2016-05-18 09:45:46 -07:00
Diptanu Choudhury
6b0757c6c4
Merge pull request #1174 from hashicorp/f-config-consul-block
...
Using the auto-register flag
2016-05-18 04:16:38 +02:00
Dara Kong
4c6c3d0b41
Fix "http_api_response_headers" config not working
...
On startup, the agent starts with either a dev or default config. Extra
config files are merged into final config.
The HTTPAPIResponseHeaders config was missing from the merge logic
therefore it would always result in empty value (regardlesss of any
config files specified).
2016-05-16 20:57:54 -07:00