Commit Graph

1503 Commits

Author SHA1 Message Date
Alejandro Pedraza eacc09b7ba
Follow up to #2054: move magic strings into constants (#2122)
Follow up to #2054: move magic strings into constants

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-22 14:53:24 -05:00
Alejandro Pedraza a5628780f7
Fix dupe word in example (#2121)
Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-22 13:43:31 -05:00
Andrew Seigner 50d181cfb8
Add release notes for edge-19.1.2 release (#2096)
Depends on #2037, #2038, #2063, #2066, #2087, #2089, #2105

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-17 14:10:59 -08:00
Risha Mars 2adcdfbca8
Add display chips to the resource detail page to provide more detail (#2063)
* Simplify syntax for state variable access

* Add a warning chip if a resource isn't receiving traffic
Also add a meshed chip to the resource detail pages
2019-01-17 13:58:15 -08:00
Eliza Weisman 53f8bb5a15
proxy: bump pinned version to fix a h2 bug (#2105)
- Update h2 to 0.1.15 (linkerd/linkerd2-proxy#172)

carllerche/h2#338 fixes a deadlock in stream reference counts that could
potentially impact the proxy. linkerd/linkerd2-proxy@6df55c0 updates our 
`h2` dependency to a version which includes this change.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-01-17 12:17:02 -08:00
Kevin Lingerfelt 1989e28d8f
Add newline separator above uninject reports (#2104)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-17 11:12:54 -08:00
Alejandro Pedraza bd1955c317 When injecting, perform an uninject as a first step (#2089)
* When injecting, perform an uninject as a first step

Fixes #1970

The fixture `inject_emojivoto_already_injected.input.yml` is no longer
rejected, so I created the corresponding golden file.

Note that we'll still forbid injection over resources already injected
with third party meshes (Istio, Contour), so now we have
`HasExisting3rdPartySidecars()` to detect that.

* Generalize HasExistingSidecars() to cater for both the auto-injector and
* Convert `linkerd uninject` result format to the one used in `linkerd inject`.
* More updates to the uninject reports. Revert changes to the HasExistingSidecars func.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-17 10:15:23 -08:00
Dennis Adjei-Baah f9cd9366d9
Surface logs from control plane pods (#2037)
When debugging control plane issues or issues pertaining to a linkerd proxy, it can be cumbersome to get logs from affected containers quickly. 

This PR adds a new `logs` command to the Linkerd CLI to surface log lines from any container within linkerd's control plane. This feature relies heavily on [stern](https://github.com/wercker/stern), which already provides this behavior. This PR integrates this package into the Linkerd CLI to allow users to quickly retrieve logs whenever they run into issues when using Linkerd. 

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2019-01-16 19:24:42 -08:00
Alex Leong a562f8b9fd
Improve routes command to list all routes (#2066)
Fixes #1875 

This change improves the `linkerd routes` command in a number of important ways:

* The restriction on the type of the `--to` argument is lifted and any resource type can now be used.  Try `--to ns/books`, `--to po/webapp-ABCDEF`, `--to au/linkerd.io`, or even `--to svc`.
* All routes for the target will now be populated in the table, even if there are no Prometheus metrics for that route.
* [UNKNOWN] has been renamed to [DEFAULT]
* The `Service/Authority` column will now list `Service` in all cases except for when an authority target is explicitly requested.

```
$ linkerd routes deploy/traffic --to deploy/webapp
ROUTE                       SERVICE   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99
GET /                        webapp   100.00%   0.5rps          50ms         180ms         196ms
GET /authors/{id}            webapp   100.00%   0.5rps         100ms         900ms         980ms
GET /books/{id}              webapp   100.00%   0.9rps          38ms          93ms          99ms
POST /authors                webapp   100.00%   0.5rps          35ms          48ms          50ms
POST /authors/{id}/delete    webapp   100.00%   0.5rps          83ms         180ms         196ms
POST /authors/{id}/edit      webapp     0.00%   0.0rps           0ms           0ms           0ms
POST /books                  webapp    45.16%   2.1rps          75ms         425ms         485ms
POST /books/{id}/delete      webapp   100.00%   0.5rps          30ms          90ms          98ms
POST /books/{id}/edit        webapp    56.00%   0.8rps          92ms         875ms         975ms
[DEFAULT]                    webapp     0.00%   0.0rps           0ms           0ms           0ms
```

This is all made possible by a shift in the way we handle the destination resource.  When we get a request with a `ToResource`, we use the k8s API to find all Services which include at least one pod belonging to that resource.  We then fetch all service profiles for those services and display the routes from those serivce profiles.  

This shift in thinking also precipitates a change in the TopRoutes API where we no longer need special cases for `ToAll` (which can be specified by `--to au`) or `ToAuthority` (which can be specified by `--to au/<authority>`) and instead can use a `ToResource` to handle all cases.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-01-16 17:15:35 -08:00
Andrew Seigner 92f2cd9b63
Update check and inject output (#2087)
The outputs of the `check` and `inject` commands did not vary much
between successful and failed executions, and were a bit verbose and
challenging to parse.

Reorganize output of `check` and `inject` commands, to provide more
output when errors occur, and less output when successful.

Specific changes:

`linkerd check`
- visually group checks by category
- introduce `hintURL`'s, to provide doc links when checks fail
- add spinners when retrying, remove additional retry lines
- colored unicode characters to indicate success/warning/failure

`linkerd inject`
- modify default output to mirror `kubectl apply`
- only output non-successful inject reports
- support `--verbose` flag to output all inject reports

Fixes #1471, #1653, #1656, #1739

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-16 15:14:14 -08:00
Alex Leong 771542dde2
Add support for retries (#2038) 2019-01-16 14:13:48 -08:00
Alex Leong 3398e9391a
Fix panic when swagger has no paths (#2092)
Fixes #2059

Fix a panic in linkerd profile --open-api when the swagger spec has no Paths field.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-01-16 13:39:51 -08:00
Andrew Seigner af47232eda
Hash JS bundle to expire cache (#2058)
JavaScript assets could be cached across Linkerd releases, showing an
out of date ui, or a broken page.

Modify the webpack build pipeline to add a hash to the JS bundle
filename. Move all logic around webpack-dev-server state from Go into
JS, via a templatized index_bundle.js file, generated at build time.
Disable caching of index_bundle.js in Go, via a `Cache-Control` header.

Fixes #1996

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-16 12:59:30 -08:00
Andrew Seigner dacd8819ff
Group checkers by category (#2083)
The linkerd check command organized the various checks via loosely
coupled category IDs, category names, and checkers themselves, all with
ordering defined by consumers of this code.

This change removes category IDs in favor of category names, groups all
checkers by category, and enforces ordering at the HealthChecker
level.

Part of #1471, depends on #2078.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-14 18:01:32 -08:00
Andrew Seigner 04373414ef
Modify all health checks to be specified via enums (#2078)
The set of health checks to be executed were dependent on a combination
of check enums and boolean options.

This change modifies the health checks to be governed strictly by a set
of enums.

Next steps:
- tightly couple category IDs to names
- tightly couple checks to their parent categories
- programmatic control over check ordering

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-14 17:16:15 -08:00
Kevin Lingerfelt 6a3f4a1a99
Leave dashboard command running when open URL fails (#2081)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-14 16:46:11 -08:00
Kevin Lingerfelt 996fd2b013
Wire up grafana proxying in web dev environment (#2070)
* Wire up grafana proxying in web dev environment
* Update based on review feedback

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-14 16:45:47 -08:00
Alejandro Pedraza d358605269
Added `linkerd uninject` command (#2054)
Add `linkerd uninject` command

uninject.go iterates through the resources annotations, labels,
initContainers and Containers, removing what we know was injected by
linkerd.

The biggest part of this commit is the refactoring of inject.go, to make
it more generic and reusable by uninject.

The idea is that in a following PR this functionality will get reused by
`linkerd inject` to uninject as as preliminary step to injection, as a
solution to #1970.

This was tested successfully on emojivoto with:

```
1) inject:
kubectl get -n emojivoto deployment -o yaml | bin/linkerd inject - |
kubectl apply -f -
2) uninject:
kubectl get -n emojivoto deployment -o yaml | bin/linkerd uninject - |
kubectl apply -f -
```

Also created unit tests for uninject.go. The fixture files from the inject
tests could be reused. But as now the input files act as outputs, they
represent existing resources and required these changes (that didn't
affect inject):
  - Rearranged fields in alphabetical order.
  - Added fields that are only relevant for existing resources (e.g.
    creationTimestamp and status.replicas in StatefulSets)

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-14 17:39:31 -05:00
Kevin Lingerfelt 21d9397380
Update CHANGES.md for the edge-19.1.1 release (#2065)
* Update CHANGES.md for the edge-19.1.1 release
* Tweak wording / punctuation
* Update wording for proxy fixes

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-10 15:55:12 -08:00
Dennis Adjei-Baah f4b5789825
Send non-zero status code when proxy-init command fails (#2064)
* send non-zero status code when the proxy-init command fails

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2019-01-10 15:48:42 -08:00
Eliza Weisman 717bdc0796
proxy: bump version to fix memory leak
- Update to trust-dns-resolver 0.10.1 (linkerd/linkerd2-proxy#169)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-01-10 13:08:30 -08:00
Kevin Lingerfelt ed3fbd75f3
Setup port-forwarding for linkerd dashboard command (#2052)
* Setup port-forwarding for linkerd dashboard command
* Output port-forward logs when --verbose flag is set

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-10 10:16:08 -08:00
Alena Varkockova 172398292d Add validation to CRD for service profiles (#2024)
* Add validation to CRD for service profiles

Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>

* Use properties instead of oneof

Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
2019-01-10 07:04:40 -08:00
Alejandro Pedraza 281ba37e6d
More granular control on checks made by CLI commands (#2033)
Have the CLI commands `get`, `routes`, `stat`, `tap`and `top` perform a more limited set of checks 

Fixes #1854
2019-01-10 09:13:44 -05:00
Kevin Lingerfelt 2c025d2783
Upgrade webpack-dev-server to v3.1.14 (#2053)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-09 11:07:53 -08:00
Risha Mars db0876a039 Add SpeedMeasurePlugin to measure the speed of webpack builds (#2051) 2019-01-08 17:41:49 -08:00
Eliza Weisman 3b6d02a4b6
Pin the `area/test` label (#2050)
The `area/test` issue label contains a lot of tickets decribing areas of
the codebase that need more tests, or flaky test behaviours. These
issues are often fairly low-priority, so they usually aren't closed
right away, but rarely become invalid. In my opinion, it's good for
these issues to remain open so that those test deficiencies are clearly
documented.

This branch adds the `area/test` label to the list of labels ignored by
stalebot, so that they aren't closed after being left inactive.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-01-08 13:05:10 -08:00
Risha Mars 4e47e261fc
Only index top results for which we have the full request (#2045) 2019-01-08 13:26:22 -05:00
Kevin Lingerfelt a27bb2e0ce
Proxy grafana requests through web service (#2039)
* Proxy grafana requests through web service
* Fix -grafana-addr default, clarify -api-addr flag
* Fix version check in grafana dashboards
* Fix comment typo

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-04 16:07:57 -08:00
Andrew Seigner 4b973c9101
Doc fixup following #2044 (#2046)
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-04 14:47:24 -08:00
Andrew Seigner 74d5fb32dd
Set default integration ns to l5d-integration (#2044)
The default integration test namespace was `linkerd`.

Modify this default to `l5d-integration`, to minimize risk of
conflicting with an existing linkerd installation.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-04 14:11:30 -08:00
Risha Mars 884ae67314
Reduce webpack bundle size: remove react prop types in production builds (#2036)
* Remove react prop types in production builds

Use babel-plugin-transform-react-remove-prop-types to
slim down the production build
2019-01-04 16:05:48 -05:00
Risha Mars a397393996
reduce webpack bundle size: replace moment with date-rns (#2035)
Replace the moment.js date library with a smaller one (date-fns).
Has the added advantage that we no longer need to supress all of
moment's locales.
2019-01-04 15:51:22 -05:00
Kevin Lingerfelt fcd7c9bf5c
Fix lodash error on namespace landing page (#2043)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-01-04 12:32:46 -08:00
Alejandro Pedraza 8639a8753f
Fix reporting of injected resources (#2031)
* Fix reporting of injected resources

When reporting resources provided as a list, it was picking just one
item from the list and ignoring the rest.
Also improved test for injecting list of resources.

Fixes #1676

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-03 15:14:11 -05:00
Risha Mars 07f27656f7
Reduce webpack bundle size: import d3 modules individually (#2030)
Previously, we were importing all of d3, but we don't need a lot of it. 
This branch switches our imports to only the things we need.
2019-01-03 14:10:14 -05:00
Risha Mars a609dd5894
Reduce webpack bundle size: import lodash by module (#2028)
Imports lodash function individually, eliminate 'import _ from lodash'

This branch replaces imports of all of lodash (import _ from 'lodash' with per
function imports e..g import _isNil from 'lodash/isNil'. This reduces the bundle
size from~520 kb to ~160kb.

I've also taken the opportunity to replace our use of lodash functions with
native js functions where it makes sense (e.g. some maps, concats, sizes).
2019-01-03 13:50:46 -05:00
Andrew Seigner a91c77d0bf
Followups from lint/comment changes (#2032)
This is a followup branch from #2023:
- delete `proxy/client.go`, move code to `destination-client`
- move `RenderTapEvent` and stat functions from `util` to `cmd`

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-02 15:28:09 -08:00
Andrew Seigner 1c302182ef
Enable lint check for comments (#2023)
Commit 1: Enable lint check for comments

Part of #217. Follow up from #1982 and #2018.

A subsequent commit will fix the ci failure.

Commit 2: Address all comment-related linter errors.

This change addresses all comment-related linter errors by doing the
following:
- Add comments to exported symbols
- Make some exported symbols private
- Recommend via TODOs that some exported symbols should should move or
  be removed

This PR does not:
- Modify, move, or remove any code
- Modify existing comments

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-02 14:03:59 -08:00
Alena Varkockova ef02cd6828 Disallow both pre and proxy flags for check (#2026)
Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
2019-01-02 13:36:04 -08:00
Andrew Seigner a9511aba06
Add go-report-card badge to README.md (#2020)
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-12-20 16:42:54 -08:00
Kevin Lingerfelt 42fa9e90a1
Add release notes for edge-18.12.4 release (#2019)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-20 15:46:38 -08:00
Kevin Lingerfelt f1b0983f72
Add go linting to CI config (#2018)
* Add go linting to CI config
* Fix lint warnings
* Add note about bin/lint script in TEST.md

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-20 15:33:09 -08:00
Kevin Lingerfelt 20bb1bbc55
Bump pinned proxy version (#2015)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-20 12:38:18 -08:00
Thomas Rampelberg 612ebe2b81
Add rules_file loading into prometheus (#1966) 2018-12-20 11:47:13 -08:00
Radu M 07cbfe2725 Fix most golint issues that are not comment related (#1982)
Signed-off-by: Radu Matei <radu@radu-matei.com>
2018-12-20 10:37:47 -08:00
Kevin Lingerfelt 10d5ebd064
Fix flaky certificate controller test (#2009)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-19 17:10:17 -08:00
Risha Mars d48a473985
Remove less and post-css from the project (#2002)
Since we've switched to using css-in-js styling with material, we have very
little need for additional css libraries so support our ~30 lines of css. I'm
removing them in favour of a simpler configuration and inline styles.
2018-12-19 16:34:04 -08:00
Risha Mars 5e7522b848
Fix update neighbors function not being passed in to top module (#2008) 2018-12-19 15:50:57 -08:00
Risha Mars 0318590c07
Start reducing webpack bundle size, fix minor bugs (#1995)
- Adds bundle analyzer so we can see the composition of our bundle. 
- Stop importing all the locales of moment.js 
- Use named imports for all places we use material-ui components
- Fix a bug where, due to the controller components being relabled
linkerd-, the service mesh page wasn't showing the correct statuses. 
- Fixes some eslint warnings on tests
2018-12-19 12:51:02 -08:00