Commit Graph

9551 Commits

Author SHA1 Message Date
Hans Hasselberg 4eaffe4c41
agent: only use TestAgent when appropriate (#5502) 2019-03-18 17:06:16 +01:00
Paul Banks 5d56039874
Update CHANGELOG.md 2019-03-15 20:20:39 +00:00
Paul Banks dd08426b04
Optimize health watching to single chan/goroutine. (#5449)
Refs #4984.

Watching chans for every node we touch in a health query is wasteful. In #4984 it shows that if there are more than 682 service instances we always fallback to watching all services which kills performance.

We already have a record in MemDB that is reliably update whenever the service health result should change thanks to per-service watch indexes.

So in general, provided there is at least one service instances and we actually have a service index for it (we always do now) we only ever need to watch a single channel.

This saves us from ever falling back to the general index and causing the performance cliff in #4984, but it also means fewer goroutines and work done for every blocking health query.

It also saves some allocations made during the query because we no longer have to populate a WatchSet with 3 chans per service instance which saves the internal map allocation.

This passes all state store tests except the one that explicitly checked for the fallback behaviour we've now optimized away and in general seems safe.
2019-03-15 20:18:48 +00:00
Paul Banks c9663d8235
Update CHANGELOG.md 2019-03-15 20:16:13 +00:00
Pierre Souchay 8f0fe5a00a Ensure we remove Connect proxy before deregistering the service itself (#5482)
This will fix https://github.com/hashicorp/consul/issues/5351
2019-03-15 20:14:46 +00:00
Alex Mayer a73d983d19 Docs Proofing (#5424)
* Docs: Remove default_policy From Code Example

It is not needed according to:
https://www.consul.io/docs/agent/acl-system.html#configuring-acls

* Docs: Cleanup Commands And Their Output On ACL Guide Page

Remove extra spaces and newlines
Ensure rules match input rules

* Docs: Remove Incomplete "Added In Version" Statement

Version added is specified on parent option

* Docs: Fix Broken Links

* Docs: Minor Sentence Tweaks
2019-03-15 09:35:33 -05:00
Matt Keeler 240934e856
Update CHANGELOG.md 2019-03-14 11:10:32 -04:00
Valentin Fritz 0fde90b172 Fix checks removal when removing service (#5457)
Fix my recently discovered issue described here: #5456
2019-03-14 11:02:49 -04:00
R.B. Boyer d65008700a
acl: reduce complexity of token resolution process with alternative singleflighting (#5480)
acl: reduce complexity of token resolution process with alternative singleflighting

Switches acl resolution to use golang.org/x/sync/singleflight. For the
identity/legacy lookups this is a drop-in replacement with the same
overall approach to request coalescing.

For policies this is technically a change in behavior, but when
considered holistically is approximately performance neutral (with the
benefit of less code).

There are two goals with this blob of code (speaking specifically of
policy resolution here):

  1) Minimize cross-DC requests.
  2) Minimize client-to-server LAN requests.

The previous iteration of this code was optimizing for the case of many
possibly different tokens being resolved concurrently that have a
significant overlap in linked policies such that deduplication would be
worth the complexity. While this is laudable there are some things to
consider that can help to adjust expectations:

  1) For v1.4+ policies are always replicated, and once a single policy
  shows up in a secondary DC the replicated data is considered
  authoritative for requests made in that DC. This means that our
  earlier concerns about minimizing cross-DC requests are irrelevant
  because there will be no cross-DC policy reads that occur.

  2) For Server nodes the in-memory ACL policy cache is capped at zero,
  meaning it has no caching. Only Client nodes run with a cache. This
  means that instead of having an entire DC's worth of tokens (what a
  Server might see) that can have policy resolutions coalesced these
  nodes will only ever be seeing node-local token resolutions. In a
  reasonable worst-case scenario where a scheduler like Kubernetes has
  "filled" a node with Connect services, even that will only schedule
  ~100 connect services per node. If every service has a unique token
  there will only be 100 tokens to coalesce and even then those requests
  have to occur concurrently AND be hitting an empty consul cache.

Instead of seeing a great coalescing opportunity for cutting down on
redundant Policy resolutions, in practice it's far more likely given
node densities that you'd see requests for the same token concurrently
than you would for two tokens sharing a policy concurrently (to a degree
that would warrant the overhead of the current variation of
singleflighting.

Given that, this patch switches the Policy resolution process to only
singleflight by requesting token (but keeps the cache as by-policy).
2019-03-14 09:35:34 -05:00
kaitlincarter-hc 1cecaca601
[docs] Deploying Consul with Kubernetes (#5471)
* Adding new K8s guide.

* Update website/source/docs/guides/kuberenetes-deployment.html.md

Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com>

* Update website/source/docs/guides/kuberenetes-deployment.html.md

Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com>

* updating based on feedback.

* Couple updates based on feedback.

* Update website/source/docs/guides/kuberenetes-deployment.html.md

* updating value file.
2019-03-13 16:56:00 -05:00
Rebecca Zanzig 1be36c82ed Add docs for using Helm `--set` to create extraConfig variables (#5474)
* Add docs for using Helm `--set` to create extraConfig variables

Based on info provided for `consul-helm` issue 74.

* fixing formatting
2019-03-13 16:25:09 -05:00
Alvin Huang 113527626d
add sentinel redir (#5484) 2019-03-13 14:11:24 -04:00
kaitlincarter-hc a321b69a45
[docs] Move Sentinel documentation (#5478)
* Moving sentinel doc

* updating links, fixing headings.

* Update website/source/docs/agent/acl-rules.html.md
2019-03-13 12:47:25 -05:00
Alvin Huang c5175c34a0
Merge pull request #5483 from hashicorp/add-bootstrap-redir
update bootstrap redirect
2019-03-13 11:53:45 -04:00
Alvin Huang 65be242a31
update bootstrap redirect 2019-03-13 11:25:54 -04:00
kaitlincarter-hc cf617ab7d1
[docs] Bootstrapping Guide -> Install docs (#5473)
* moved the bootstrapping guide to the docs.

* More edits for consistency.

* Added arch link
2019-03-13 10:12:52 -05:00
Paul Banks d5a49aaff4
Update CHANGELOG.md 2019-03-13 13:18:55 +00:00
Hans Hasselberg d511e86491
agent: enable reloading of tls config (#5419)
This PR introduces reloading tls configuration. Consul will now be able to reload the TLS configuration which previously required a restart. It is not yet possible to turn TLS ON or OFF with these changes. Only when TLS is already turned on, the configuration can be reloaded. Most importantly the certificates and CAs.
2019-03-13 10:29:06 +01:00
Reid Beels 257d079fac Remove misleading encrypt param documentation (#5452)
According to https://www.consul.io/docs/agent/options.html#_encrypt, the `encrypt` param specifies the 16-byte key to use, not the path to a config file containing the key.
2019-03-12 10:26:40 -05:00
R.B. Boyer e9614ee92f
acl: correctly extend the cache for acl identities during resolution (#5475) 2019-03-12 10:23:43 -05:00
Alvin Huang 4956d632b9
Merge pull request #5451 from hashicorp/update_go_discover_for_azure
Update go-discover vendor
2019-03-11 16:39:39 -04:00
Lowe Schmidt 7638a1ca1a Typo fix (segement > segment) (#5469) 2019-03-11 16:25:19 +01:00
Paul Banks abf387ddf3
Update CHANGELOG.md 2019-03-11 14:49:49 +00:00
Aestek 071fcb28ba [catalog] Update the node's services indexes on update (#5458)
Node updates were not updating the service indexes, which are used for
service related queries. This caused the X-Consul-Index to stay the same
after a node update as seen from a service query even though the node
data is returned in heath queries. If that happened in between queries
the client would miss this change.
We now update the indexes of the services on the node when it is
updated.

Fixes: #5450
2019-03-11 14:48:19 +00:00
Masato Yamazaki 774b39dd94 website: delete duplication of "are" (#5464) 2019-03-11 10:42:15 +01:00
petems e9b7569759 Update go-discover vendor
* Adds note about use of ENV variables for auto-join on Azure
2019-03-08 22:57:48 +00:00
Alvin Huang 190d6c20e9
Merge pull request #5453 from hashicorp/circleci2.0-config
refactor circleci config to 2.0
2019-03-08 16:10:57 -05:00
Alvin Huang aa6724acbe refactor circleci config to 2.0 2019-03-08 16:03:40 -05:00
Rebecca Zanzig 180110f3b3
Merge pull request #5445 from hashicorp/docs/helm-annotations
Add docs for new Helm `annotations` options
2019-03-08 12:11:30 -08:00
kaitlincarter-hc 7d5c252599
[Docs] ACL Bootstrap Guide (#5399)
* Adding updates for consul reload of token config.

* Update website/source/docs/guides/acl.html.md
2019-03-08 13:12:16 -06:00
kaitlincarter-hc 3a5db38e09
[doc] New Ports Documentation (#5442)
* Adding a ports table.

* Updating layout based on feedback.
2019-03-08 13:10:35 -06:00
Rebecca Zanzig 13133c0fff Add docs for new Helm `annotations` options 2019-03-08 10:10:25 -08:00
Rebecca Zanzig 2c800864f7
Merge pull request #5444 from hashicorp/docs/helm-priorityClassName
Add docs about new Helm `priorityClassName` options
2019-03-08 10:07:49 -08:00
Rebecca Zanzig 2f8bcd2b66 Add docs about new Helm `priorityClassName` options 2019-03-08 09:42:53 -08:00
Rebecca Zanzig b9f7e41399
Merge pull request #5443 from hashicorp/docs/acl-to-sync
Move aclSyncToken docs under `syncCatalog`
2019-03-08 09:06:43 -08:00
Rebecca Zanzig c5b3f98b14 Move aclSyncToken docs under `syncCatalog`
Additionally updates the anchors to follow the established convention.
2019-03-07 16:54:11 -08:00
Judith Malnick 73b4ce2758
[docs] fix link to prepared query rules (#5435)
* [docs] fix link to prepared query rules

* Update website/source/api/query.html.md

Co-Authored-By: judithpatudith <judith@hashicorp.com>
2019-03-07 12:10:40 -08:00
Rebecca Zanzig 5ab580990b
Merge pull request #5431 from hashicorp/docs/helm-extraConfig
[docs] Add examples for the `extraConfig` options in the Helm chart
2019-03-06 14:25:25 -08:00
Rebecca Zanzig 5b322d84e4 Add examples for the `extraConfig` options in the Helm chart 2019-03-06 13:01:17 -08:00
Alvin Huang 494fd53ecb
Merge pull request #5436 from hashicorp/fix-typo
fix typos
2019-03-06 15:00:17 -05:00
Alvin Huang ece3b5907d fix typos 2019-03-06 14:47:33 -05:00
R.B. Boyer 91e78e00c7
fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
kaitlincarter-hc ca463fb1d5
[Docs] Production Guide for ACLs (#5385)
* New guide for ACLs

* Fixing some formatting issues.

* Update website/source/docs/guides/production-acls.html.md

Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com>

* Update website/source/docs/guides/production-acls.html.md

Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com>

* Update website/source/docs/guides/production-acls.html.md

Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com>

* Resolving PR comments.

* Closing the rest of the PR comments

* Updates for persistence.

* Updating commands.

* Update website/source/docs/guides/production-acls.html.md

Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com>

* Update website/source/docs/guides/production-acls.html.md

Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com>
2019-03-06 10:46:07 -06:00
Chip Vaughn 157ca0df24
Merge pull request #5420 from hashicorp/f-catalog-changes
Catalog API Doc Changes
2019-03-06 11:00:37 -05:00
Chip Vaughn bdea21f14a Update to registering services via Catalog API 2019-03-06 09:41:12 -05:00
Chip Vaughn a700fc5530 Update to registering services via Catalog API 2019-03-06 09:23:37 -05:00
Hans Hasselberg af1de3c81c
tlsutil: don't use `server_name` config for RPC connections (#5394)
* server name only for outgoing https for checks
2019-03-05 21:35:43 +01:00
R.B. Boyer c24e3584be improve flaky LANReap tests by expliciting configuring the tombstone timeout
In TestServer_LANReap autopilot is running, so the alternate flow
through the serf reaping function is possible. In that situation the
ReconnectTimeout is not relevant so for parity also override the
TombstoneTimeout value as well.

For additional parity update the TestServer_WANReap and
TestClient_LANReap versions of this test in the same way even though
autopilot is irrelevant here .
2019-03-05 14:34:03 -06:00
R.B. Boyer bc984dcb38 tests: avoid leaking child processes from agent/proxyprocess package 2019-03-05 14:29:25 -06:00
R.B. Boyer 66af091de9 website: fix broken links 2019-03-05 14:24:33 -06:00