Commit Graph

1020 Commits

Author SHA1 Message Date
Andrew Seigner 7eec5f181d
Inject warns on UDP ports (#1617)
linkerd only routes TCP data, but `linkerd inject` does not warn when it
injects into pods with ports set to `protocol: UDP`.

Modify `linkerd inject` to warn when injected into a pod with
`protocol: UDP`. The Linkerd sidecar will still be injected, but the
stderr output will include a warning.

Also add stderr checking on all inject unit tests.

Part of #1516.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-09-11 10:12:45 -07:00
Kevin Lingerfelt f3301594ad
Fix landing page when there are no meshed namespaces (#1622)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-09-10 19:02:55 -07:00
Risha Mars 55402da493
Improve performance of Top tables (#1616)
_.throttle setState for receiving websocket tap events to prevent continuous rerendering

Problem 

We receive a lot of websocket events from the tap server. Previously, we
were processing each event as we received it, then calling setState after
processing to update the tables. Each call to setState triggered a re-render of
the whole table. We were rerendering multiplie times a second, causing the whole
page to become unresponsive.

Solution 

Throttle setState for receiving websocket tap events to prevent
continuous rerendering. Store the tap events in an index outside of state, and
only update the state once every specified interval (currently 500ms).

We can now view entire namespaces with Top and the page won't crash! 
To verify: Go to /top and try topping a namespace
2018-09-10 16:02:29 -07:00
Dennis Adjei-Baah 7cc64843a3
Hide scrollbars in sidebar (#1615)
When scrollbars are set to always be visible in a browser, we see them appear in the sidebar component of the dashboard.

This PR adds CSS that hides the scrollbar for WebKit browsers, i.e., Chrome and Safari and uses an overflow: hidden technique inspired by this solution to hide the scrollbar in Firefox.

fixes #1611

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2018-09-10 13:20:08 -07:00
Andrew Seigner c5a719da47
Modify inject to warn when file is un-injectable (#1603)
If an input file is un-injectable, existing inject behavior is to simply
output a copy of the input.

Introduce a report, printed to stderr, that communicates the end state
of the inject command. Currently this includes checking for hostNetwork
and unsupported resources.

Malformed YAML documents will continue to cause no YAML output, and return
error code 1.

This change also modifies integration tests to handle stdout and stderr separately.

example outputs...

some pods injected, none with host networking:

```
hostNetwork: pods do not use host networking...............................[ok]
supported: at least one resource injected..................................[ok]

Summary: 4 of 8 YAML document(s) injected
  deploy/emoji
  deploy/voting
  deploy/web
  deploy/vote-bot
```

some pods injected, one host networking:

```
hostNetwork: pods do not use host networking...............................[warn] -- deploy/vote-bot uses "hostNetwork: true"
supported: at least one resource injected..................................[ok]

Summary: 3 of 8 YAML document(s) injected
  deploy/emoji
  deploy/voting
  deploy/web
```

no pods injected:

```
hostNetwork: pods do not use host networking...............................[warn] -- deploy/emoji, deploy/voting, deploy/web, deploy/vote-bot use "hostNetwork: true"
supported: at least one resource injected..................................[warn] -- no supported objects found

Summary: 0 of 8 YAML document(s) injected
```

TODO: check for UDP and other init containers

Part of #1516

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-09-10 10:34:25 -07:00
Risha Mars 828ea29321
Fix sidebar dot colours for resources not receiving traffic (#1612)
Colour the dot gray in the sidebar if the resource isn't 
receiving traffic (i.e. success rate is null).
2018-09-07 14:26:36 -07:00
Risha Mars 761d8453a8
Add a new namespace overview page with expandable sections (#1605)
Adds a new page that shows all namespaces in an accordion. This will replace
ServiceMesh as the default landing page.

The page will request stats for all namespaces, and then pick the first meshed
namespace that's not the linkerd namespace to auto-expand in the accordion.

This branch also updates the definition of "added to the mesh" in the frontend
to be runningPodCount > 0 && meshedPodCount > 0 (previously, it was
runningPodCount === meshedPodCount, which would count resources with no pods as
"added").

I've also moved the link to /namespaces out of the top-level sidebar and into
the Resources sub-menu.
2018-09-07 13:30:52 -07:00
Kevin Lingerfelt f884caf56d
Upgrade protobuf to v1.2.0 (#1591)
* Upgrade protobuf to v1.2.0
* Fix Gopkg.lock
* Switch linkerd2-proxy-api dep back to stable

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-09-06 11:36:29 -07:00
Kevin Lingerfelt e4f14cab66
Use url query params for tap/top form filters (#1584)
* Use url query params for tap/top form filters
* Add comment explaining react-url-query onChange handlers

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-09-05 11:47:42 -07:00
Risha Mars d679c1fa0e
Error display fixes in web for the tap query handling. (#1583)
Previously, WebSocket error messages would appear with the first 
couple characters cut off. I've fixed this by using ws.WriteControl 
instead of ws.WriteMessage to write errors, as gorilla does in 
their example app.

- Use writeControl to write error messages to the client
- Stop the spinner if there is an error present
2018-09-05 10:28:59 -07:00
Dennis Adjei-Baah 127e496444
Make sidebar scrollbar independently (#1572)
For a better UI experience, the sidebar should be able to scroll independently from the detail view. This PR allows both the sidebar and the detail view to scroll independently.

fixes #1547

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2018-09-04 15:51:16 -07:00
Kevin Lingerfelt b5ff29c8aa
Add data plane check to validate proxy version (#1574)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-09-04 15:22:38 -07:00
Risha Mars 7f4fc308af
Link the resources in the Tap and Top tables to their detail pages (#1569)
Introduces a new helper, ResourceLink, that makes a prefixed link to the 
Resource Detail pages.
2018-08-31 15:53:02 -07:00
Kevin Lingerfelt c7a79da89c
Add data plane check to validate proxies are ready (#1570)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-31 15:51:57 -07:00
Risha Mars 0eaa9e4952
Tap the entire namespace if no resource is specified (#1558)
- Use an ant Select instead of Autocomplete for resource list, so that the user
can see all available tappable resources 

- Fix bug where the authority autocomplete wasn't showing any options 

- Adds "namespace/" as an option in the resource selection dropdown

This required some weird handling because we allow requests of the form
linkerd tap namespace/linkerd (taps namespace linkerd)
but not
linkerd tap namespace --namespace linkerd (does not work as intended, 
taps every namespace)
2018-08-31 15:50:48 -07:00
Risha Mars a0a2adc52c
Don't start a Top in the resource detail page if the resource is unmeshed (#1563)
Don't start a Top in the resource detail page if the resource is unmeshed.
Instead, show a call to action showing how to add linkerd.
2018-08-31 14:04:59 -07:00
Risha Mars f396459033
Remove the SocialLinks from the Sidebar (#1565)
Remove twitter, github and slack links from the sidebar.
The "Update Linkerd" menu item will still show up if there's an update.
The "Update now" button will also still show.
2018-08-31 12:34:56 -07:00
Risha Mars 41e5a76355
Update CHANGES.md for v18.8.4 release (#1562) 2018-08-30 14:09:43 -07:00
Risha Mars 249b51f950
Increase MaxRps in Tap server, remove default setting from Web (#1560)
Increase the MaxRps on the tap server to 100 RPS.

The max RPS for tap/top was increased in for the CLI #1531, but we were
still manually setting this to 1 RPS in the Web UI and Web server.

Remove the pervasive setting of MaxRps to 1 in the web frontend and server
2018-08-30 13:37:37 -07:00
Risha Mars d0c5dbd386
Fix query string in version url (#1559)
s/?/&
2018-08-30 10:57:02 -07:00
Risha Mars d3544d4064
Fix sidebar resource names not appearing (#1556)
In #1536 I removed the entire title attribute instead of removing 
the spans in the title, causing the titles to not appear.

Re-add the title text.
2018-08-29 15:57:17 -07:00
Thomas Rampelberg b0d027aeef
Allow cookies for versioncheck (#1551) 2018-08-29 15:49:57 -07:00
Risha Mars dbaf4bd3a4
Update CHANGES.md for v18.8.3 release (#1549) 2018-08-29 12:25:21 -07:00
Risha Mars 78fa120cae
Don't use prefixed fetch for version check (#1548)
In #1540 I moved the version check code and was using our prefixed version of
fetch. This is unnecessary because the version check URL doesn't depend on the
dashboard URL prefix.

TLDR Don't use prefixed fetch for version check
2018-08-29 12:17:14 -07:00
Risha Mars f9b27c7ef2
Miscellaneous small web UI fixes (#1536)
A bunch of small items. 

This branch:
- filters out un-meshed resources from the Tap and Top autocompletes
- removes an un-rendered title attribute from the sidebar menu items
- formats latency in Tap with a comma
- prevents the grafana link from showing if there are 0 pods in a deployment
2018-08-29 10:56:07 -07:00
Sebastian Tiedtke dc4c28345a Better visual distinction of inline code snippet in mesh completion message (#1539)
When the mesh completion message calls to action it prints a CLI command to copy&paste. It's visually hard to separate message from the command snippet which is what this commit fixes.

Flipped background and font color to create a better visual distinction

Successfully ran web app test suite

Signed-off-by: Sebastian Tiedtke <sebastiantiedtke@gmail.com>
2018-08-28 14:37:38 -07:00
Risha Mars 77ddd142c3
Perform linkerd version check once upon page load (#1540)
Previously, we included a version check in the server polling loop, which meant
we were hitting the version check endpoint once very 10 seconds from the
sidebar. This PR moves that check out of the loop so that we only hit it once,
upon pageload.

This PR also includes

- some whitespace fixes 
- a fix for a console error we were triggering with our tests
2018-08-28 14:36:11 -07:00
Alex Leong 0f7d684ca9
Increase default max-rps for tap and top (#1531)
The default value for the max-rps argument to the tap and top commands is an overly conservative 1rps.  This causes the data to come in very slowly and much data to be discarded.  Furthermore, because tap requests are windowed to 10 seconds, this causes long pauses between updates.

We fix this in two ways.  Firstly we reduce the window size to 1s so that updates will come in at least once per second, even when the actual RPS of the data path is extremely high.  Secondly, we increase the default max-rps parameter from 1 to 100.  This allows tap to paint an accurate picture of the data much more quickly and sidesteps some sampling bias that happens when the max-rps is low.

In general, tap events tend to happen in bursts.  For example, one request in may trigger one or more requests out.  Likewise, a single upstream event may trigger several requests to the tapped pod in quick succession.  Sampling bias will occur when the max-rps is less than the actual rps and when the tap event limit subdivides these event bursts (biasing towards the first few events in the burst).  The greater the max-rps, the less the effects of this bias.

Fixes #1525 

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-08-28 14:16:39 -07:00
Risha Mars 136b9cc7c1
Add linkerd check flag to run data plane checks (#1528)
Adds a --proxy flag to the linkerd check CLI command which will run 
to-be-implemented data plane checks
2018-08-28 10:16:24 -07:00
Risha Mars fff09c5d06
Only tap pods that are meshed (#1535)
Previously, we would tap any resource's pods, regardless of whether the pods
were meshed or not. We can't actually tap non-meshed pods, so I'm adding a check
that will filter out non-meshed pods from the pods that tap watches.

Previous behaviour:
When attempting to hang a non meshed pod, it would establish
a watch on the pods, but then never return any results. In the CLI you could
just cancel it with Ctrl-C. In the web, clicking Stop would send a
WebSocket.close(1000) but wouldn't actually close the connection... 

Behaviour after change :
If no pods under the specified resource are meshed, it'll
return an error of no pods being found to tap
2018-08-28 09:59:52 -07:00
Dennis Adjei-Baah 097632a2f0
Add kubernetes style sidebar (#1500)
Linkerd CLI's "look and feel" is similar to Kubernetes kubectl CLI. Linkerd's dashboard can be extended to match Kubernetes dashboard UI.

This PR serves as a starting point for this work. The new sidebar shows all resources from all namespaces on initial page load. Resources can be filtered to show only items in a given namespace. The sidebar displays authority, deployment, service and, pod resources. We may need to think about whether it is necessary to show all resources types. Some resources, i.e. authorities, contain a large cardinality of resource details and may not be very useful to a user.

fixes #1449

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2018-08-27 12:59:37 -07:00
Risha Mars 27e52a6cc0
Add ReadinessProbe and LivenessProbe to injected proxy containers (#1530)
Adds basic probes to the linkerd-proxy containers injected by linkerd inject.

- Currently the Readiness and Liveness probes are configured to be the same. 
- I haven't supplied a periodSeconds, but the default is 10.
- I also set the initialDelaySeconds to 10, but that might be a bit high.

https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
2018-08-27 11:55:17 -07:00
Alex Leong 1f42996889
Document tps-reports (#1509)
It's not obvious from the name what the tps-reports API endpoint does.

Added a few comments to clarify.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-08-24 13:26:35 -07:00
Risha Mars 1d3580ba0c
Add success rate visuals to the octopus graph (#1519)
Add gauge chart to octopus cards
2018-08-24 10:10:27 -07:00
Kevin Lingerfelt de71132c21
Remove doc dir in favor of linkerd/website repo (#1511)
* rm doc dir in favor of linkerd/website repo
* Add note about doc source code in README

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-23 21:53:09 -07:00
Risha Mars 63be9b1a3d
Add top link to sidebar, fix js error (#1508)
- Add a link to Top in the sidebar
- Fix a console error caused by having duplicate react keys
2018-08-22 18:19:17 -07:00
Risha Mars 3fde755a8f
Add top request table to resource detail page (#1507)
Includes a substantial refactor of Top.jsx to move the websocket
and top-request-aggregation code into a self-contained module
so that this code can be shared by /top and by each resource
detail page.

(This refactor also helps separate concerns in that
page; since that page also makes 10 second requests to the stat
api to populate the autocompletes in the form).

The TopModule uses the startTap prop to figure out whether it
should start a websocket connection and make a tap request
when mounted. (This is because the resource detail pages
start tapping immediately upon load, whereas /top can only
start once you've entered a query.

I've removed the spinner and the awaitingWebSocketConnection
state field because that now belongs in the top module. I think a
similar refactor of tap would be good before we re-add it.
2018-08-22 18:18:35 -07:00
Kevin Lingerfelt 211fca1806
Update CHANGES.md for v18.8.2 release (#1506)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-22 12:59:20 -07:00
Kevin Lingerfelt 4450a7536d
Add --wait flag for CLI check and dashboard commands (#1503)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-22 12:56:42 -07:00
Kevin Lingerfelt 49f6c4c770
Refactor healthcheck init and observe setup (#1502)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-22 12:30:45 -07:00
Risha Mars 062d35db7d
Start tweaking the look and feel of the Octopus graph (#1501)
Do a little more work to get the octopus graph closer to the mocks.
This version gives you a slightly better navigational sense of where 
you are in the app, and gives you a clearer
view of the neighbouring stats
2018-08-22 10:43:27 -07:00
Risha Mars cc98b5e784
Add the basis for an octopus graph to resource detail page (#1494)
Add a basic top graph depicting the current resource's stats 
and it's upstreams and downstreams. 

Also add upstreams and downstreams tables for this resource

This will be styled more later, but just getting the basic components 
and data onto the page.
2018-08-21 15:01:34 -07:00
Kevin Lingerfelt 5fc63cde10
Add check for running pods in control plane namepsace (#1498)
* Add check for running pods in control plane namepsace
* Better pod validation logic

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-21 14:36:49 -07:00
Risha Mars da07d5db14
Add pod table to resource detail page (#1491)
Add a pod table to the Resource Detail page showing metrics 
for pods belonging to a resource.

In the future, I think we'll modify the stat summary endpoint to 
take multiple resources as arguments, and have the resource detail page 
first query for the pods associated with the resource and then 
query for stats for those pods.

See #1467 for discussion.

This PR also modifies the queries to not use the withREST component, in anticipation of the above changes.
2018-08-21 11:38:34 -07:00
Eliza Weisman efabd90ff7
Fix missing ns/svc labels in metadata hydrated by Tap server (#1496)
Fixes #1493.

When the tap server hydrates metadata for the source or destination peer
of a Tap event from the peer's IP address, it doesn't currently add a
namespace label. However, destinations labeled by the proxy do have such
a label.

This is because the tap server currently gets the hydrated labels from
the `GetPodLabels` function, which is also used by the Destination
service for labeling the individual endpoints in a `WeightedAddrSet`
response. However, the Destination service also adds some labels to all
the endpoints in the set, including the namespace and service, so
`GetPodLabels` doesn't return these labels. However, when the tap server
uses that function, it does not add the service or namespace labels.

This branch fixes this issue by adding those labels to the Tap event 
after calling `GetPodLabels`. In addition, it fixes a missing space 
between the `src/dst_res` and `src/dst_ns` labels in Tap CLI output
with the `-o wide` flag set. This issue was introduced during the 
review of #1437, but was missed at the time because the namespace label
wasn't being set correctly.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-08-20 18:09:34 -07:00
Kevin Lingerfelt 53cd3b50d5
Add --pre flag for linkerd check command (#1497)
* Add --pre flag for linkerd check command
* Small adjustments to check help text

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-20 17:09:43 -07:00
Kevin Lingerfelt e97be1f5da
Move all healthcheck-related code to pkg/healthcheck (#1492)
* Move all healthcheck-related code to pkg/healthcheck
* Fix failed check formatting
* Better version check wording

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-20 16:50:22 -07:00
Eliza Weisman b8434d60d4
Add resource metadata to Tap CLI output (#1437)
Closes #1170.

This branch adds a `-o wide` (or `--output wide`) flag to the Tap CLI.
Passing this flag adds `src_res` and `dst_res` elements to the Tap
output, as described in #1170. These use the metadata labels in the tap
event to describe what Kubernetes resource the source and destination
peers belong to, based on what resource type is being tapped, and fall
back to pods if either peer is not a member of the specified resource
type.

In addition, when the resource type is not `namespace`, `src_ns` and
`dst_ns` elements are added, which show what namespaces the the source
and destination peers are in. For peers which are not in the Kubernetes
cluster, none of these labels are displayed.

The source metadata added in #1434 is used to populate the `src_res` and
`src_ns` fields.

Also, this branch includes some refactoring to how tap output is
formatted.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-08-20 14:25:26 -07:00
Kevin Lingerfelt 7c07ba0d53
Upgrade to dep 0.5.0, go 1.10.3 (#1479)
* Upgrade to dep 0.5.0, go 1.10.3
* Remove existing dep binary if it's the wrong version
* Add version in filename of dep binary to prevent version conflicts

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-17 16:04:50 -07:00
Risha Mars d1ab629953
Add grafana icon to links, refactor svgs, link to ResourceDetail component (#1482)
This PR started out as a PR to link to our Resource Detail dashboard in 
addition to grafana in the resource list pages, but I decided to refactor 
the way we deal with our svgs since I was here.

This branch:
- modifies the GrafanaLink component to consist of the grafana icon 
that links to grafana adds links to the ResourceDetail page in all our metrics tables
- adds a jsx component we can use to wrap svgs so that we don't get 
annoying 404s on images that we have to handle
- remove the relative paths hack for images
- removes unused svg files in /img
2018-08-17 15:12:33 -07:00