Commit Graph

1020 Commits

Author SHA1 Message Date
Risha Mars 3e73c096e9
Remove the ScatterPlot code from /web (#1485)
Remove old unused graphs from the web code (scatter plot and line graph)
and their associated css

Files removed: 
web/app/css/line-graph.css
web/app/css/list.css
web/app/css/scatterplot.css
web/app/css/version.css
web/app/js/components/LineGraph.jsx
web/app/js/components/ScatterPlot.jsx
2018-08-17 14:40:45 -07:00
Risha Mars 1bf280b105
Add resource detail skeleton page (#1476)
Add a barebones resource detail page. We'll use the kubernetes REST style
api for locating specific resource pages.

Example URLS:
http://localhost:8084/namespaces/emojivoto/pods/emoji-7578f4f846-m6872
http://localhost:8084/namespaces/emojivoto/deployments/voting
2018-08-17 10:53:05 -07:00
Dennis Adjei-Baah a3bd861667
Add a meshed column to metrics tables in the web UI (#1466)
Currently conduit stat outputs a column that shows the number of meshed pods in the resource being
queried. The web UI does not have this information about meshed pod state.

This commit adds a meshed column for better UI parity with the stat command.

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2018-08-16 11:14:01 -07:00
Risha Mars 70babbaeba
linkerd top GUI (#1454)
Add a Top page to the linkerd web UI. This is the web equivalent of #1435.
I've used the same fields as in the current implementation.
This branch also includes some slight refactors to the Tap code to enable code reuse.

The request processing logic is pretty similar to that in Tap.jsx, except that we can 
immediately discard the result once we receive the response end and aggregate 
that result into the top results. So the index of tap results will tend to be smaller 
(unless they're long running requests like streaming). But we also add a similar 
index of aggregated Top results, and discard oldest results if top has been
running for a long time.

* Add a Top page to the web UI
* Refactor Tap event parsing into common util code
* Small refactors to the TapQueryForm and the CliCmd display to accomodate Top
* Collate tap events based on the ID (src, dst, stream)
* Also refactor keying of req/rsp/end into requestInit/responseInit/responseEnd for clarity
* Use pod labels when present in top
* Fix bug where src/dst were switched in the Tap display table
2018-08-16 10:51:19 -07:00
Alex Leong 094a375015
[RFC] linkerd top (#1435)
This an initial implementation of the `linkerd top` command.  This command launches an ncurses style tabular view of current requests (using data from tap).  Most of the command line arguments are the same as tap and allow selecting the resource to inspect and filtering which requests to view.  

Fixes #1283 

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-08-15 18:10:23 -07:00
Alena Varkockova 05515adeaf Fix the installation path in docs (#1439)
Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
2018-08-15 11:31:01 -07:00
Risha Mars e5ab124d76
Refactor Tap query form into its own component (#1446)
Tap.jsx is really large and contains a lot of logic that pertains only to the Tap Query Form.
This PR tries to separate the concerns of the form and the query display from the main 
Tap querying and rendering logic. 
This will also allow us to easily reuse this form/CLI formatting for the Top page.

Changes in this PR:

* moves all the code for the form into its own component (TapQueryForm)
* moves the code that displays the current query into its own component (TapQueryCliCmd)
* formats the current tap query as the equivalent command line format that you 
can paste into a terminal
2018-08-14 11:29:35 -07:00
Risha Mars 0750e47203
Make use of new src and dst metadata hydration (#1444)
Now that we have source metadata in tap events, we can display 
the pod name in the UI instead of the IP. I've also added a popover 
that shows deploy and pod info if we have it.

Also adds another table in the expanded row view to show all the 
metadata we have. This table probably won't stick around forever, 
but I'm just displaying all the data we have right now.
2018-08-13 16:21:41 -07:00
Eliza Weisman cda05aa34c
Add inbound destination label hydration to Tap server (#1442)
Based on @adleong's suggestion in
https://github.com/linkerd/linkerd2/pull/1434#pullrequestreview-145428857,
this branch adds label hydration from destination IPs to the Tap server.
This works the same as the label hydration for destination IPs added in
#1434. However, it is only applied to the destination fields of events
recorded by proxies in the inbound direction, since outbound
destinations are already labeled with metadata provided by the
Destination service.

This means that when a user taps inbound traffic, the CLI will show k8s
metadata labels for the destination peer (if it's available). This can
be useful especially when tapping several pods at once, as it makes it
easier to distinguish what pod received a request.

This branch also refactors how the label hydration is performed,
primarily to make adding it to the destination field less repetitive.
Also, the `hydrateIPLabels` function now mutates the label map in the
`TapEvent`, rather than returning a new map of labels, so that the case
where no pod was found doesn't require an additional allocation of an
empty map.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-08-13 13:46:33 -07:00
Eliza Weisman bf7fc12f5c
Add source metadata to Tap server tap events (#1434)
The `TapEvent` protobuf contains two maps, `DestinationMeta` and
`SourceMeta`. The `DestinationMeta` contains all the metadata provided
by the proxy that originated the event (ultimately originating from the
Destination service), while the `SourceMeta` currently only contains the
source connection's TLS status.

This branch modifies the Tap server to hydrate the same set of metadata
from the source IP address, when the source was within the cluster. It
does this by adding an indexer of pod IPs to pods to its k8s API client,
and looking up IPs against this index. If a pod was found, the extra
metadata is added to the tap event sent to the client.

This branch also changes the client so that if a source pod name was
provided in the metadata, it prints the pod name rather than the IP
address for the `src` field in its output. This mimics what is currently
done for the `dst` field in tap output. Furthermore, the added source
metadata will be necessary for adding src resource types to tap output
(see issue #1170).

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-08-13 13:25:14 -07:00
Risha Mars 142d1d8747
Correctly pass tap errors into the ErrorBanner component (#1443)
We have a new format for displaying errors in ErrorBanner. 
When a websocket error occurred, we'd pass in text where ErrorBanner 
expects and object. This PR puts the websocket errors in an object

Also clean up the display of the error by removing redundant text.
2018-08-13 12:20:12 -07:00
Risha Mars e63e28e243
Fix tap start/stop button not toggling at the right time (#1432)
Problem:
We depend on the websocketRequestSent bool (renamed to 
tapRequestInProgress in this branch) to determine whether the 
start/stop button says start or stop. However, we don't change 
this value in setState until we open the websocket connection 
(which could take some time). This led to a delay in when you 
press the Start button and when it changes colour.

Solution:
Set the state before waiting for the websocket to open, so the 
button colour changes immediately and the form feels more responsive
2018-08-10 12:12:40 -07:00
Kevin Lingerfelt 00a0572098
Better CLI error messages when control plane is unavailable (#1428)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-09 15:40:41 -07:00
Risha Mars 38c4b2937a
Tap web UI: Fix latency formatting (#1429)
* Nicely format tap latencies to be more readable
* Various whitespace cleanups
2018-08-09 15:23:34 -07:00
Adam Christian f510d7ea08
Changing the statusText to be an object with more fields, then displa… (#1395)
* Changing the statusText to be an object with more fields, then displaying them in the ErrorBanner

Signed-off-by: Adam Christian <adam@buoyant.io>

Refactoring karma tests and propTypes and defaultProps per the code review from @rmars

Signed-off-by: Adam Christian <adam@buoyant.io>

Changing the default message to pass the ServiceMeshTest ErrorBanner assertion

Revert "Changing the default message to pass the ServiceMeshTest ErrorBanner assertion"

This reverts commit 2415b7099b03ad7a8deda9f67218bb531111b3ec.

Fixing the failing karma unit tests because the statusMessage wasn't being properly passed into the component rendering stub context

Signed-off-by: Adam Christian <adam@buoyant.io>

merging master in

Signed-off-by: Adam Christian <adam@buoyant.io>

* Export api error type independently from ApiHelpers

Signed-off-by: Adam Christian <adam@buoyant.io>
2018-08-08 15:45:08 -07:00
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