664 Commits

Author SHA1 Message Date
James Phillips
45646ac3f4 Bumps default Raft protocol to version 3. (#3477)
* Changes default Raft protocol to 3.

* Changes numPeers() to report only voters.

This should have been there before, but it's more obvious that this
is incorrect now that we default the Raft protocol to 3, which puts
new servers in a read-only state while Autopilot waits for them to
become healthy.

* Fixes TestLeader_RollRaftServer.

* Fixes TestOperator_RaftRemovePeerByAddress.

* Fixes TestServer_*.

Relaxed the check for a given number of voter peers and instead do
a thorough check that all servers see each other in their Raft
configurations.

* Fixes TestACL_*.

These now just check for Raft replication to be set up, and don't
care about the number of voter peers.

* Fixes TestOperator_Raft_ListPeers.

* Fixes TestAutopilot_CleanupDeadServerPeriodic.

* Fixes TestCatalog_ListNodes_ConsistentRead_Fail.

* Fixes TestLeader_ChangeServerID and adjusts the conn pool to throw away
sockets when it sees io.EOF.

* Changes version to 1.0.0 in the options doc.

* Makes metrics test more deterministic with autopilot metrics possible.
2017-09-25 15:27:04 -07:00
Frank Schröder
12216583a1 New config parser, HCL support, multiple bind addrs (#3480)
* new config parser for agent

This patch implements a new config parser for the consul agent which
makes the following changes to the previous implementation:

 * add HCL support
 * all configuration fragments in tests and for default config are
   expressed as HCL fragments
 * HCL fragments can be provided on the command line so that they
   can eventually replace the command line flags.
 * HCL/JSON fragments are parsed into a temporary Config structure
   which can be merged using reflection (all values are pointers).
   The existing merge logic of overwrite for values and append
   for slices has been preserved.
 * A single builder process generates a typed runtime configuration
   for the agent.

The new implementation is more strict and fails in the builder process
if no valid runtime configuration can be generated. Therefore,
additional validations in other parts of the code should be removed.

The builder also pre-computes all required network addresses so that no
address/port magic should be required where the configuration is used
and should therefore be removed.

* Upgrade github.com/hashicorp/hcl to support int64

* improve error messages

* fix directory permission test

* Fix rtt test

* Fix ForceLeave test

* Skip performance test for now until we know what to do

* Update github.com/hashicorp/memberlist to update log prefix

* Make memberlist use the default logger

* improve config error handling

* do not fail on non-existing data-dir

* experiment with non-uniform timeouts to get a handle on stalled leader elections

* Run tests for packages separately to eliminate the spurious port conflicts

* refactor private address detection and unify approach for ipv4 and ipv6.

Fixes #2825

* do not allow unix sockets for DNS

* improve bind and advertise addr error handling

* go through builder using test coverage

* minimal update to the docs

* more coverage tests fixed

* more tests

* fix makefile

* cleanup

* fix port conflicts with external port server 'porter'

* stop test server on error

* do not run api test that change global ENV concurrently with the other tests

* Run remaining api tests concurrently

* no need for retry with the port number service

* monkey patch race condition in go-sockaddr until we understand why that fails

* monkey patch hcl decoder race condidtion until we understand why that fails

* monkey patch spurious errors in strings.EqualFold from here

* add test for hcl decoder race condition. Run with go test -parallel 128

* Increase timeout again

* cleanup

* don't log port allocations by default

* use base command arg parsing to format help output properly

* handle -dc deprecation case in Build

* switch autopilot.max_trailing_logs to int

* remove duplicate test case

* remove unused methods

* remove comments about flag/config value inconsistencies

* switch got and want around since the error message was misleading.

* Removes a stray debug log.

* Removes a stray newline in imports.

* Fixes TestACL_Version8.

* Runs go fmt.

* Adds a default case for unknown address types.

* Reoders and reformats some imports.

* Adds some comments and fixes typos.

* Reorders imports.

* add unix socket support for dns later

* drop all deprecated flags and arguments

* fix wrong field name

* remove stray node-id file

* drop unnecessary patch section in test

* drop duplicate test

* add test for LeaveOnTerm and SkipLeaveOnInt in client mode

* drop "bla" and add clarifying comment for the test

* split up tests to support enterprise/non-enterprise tests

* drop raft multiplier and derive values during build phase

* sanitize runtime config reflectively and add test

* detect invalid config fields

* fix tests with invalid config fields

* use different values for wan sanitiziation test

* drop recursor in favor of recursors

* allow dns_config.udp_answer_limit to be zero

* make sure tests run on machines with multiple ips

* Fix failing tests in a few more places by providing a bind address in the test

* Gets rid of skipped TestAgent_CheckPerformanceSettings and adds case for builder.

* Add porter to server_test.go to make tests there less flaky

* go fmt
2017-09-25 11:40:42 -07:00
Frank Schroeder
58c0a3f16d
Update docs for addr_type option for AWS Cloud auto-join (#3471)
Fixes #3471
2017-09-25 09:54:58 +02:00
Frank Schroeder
511dc3e95a
Fix Azure cloud auto-join docs (#3466)
Fixes #3466
2017-09-25 02:44:04 +02:00
James Phillips
15c0a72f74 Update options.html.md 2017-09-01 22:25:28 -07:00
James Phillips
46ed4ac2ca Fixes a bad link. 2017-09-01 15:07:18 -07:00
James Phillips
9258506dab Adds simple rate limiting for client agent RPC calls to Consul servers. (#3440)
* Added rate limiting for agent RPC calls.
* Initializes the rate limiter based on the config.
* Adds the rate limiter into the snapshot RPC path.
* Adds unit tests for the RPC rate limiter.
* Groups the RPC limit parameters under "limits" in the config.
* Adds some documentation about the RPC limiter.
* Sends a 429 response when the rate limiter kicks in.
* Adds docs for new telemetry.
* Makes snapshot telemetry look like RPC telemetry and cleans up comments.
2017-09-01 15:02:50 -07:00
James Phillips
745537fed4
Tweaks network segments guide. 2017-09-01 11:19:39 -07:00
Kyle Havlovitz
220db48aa7 Merge pull request #3431 from hashicorp/network-segments-oss 2017-09-01 10:24:58 -07:00
Kyle Havlovitz
00d03f1141
Add doc sections for network segments 2017-08-31 11:19:08 -07:00
David Terry
472398b174 docs: add quotes around example invocation for google cloud retry join 2017-08-30 23:05:45 +02:00
Frank Schroeder
a0b974620c
doc: document that retry-join values are URL encoded
Fixes #3417
2017-08-26 15:19:43 +02:00
Frank Schroeder
e22aa7a251
doc: fix parameter name for aws retry-join
Fixes #3417
2017-08-26 15:19:34 +02:00
Frank Schroeder
01eae2e9cf doc: document cloud auto-joining for retry-join-wan 2017-08-23 21:23:34 +02:00
Frank Schröder
546ffc25fc doc: retry_join is a string array (#3388) 2017-08-10 09:58:26 +02:00
James Phillips
72c4b9ef5f Removes partial details in the retry_join config file section. (#3386) 2017-08-09 21:27:17 -07:00
Seth Vargo
1258c1fe94 Document the new auto-join in the config and CLI (#3381)
* Document the new auto-join in the config and CLI
* Mention and example DNS
2017-08-09 21:14:56 -07:00
Kyle Havlovitz
c1c883f441
Add doc links for metrics endpoint 2017-08-08 13:05:38 -07:00
Kyle Havlovitz
d5634fe2a8
Add support for labels/filters from go-metrics 2017-08-08 01:45:10 -07:00
Nicolae Vlădescu
4a022d9a73 Add a more elegant alternative to the reap option
Add a more elegant alternative to the reap option using the native built-in docker init process
2017-08-07 11:49:40 +03:00
James Phillips
47f322bb59
Fixes a bunch of borken list nesting in the options doc. 2017-08-03 17:13:22 -07:00
James Phillips
4bee2e49f5 Adds secure introduction for the ACL replication token. (#3357)
Adds secure introduction for the ACL replication token, as well as a separate enable config for ACL replication.
2017-08-03 15:39:31 -07:00
Frank Schroeder
a2c39a4b59
doc: add retry-join docs for Softlayer 2017-08-03 21:35:30 +02:00
Frank Schroeder
2fac427cd4 agent: use github.com/hashicorp/go-discover
Replace the provider specific node discovery code
with go-discover to support AWS, Azure and GCE.

Fixes #3282
2017-08-01 11:41:43 +02:00
James Phillips
240c40deb8 Update options.html.md 2017-07-24 22:37:12 -07:00
James Phillips
357d00f7d3 Clarifies endpoint blocking in the docs. 2017-07-19 17:14:19 -07:00
James Phillips
1791d99a10 Adds new config to make script checks opt-in, updates documentation. (#3284) 2017-07-17 11:20:35 -07:00
James Phillips
74946ddde9 Fixes a broken link. 2017-07-17 00:07:34 -07:00
James Phillips
780e68a753 Changes remote exec KV read to call GetTokenForAgent(). (#3283)
* Changes remote exec KV read to call GetTokenForAgent(), which can use
the acl_agent_token instead of the acl_token.

Fixes #3160.

* Fixes remote exec unit test with ACLs.

* Adds unhappy ACL path to unit tests for remote exec.
2017-07-16 21:12:16 -07:00
James Phillips
1004d0ec0e Adds node read privileges to the acl_agent_master_token. (#3277)
Fixes #3113.
2017-07-16 20:08:26 -07:00
Kyle Havlovitz
090414db15
Add network area TLS setting to docs 2017-07-14 17:06:33 -07:00
James Phillips
947cc0d5e9 Adds a version note about block_endpoints config. 2017-07-10 13:56:02 -07:00
James Phillips
66edec5dfd Adds the ability to blacklist specific HTTP endpoints. (#3252) 2017-07-10 13:51:25 -07:00
Brian Shumate
7ae25f6c7e DOCS: Add note in Ports Used section (#3241)
- Add note about port 8302 to address #3058
2017-07-07 09:38:56 -07:00
Chris Griggs
bd03f8a8ed Update # of ports (#3238)
I counted twice.
2017-07-06 13:50:12 -07:00
Frank Schroeder
6dd68f7ad7
Revert "agent: add allowStale option for HTTP API (#3142)"
This reverts commit 1e0fd27a74f5b18775ce91a84310430de35a4a80.
2017-06-27 07:04:55 +02:00
James Phillips
a6987c1812 Adds missing tls_skip_verify option to HTTP check example. 2017-06-24 15:37:52 -07:00
James Phillips
6e1ee02689 Update options.html.md 2017-06-24 15:28:23 -07:00
James Phillips
380c8b957d Changes host-based node IDs from opt-out to opt-in. (#3187) 2017-06-24 09:36:53 -07:00
wojtkiewicz
1e0fd27a74
agent: add allowStale option for HTTP API (#3142)
This patch adds an "allowStale" option to the HTTP API
configuration which allows stale reads to provide linear
read scalability.

Fixes #3142
2017-06-22 10:31:13 +02:00
wojtkiewicz
37785028be
agent: add "http_config"
This patch adds an "http_config" object to the config file
and moves the "http_api_response_headers" option there.

"http_api_response_headers" is now deprecated in favor of
"http_config.response_headers"
2017-06-22 10:31:11 +02:00
Frank Schröder
31a310f551 agent: notify systemd after JoinLAN (#2121)
This patch adds support for notifying systemd via the
NOTIFY_SOCKET by sending 'READY=1' to the socket after
a successful JoinLAN.

Fixes #2121
2017-06-21 06:43:55 +02:00
Kyle Havlovitz
5473255f98 Update encryption.html.md 2017-06-16 12:54:25 -07:00
Kyle Havlovitz
5d99ee80ca Add an option to disable keyring file (#3145)
Also disables keyring file in dev mode.
2017-06-15 15:24:04 -07:00
James Phillips
bc3b68ba80 Fixes version reference in encryption docs. 2017-06-07 21:31:48 -07:00
Frank Schröder
825f72f5ef agent: support custom header and method for http checks (#3106)
This patch adds support for custom headers and
method for HTTP checks.

Fixes #2474
Fixes #2657
Fixes #3106
2017-06-07 01:11:56 +02:00
Kyle Havlovitz
62f72f104c Add settings for upshifting to encrypted gossip (#3079) 2017-05-30 08:51:37 -07:00
Michael Leow
deb206b7d7
agent: add RetryJoin support for Azure
Pull #2978 from leowmjw/develop

Resolves #2978
2017-05-24 10:15:38 +02:00
Frank Schroeder
df91388b7b
website: rename *.markdown to *.md 2017-05-17 20:25:45 +02:00
Kyle Havlovitz
5bab68b9bb Add a path for transitioning to TLS on an existing cluster (#3001)
Fixes #1705
2017-05-10 14:25:48 -07:00