Commit Graph

1105 Commits

Author SHA1 Message Date
Eliza Weisman 9d8f58cb16
Add additional validation for stat command-line arguments (#1415)
Closes #776.

This branch adds the following validation to the `linkerd stat` command:

* The `--to` and `--from` flags are now mutually exclusive
* The `--to-namespace` and `--from-namespace` commands are also mutually
  exclusive.
* The `namespace` resource type conflicts with the `--namespace`, 
  `--to-namespace`, and `--from-namespace` flags.

Examples:

```
$ bin/go-run cli/main.go stat deploy --to deploy/foo --from deploy/bar
Error: --to and --from flags are mutually exclusive
Usage:
  linkerd stat [flags] (RESOURCE)
  ...
```

```
$ bin/go-run cli/main.go stat deploy --to-namespace foo --from-namespace bar
Error: --to-namespace and --from-namespace flags are mutually exclusive
Usage:
  linkerd stat [flags] (RESOURCE)
  ...
```

```
$ bin/go-run cli/main.go stat namespace foo --namespace bar
Error: --namespace flag is incompatible with namespace resource type
Usage:
  linkerd stat [flags] (RESOURCE)
  ...
```

```
$ bin/go-run cli/main.go stat ns --to-namespace bar
Error: --to-namespace flag is incompatible with namespace resource type
Usage:
  linkerd stat [flags] (RESOURCE)
  ...
```

```
$ bin/go-run cli/main.go stat namespace --from-namespace bar
Error: --from-namespace flag is incompatible with namespace resource type
Usage:
  linkerd stat [flags] (RESOURCE)
  ...
```

```
$ bin/go-run cli/main.go stat ns/foo --from-namespace bar
Error: --from-namespace flag is incompatible with namespace resource type
Usage:
  linkerd stat [flags] (RESOURCE)
  ...
```

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-08-08 15:35:47 -07:00
Eliza Weisman 56681015ae
Fix Destination returning no endpoints for single unnamed container port (#1420)
Fixes #1405.

According to the Kubernetes Endpoints API documentation, the `name`
field in the `EndpointPort` response object is "Optional if only one
port is defined". (see
https://v1-9.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#endpointport-v1-core)
However, when the Destination service an endpoints response for a
service with a named target port, it expects the ports in the endpoints
response to have the same name as the target port in the service. 

When a user creates a `NodePort` service with an unnamed port that
targets a named container port, this behaviour results in Linkerd
failing to route to that service by hostname. Without Linkerd injected,
the hostname is still reachable. 

This branch fixes this issue by changing the `endpointsToAddresses`
function in `endpoints_watcher.go` to handle the case when an endpoints
response contains only a single unnamed port.

I've manually verified that this fixes the issue described in #1405.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-08-08 13:01:53 -07:00
Kevin Lingerfelt 82940990e9
Rename mailing lists, remove all remaining conduit references (#1416)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-07 17:00:55 -07:00
Risha Mars f738d7c3b9
Add change log notes for release v18.8.1 (#1413) 2018-08-07 14:46:39 -07:00
Risha Mars a977fb6b57
Add a link to the Tap page in the sidebar (#1412)
Reenable tap from the sidebar
2018-08-07 14:44:16 -07:00
Kevin Lingerfelt ac94c62c22
Fix namespace inconsistency in prometheus doc (#1414)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-07 14:44:04 -07:00
Risha Mars 5d01779dc0
Tap Web UI: add autocomplete for some authorities (#1409)
Problem:
Currently the web UI's resource autocomplete also lists authorities. 
However you can't tap authorities in this way, you have to use --authority 
in addition to whatever resource you're trying to tap. 
The web UI is confusing as it presents authorities in that list. 
Those authorities should instead be moved to the Authority box in the advanced filter form.

Solution:
* Don't present authorities as options in the Resource dropdowns
* Add authority autocomplete to authority form input

Follow up to @kl in #1391 there is an error when we try to tap an authority
2018-08-07 14:29:02 -07:00
Kevin Lingerfelt 4845b4ec04
Restore linkerd.io/control-plane* labels (#1411)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-07 13:53:29 -07:00
Kevin Lingerfelt e0a01c5dd8
Remove node scrape target, kubernetes grafana dashboard (#1410)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-07 13:41:38 -07:00
Risha Mars 511549e16d
Add client-side filters to the tap columns in the web UI (#1398)
Add client side filtering to the tap table, so that we can narrow down 
queries while still tapping a whole resource. 

There are two general kinds of filters here:
- filters where the number of possible values is bounded/small and 
we know them (e.g. inbound/outbound, grpc status). here, I've tried to 
hardcode the list of possible options with explanations (see the GRPC status filters)
- filters where the number of possible values can be very large (e.g. paths)
here, I've generated the list of options as we process the incoming data. 
I also periodically delete the oldest filter option so the list of filters 
doesn't grow unbounded

Filters added:
- GRPC status code filters
- http status filters
- path filters
- scheme filters
- tls, destination and source filters
2018-08-06 12:31:10 -07:00
Kevin Lingerfelt bd19e8aaff
Update prometheus to only scrape proxies in the same mesh (#1402)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-06 12:05:55 -07:00
Risha Mars 0e6c0a2f3b
Tap: Make use of the Web UI to render tap events in a table (#1391)
* Make use of the Web UI to render tap events in a table

- Return JSON tap events instead of the command line output
- Experiment with a different way of rendering the EventList
- changed the default width back to 100% of the screen because this 
table does not look great squished
2018-08-03 13:45:04 -07:00
Kevin Lingerfelt f70ad7de11
Use stable version for linkerd2-proxy-api dep (#1400)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-03 11:59:42 -07:00
Sean McArthur c035193313
add H2 protocol to destination addrs if managed by linkerd (#1380)
Signed-off-by: Sean McArthur <sean@buoyant.io>
2018-08-03 10:14:30 -07:00
Eliza Weisman 01cc30d102
Increase outbound router capacity for Prometheus pod's proxy (#1358)
Currently, when a cluster has over 100 pods injected with the Linkerd2
proxy, Prometheus metrics are not collected correctly. This is because
Prometheus appears to be making more concurrent requests than its'
proxy's outbound router cache can handle See issue #1322 for further 
details.

This branch introduces a workaround for this issue, by increasing the
outbound router cache capacity to 10000 routes for the Prometheus pod's
proxy only. The router capacity limit of 100 active routes is primarily
due to the limitation of the number of active Destination service 
lookups, so increasing the capacity for the Prometheus pod specifically
is probably okay, as the scrape requests are made to IP addresses 
directly and therefore will not cause service discovery lookups. 

This change was originally implemented and tested in @siggy's PR #1228.
I've rebased his branch onto the current `master`, and updated the code
to reflect the project name change.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: Andrew Seigner <siggy@buoyant.io>
2018-08-02 16:44:11 -07:00
Alex Leong 3e1f35913b
Read all bytes of message length header (#1394)
The `reader.Read` method only reads as many bytes as are currently available from reader.  When reading the 4 byte message length header, if not all 4 of those bytes are available, `Read` will only read the available bytes and return.  This causes alignment issues when the message body is read and there are still unread header bytes in the reader.  These bytes will appear at the beginning of the message body and cause a crash when the message is unmarshalled.

Use `io.ReadFull` to ensure that we read all 4 of the message length header bytes.

Fixes #1287 

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-08-02 10:45:49 -07:00
Ivan Sim eb04217a12 Update inject cmd to read from folder (#1377)
This change is a simplified implementation of the Builder.Path() and
Visitor().ExpandPathsToFileVisitors() functions used by kubectl to parse files
and directories. The filepath.Walk() function is used to recursively traverse
directories. Every .yaml or .json resource file in the directory is read
into its own io.Reader. All the readers are then passed to the YAMLDecoder in the
InjectYAML() function.

Fixes #1376

Signed-off-by: ihcsim <ihcsim@gmail.com>
2018-08-01 17:12:00 -07:00
Kevin Lingerfelt c5598d65f1
Update CHANGES.md for v18.7.3 release (#1389)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-31 16:08:01 -07:00
Kevin Lingerfelt 7530b92abb
Add script to extract binaries from prebuilt cli-bin image (#1388)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-31 15:56:35 -07:00
Kevin Lingerfelt 5963fe7cf6
Bump install timeout in integration tests (#1382)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-31 15:52:46 -07:00
Risha Mars fef896011f Add more filters to the web UI tap form (#1371)
* Update ant to 3.7.2
* Add autocomplete of namespaces/resources to Tap in web ui
  * Add form fields for authority/path/method/rps/scheme
  * Add the ability to clear error messages to the error banner
* Add error listener to ws object
2018-07-31 15:48:53 -07:00
Kevin Lingerfelt 8fe9e53f67
Remove remaining conduit references in codebase (#1381)
* Remove remaining conduit references in codebase
* Shorten emojivoto config url

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-31 11:19:34 -07:00
Kevin Lingerfelt 9bb4ecb071
Update location of emojivoto kubernetes config (#1375)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-30 13:04:53 -07:00
Kevin Lingerfelt c362d5e114
Update k8s.io dependencies to 1.11.1 (#1369)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-27 15:23:03 -07:00
Brian Smith 7467e36b28
bin/test-cleanup: Delete test namespaces in paralllel. (#1339)
* bin/test-cleanup: Delete test namespaces in paralllel.

My kubectl (1.9.4) waits until the `kubectl delete` operation completes,
unlike previous versions which issue the deletion request and then
immediate return. As a result of this change, bin/test-cleanup become
much slower since each deletion was happening serially. Fix this by
issuing all the deletions in parallel with a single `kubectl delete`.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-27 10:43:49 -10:00
Brian Smith 377391cda9
Fix build on Linux. (#1372)
Without this change the Linux build fails. Apparently
commit 554ffe6a46 added the use of a
bash-specific feature.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-27 07:06:35 -10:00
Brian Smith 2098beb123
Don't relink web & controller executables when version changes. (#1338)
Speed up incremental rebuilds by avoiding relinking the controller
and/or web executables when changes are made to unrelated files.
Before this change, any time the git tag changed, the executables
would have to be rebuilt (relinked at least), even if no Go files
changed.

Validated by running the integration tests.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-26 16:20:36 -10:00
Kevin Lingerfelt dae86da0e4
Allow docker-build-proxy to override the proxy version (#1324)
* Allow docker-build-proxy to override the proxy version
* Update based on review feedback
* fetch-proxy should return full path to executable

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-26 10:10:49 -07:00
Brian Smith 0bbb31afdf Revert "Add note to TEST.md about kubectl version."
This reverts commit c2dd6e3912.
2018-07-25 12:33:06 -10:00
Brian Smith c2dd6e3912 Add note to TEST.md about kubectl version.
Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-25 11:45:55 -10:00
Kevin Lingerfelt 51848230a0
Send glog logs to stderr by default (#1367)
* Send glog logs to stderr by default
* Factor out more shared flag parsing code

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-25 12:59:24 -07:00
Kevin Lingerfelt 554ffe6a46
Build version tags in CI (#1365)
* Build version tags in CI
* Simplify clean_head method

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-25 12:32:42 -07:00
Kevin Lingerfelt 2971831508
Update CHANGES.md for the v18.7.2 release (#1362)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-24 13:26:59 -07:00
Risha Mars ec3c861743
Enable Tap from the Web UI (#1356)
Adds a tap endpoint in the web api that communicates with the dashboard 
via websockets.
I've moved a bunch of code from the cli tap.go into utils so that the code 
can be shared between web and CLI. I think we should consider making the 
display more suited to web, but in the short term, reusing the CLI's 
rendering of tap events works.

Adds a Tap page in the Web UI that you can use to make tap requests. 
The form currently only allows you to enter a resource and namespace, 
other filters coming in a follow-up branch.
2018-07-24 14:23:42 -04:00
Kevin Lingerfelt dcb9c550bc
Update version test to block on http server initialization (#1346)
* Update version test to block on http server initialization
* Run version test on different port

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-23 17:29:29 -07:00
Kevin Lingerfelt 4b9700933a
Update prometheus labels to match k8s resource names (#1355)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-23 15:45:05 -07:00
Kevin Lingerfelt e196e1afc0
Update README for the v18.7.1 linkerd2 release (#1348)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-23 11:19:05 -07:00
Risha Mars 9821b97326
Delete remaining conduit logo; add linkerd favicon (#1343)
- Remove a conduit image from our img folder
- Add a linkerd favicon, should no longer get the favicon not found console error
- Configure webpack to not hash image names
2018-07-18 17:27:57 -07:00
Franziska von der Goltz 829371bc06
add application topology graph to namespace tab (#1110)
* This commit adds an application topology graph within the namespace tab. As a developer / operator one would like to see an overview of the services running to identify dependencies. Adding this graph gives Linkerd2 users a good overview of service dependencies.
* networkgraphtest added

Fixes: #924

Signed-off-by: Franziska von der Goltz <franziska@vdgoltz.eu>
2018-07-18 17:10:15 -07:00
Brian Smith a98bfb1ca7
Rename `ca-bundle-distributor` to `ca`. (#1340)
`ca-bundle-distributor` described the original role of the program but
`ca` ("Certificate Authority") better describes its current role.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-17 14:10:40 -10:00
Thomas Rampelberg 74da62f8c0
Update docs to reference Linkerd (#1331)
* Update docs to reference Linkerd

* Review comments
2018-07-17 15:29:46 -07:00
Kevin Lingerfelt 37f8490edb
Update top-level docs to reflect repo rename (#1333)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-17 13:42:25 -07:00
Kevin Lingerfelt e377cf4214
Update CHANGES.md for the v18.7.1 release (#1342)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-17 11:08:57 -07:00
Kevin Lingerfelt 3357a06f09
Remove conduit references from proxy-init codebase (#1325)
* Remove conduit references from proxy-init codebase
* Removing linkerd.io link from long description

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-17 10:29:30 -07:00
Brian Smith 1b38310019
Remove executable bit from non-executable files. (#1335)
These files were created with the executable bit set accidentally due
to the way my network file system setup was configured.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-16 13:55:52 -10:00
Brian Smith 0fcfd2bffb
Stop using `installsuffix` when building Go code. (#1327)
* Stop using `installsuffix` when building Go code.

See https://plus.google.com/117192131596509381660/posts/eNnNePihYnK.
`-installsuffix cgo` isn't necessary as of Go 1.10 (where build caching
changed substantially) and it probably wasn't necessary earlier.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-16 13:48:50 -10:00
Thomas Rampelberg 7e1b4e3de4
Update readme to reference linkerd2 (#1328)
* Update readme to reference linkerd2

* Review updates
2018-07-16 15:38:54 -07:00
Franziska von der Goltz c7ac072acc
update grafana dashboards: conduit to linkerd (#1320)
* update grafana dashboards to remove conduit reference and replace with linkerd instances
* update test install fixtures to reflect changes

Fixes: #1315

Signed-off-by: Franziska von der Goltz <franziska@vdgoltz.eu>
2018-07-16 13:05:01 -07:00
Brian Smith 3c29356bad
Fix file permissions for bin/fast-build. (#1326)
Revert the file permission changes from
commit f79a40a3e1.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-13 15:58:45 -10:00
Brian Smith f79a40a3e1
Add flag that skips `dep ensure` to bin/fast-build (#1321)
* Add flag that skips `dep ensure` to bin/fast-build

bin/fast-build is supposed to be fast. `dep ensure -vendor-only` is too slow
to meet this goal. Add `LINKERD_SKIP_DEP` to allow skipping it. The default
behavior is kept as-is to reduce new users' confusion.

The difference in speed isn't too notable now because the bin/docker-build
step drowns out the win currently. But if/when the bin/docker-build step is
replaced, this matters a lot.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-13 14:58:35 -10:00