Commit Graph

421 Commits

Author SHA1 Message Date
Alex Leong d6ef9ea460
Update ServiceProfile CRD to version v1alpha2 and remove validation (#3078)
The openAPIV3Schema validation in the ServiceProfiles CRD is very limited in what it can validate and is obviated by more sophisticated validation done by the validating admission controller.  Therefore, we would like to remove the openAPIV3Schema validation to reduce the size and complexity of the CRD object.

To do so, we must also bump the version of the ServiceProfile custom resource from v1alpha1 to v1alpha2.  This ensures that when the controller is upgraded, it will attempt to watch the v1alpha2 resource.  If it cannot (because, for example, the controller pod started before the ServiceProfile CRD was updated and therefore the v1alpha2 version does not exist) then it will go into a crash loop backoff until it can.  This essentially means that the controller will wait for the CRD to be upgraded to include v1alpha2 before it will start.  

Bumping the version is necessary because if we did not, it would be possible for the controller to start before the CRD is updated (removing the validation).  In this case, when the CRD is edited, the controller will lose its list watch on ServiceProfiles and will stop getting updates.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-07-23 11:46:31 -07:00
dependabot[bot] 811d173174 Bump lodash from 4.17.11 to 4.17.13 in /web/app (#3086)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13 due to
security issue.

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-15 10:51:04 -07:00
dependabot[bot] 928d222a9c Bump lodash.merge from 4.6.1 to 4.6.2 in /web/app (#3073)
Bumps lodash.merge from 4.6.1 to 4.6.2 to fix security vulnerability.

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-12 11:08:12 -07:00
Alex Leong 92ddffa3c2
Add prometheus metrics for watchers (#3022)
To give better visibility into the inner workings of the kubernetes watchers in the destination service, we add some prometheus metrics.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-07-08 11:50:26 -07:00
Carol A. Scott a504e8c2d8
Expand and improve edges API endpoint (#3007)
Updates functionality of `linkerd edges`, including a new `--all-namespaces`
flag and returning namespace information for SRC and DST resources.
2019-06-28 15:46:04 -07:00
Alex Leong 27373a8b78
Add traffic splitting to destination profiles (#2931)
This change implements the DstOverrides feature of the destination profile API (aka traffic splitting).

We add a TrafficSplitWatcher to the destination service which watches for TrafficSplit resources and notifies subscribers about TrafficSplits for services that they are subscribed to.  A new TrafficSplitAdaptor then merges the TrafficSplit logic into the DstOverrides field of the destination profile.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-06-28 13:19:47 -07:00
Carol A. Scott 210ab81fed
Improve UI for Edges table in dashboard (#2995)
This PR improves the UI for the Edges table in the dashboard, including changing column names, adding a "Secured" icon and showing an empty Edges table in the case of no returned edges.
2019-06-26 16:57:18 -07:00
dependabot[bot] 2ca8fbcb8c Bump eslint from 4.12.1 to 4.18.2 in /web/app (#2978)
Bumps [eslint](https://github.com/eslint/eslint) from 4.12.1 to 4.18.2.

Signed-off-by: dependabot[bot] <support@github.com>
2019-06-25 10:55:53 -07:00
Carol A. Scott 2fe056f2bc
Adding context to log warning (#2977)
Adding context to UUID log warning when running web server in development mode.
Fixes #2974
2019-06-21 11:45:45 -07:00
Carol A. Scott dce462acd9
Add Edges table to resource detail view of dashboard (#2965)
Adds an Edges table to the resource detail view that shows the source,
destination name and identity for proxied connections to and from the resource
shown.
2019-06-20 10:50:11 -07:00
Alejandro Pedraza 928d4cb522
Remove unimplemented debug page on dashboard (#2952)
* Remove unimplemented debug page on dashboard

Fixes #2895

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-06-17 14:43:09 -05:00
Carol A. Scott 1ec9058f85
Importing specific font-awesome icons instead of the full CSS stylesheet and webfonts (#2917)
This PR allows components to import specific FontAwesome icons using the
@fortawesome/react-fontawesome library. This cuts down on package size and the
number of files loaded.
2019-06-17 11:41:44 -07:00
Risha Mars a46e69ce6e
Fix BaseTable ignoring sorting order (#2923)
I noticed that the tables weren't maintaining sort order.
This branch fixes sorting by using lodash orderBy.

Before: Look at the tables, for example in the Service Mesh page, the meshed
resource table, or in Top Routes. Note that both these tables have a default
sort order, but do not appear sorted.

After: These tables should be sorted by their default order.
2019-06-12 13:35:41 -07:00
Alex Leong c698d6bca1
Add support for TrafficSplits (#2897)
Add support for querying TrafficSplit resources through the common API layer. This is done by depending on the TrafficSplit client bindings from smi-sdk-go.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-06-11 10:04:42 -07:00
Carol A. Scott 47718c508a
Upgrade packages and fix package security vulnerability (#2903)
Updates and pins package version numbers in `package.json` to reflect the actual
versions in `yarn.lock`. Pins `react-iframe` to `1.7.16` and `jest` to `23.6.0`
- in both cases, there are later versions but they include breaking changes.
Modifies `webpack.config.js` to work with the updated `css-loader` library.
Fixes #2908.
2019-06-10 16:45:51 -07:00
Alex Leong 06a69f69c5
Refactor destination service (#2786)
This is a major refactor of the destination service.  The goals of this refactor are to simplify the code for improved maintainability.  In particular:

* Remove the "resolver" interfaces.  These were a holdover from when our decision tree was more complex about how to handle different kinds of authorities.  The current implementation only accepts fully qualified kubernetes service names and thus this was an unnecessary level of indirection.
* Moved the endpoints and profile watchers into their own package for a more clear separation of concerns.  These watchers deal only in Kubernetes primitives and are agnostic to how they are used.  This allows a cleaner layering when we use them from our gRPC service.
* Renamed the "listener" types to "translator" to make it more clear that the function of these structs is to translate kubernetes updates from the watcher to gRPC messages.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-06-04 15:01:16 -07:00
Alejandro Pedraza 74ca92ea25
Split proxy-init into separate repo (#2824)
Split proxy-init into separate repo

Fixes #2563

The new repo is https://github.com/linkerd/linkerd2-proxy-init, and I
tagged the latest there `v1.0.0`.

Here, I've removed the `/proxy-init` dir and pinned the injected
proxy-init version to `v1.0.0` in the injector code and tests.

`/cni-plugin` depends on proxy-init, so I updated the import paths
there, and could verify CNI is still working (there is some flakiness
but unrelated to this PR).

For consistency, I added a `--init-image-version` flag to `linkerd
inject` along with its corresponding override config annotation.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-06-03 16:24:05 -05:00
cpretzer 8bb67b4820
2817 enable shorthands for lodash (#2818)
* * Update webpack-dev-server to "^3.2.0" in package.json with generated yarn.lock file

* * Update webpack-dev-server to "^3.2.0" in package.json with generated yarn.lock file

Signed-off-by: cpretzer <charles@buoyant.io>

* * #2817 enable shorthands for lodash

Signed-off-by: cpretzer <charles@buoyant.io>

* * #2817 enable shorthands for lodash

Signed-off-by: cpretzer <charles@buoyant.io>

* Pin webpack-dev-server to version 3.3.1

Signed-off-by: Charles Pretzer <charles@buoyant.io>

* Subject:
Remove unnecessary linting configs and rules for lodash

Problem:
Work related to supporting newer versions of node allows for the removal of lodash linting

Solution:
Remove lodash lint rules
Remove eslint-plugin-lodash from package.json
Remove lodash from plugins section of .eslintrc

Validation:
Ran all build commands (setup, dev, and run) with node versions 12 and 10

Fixes #2817 #2809

Signed-off-by: Charles Pretzer <charles@buoyant.io>

* Signed-off-by: Charles Pretzer <charles@buoyant.io>

Update yarn.lock after merge with master
2019-05-30 17:30:58 +02:00
Carol A. Scott 13f2698033
Hide Authorities table and Authorities sidebar link on dashboard (#2856)
Fixes #2103. Hides the Authorities table in the Overview and Namespace views on
the dashboard, and removes the link to Authorities in the Resources sidebar.
This change makes way for a future dashboard view incorporating traffic split
data and communicating Authority data in a more understandable way.
2019-05-29 15:38:48 -07:00
dependabot[bot] 36be71fd9e Bump webpack-bundle-analyzer from 3.0.3 to 3.3.2 in /web/app (#2857)
Bumps [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) from 3.0.3 to 3.3.2. This PR was generated by GitHub's Dependabot: https://github.com/apps/dependabot
2019-05-28 15:23:26 -07:00
Dennis Adjei-Baah a0fa1dff59
Move tap service into its own pod. (#2773)
* Split tap into its own pod in the control plane

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2019-05-15 16:28:44 -05:00
Andrew Seigner 0cfc8c6f1c
Introduce k8s apiextensions support (#2759)
CustomResourceDefinition parsing and retrieval is not available via
client-go's `kubernetes.Interface`, but rather via a separate
`k8s.io/apiextensions-apiserver` package.

Introduce support for CustomResourceDefintion object parsing and
retrieval. This change facilitates retrieval of CRDs from the k8s API
server, and also provides CRD resources as mock objects.

Also introduce a `NewFakeAPI` constructor, deprecating
`NewFakeClientSets`. Callers need no longer be concerned with discreet
clientsets (for k8s resources vs. CRDs vs. (eventually)
ServiceProfiles), and can instead use the unified `KubernetesAPI`.

Part of #2337, in service to multi-stage check.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-28 18:55:22 -07:00
Gaurav Kumar aaeb8a7df3 Add Font Awesome stylesheet locally (#2620)
Makes the Font Awesome CSS stylesheet available offline. Users loading the dashboard with no/limited internet will see both the Font Awesome and Material-UI sidebar icons consistently. Before, only the Material-UI icons were available offline.

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
2019-04-24 17:23:47 -07:00
Andrew Seigner 72287ae121
Don't use spinner in cli when run without a tty (#2716)
In some non-tty environments, the `linkerd check` spinner can render
unexpected control characters.

Disable the spinner when run without a tty.

Fixes #2700

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-18 09:31:56 -07:00
Carol A. Scott b98ce335db
Making "overview" view of dashboard functional on mobile devices (#2678)
Makes the "overview" view of the Linkerd dashboard functional on mobile devices, with responsive tables and a minimized sidebar. 
Also lines up the sidebar icons and makes them a uniform size on both desktop and mobile views.
This is a first step towards a fully-responsive dashboard.
2019-04-11 12:00:21 -07:00
Alex Leong 98a74bccc3
Rename proxy-api to destination on debug page (#2652)
Signed-off-by: Alex Leong <alex@buoyant.io>
2019-04-10 15:06:57 -07:00
Kevin Lingerfelt e395803ce2
Allow web server to load without install config (#2668)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-04-08 13:24:44 -07:00
Carol A. Scott d4e955f805
Updating webdriverio libraries (#2665)
Updates the WebdriverIO libraries used in the front-end integration tests so that officially-supported libraries are used where possible.
2019-04-08 13:19:50 -07:00
Katerina 938d64a16f Web server updated to read the UUID from the linkerd-config ConfigMap. (#2603)
Signed-off-by: Kateryna Melnyk <kattymelnyk@gmail.com>
2019-04-08 12:56:00 -07:00
Oliver Gould ba65bd8039
Switch UUID implementation (#2667)
The UUID implementation we use to generate install IDs is technically
not random enough for secure uses, which ours is not. To prevent
security scanners like SNYK from flagging this false-positive, let's
just switch to the other UUID implementation (Already in our
dependencies).
2019-04-08 10:58:02 -07:00
Alejandro Pedraza edb225069c
Add validation webhook for service profiles (#2623)
Add validation webhook for service profiles

Fixes #2075

Todo in a follow-up PRs: remove the SP check from the CLI check.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-04-05 16:10:47 -05:00
Risha Mars 4b3d21aa27
Fix check for empty metrics that always returned false (#2645)
Problem:
In #2532 I removed the Tap/Top tables if there was no http traffic, but the
check I used depended on a stats object being present in the processed metrics
(spoiler: it isn't present in the processed metrics). 

Solution:
Use a better check for no traffic. 
The new check checks for both no requests (so nil request rate) and
also no latency (in the case that the service is http but receiving no traffic).

Fixes #2641
2019-04-05 12:15:43 -07:00
Carol A. Scott 05a899fc21
Fixing bin/web test (#2621)
Fixes bin/web test by restoring a preset to the Babel config file.
2019-04-02 17:02:15 -07:00
Carol A. Scott 982d629552
Removing TLS columns from tables in dashboard (#2611)
This PR closes #2608. It removes the TLS columns from the dashboard tables and updates the associated tests.
2019-04-02 16:54:39 -07:00
Carol A. Scott 0251f50fa4
Adding local and cloud integration testing for dashboard (#2586)
Adds local and cloud integration testing for the dashboard using WebdriverIO and
SauceLabs. Includes documentation on how to set up and run the Sauce Connect
proxy locally. Adds a `bin/web integration` script that takes `local` or `cloud`
arguments to run the tests. 

Note: for web development, the web server launched by `bin/web run` and `bin/web
dev` is now 7777, not 8084, because the Sauce Connect proxy can only tunnel to
certain ports.
2019-03-29 15:48:00 -07:00
Gaurav Kumar 23454d248d Add validation to the Service Profile form (#2490) (#2514)
Fixes #2490

The following PR adds validation to the New Service Profile popup form in the linkerd dashboard for the service and namespace user input.

* Add validation to the Service Profile form (#2490)

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>

* Change RegExp to handle all cases

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>

* Fix link and error msg issue

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>

* Refactor code

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>

* Revert to onBlur and remove warning on field clear

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>

* Refactor code to make it more readable

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>

* Reset state to initialstate on form close

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
2019-03-29 14:57:52 -07:00
Oliver Gould 655632191b
config: Store install parameters with global config (#2577)
When installing Linkerd, a user may override default settings, or may
explicitly configure defaults. Consider install options like `--ha
--controller-replicas=4` -- the `--ha` flag sets a new default value for
the controller-replicas, and then we override it.

When we later upgrade this cluster, how can we know how to configure the
cluster?

We could store EnableHA and ControllerReplicas configurations in the
config, but what if, in a later upgrade, the default value changes? How
can we know whether the user specified an override or just used the
default?

To solve this, we add an `Install` message into a new config.
This message includes (at least) the CLI flags used to invoke
install.

upgrade does not specify defaults for install/proxy-options fields and,
instead, uses the persisted install flags to populate default values,
before applying overrides from the upgrade invocation.

This change breaks the protobuf compatibility by altering the
`installation_uuid` field introduced in 9c442f6885.
Because this change was not yet released (even in an edge release), we
feel that it is safe to break.

Fixes https://github.com/linkerd/linkerd2/issues/2574
2019-03-29 10:04:20 -07:00
Risha Mars 408cffdc23
Better handle TCP only resources in the dashboard (#2532)
When a resource only has TCP traffic and no HTTP traffic, the dashboard looks
weird in a bunch of places.

This branch:
- updates the main resource card in the Octopus graph to show TCP stats if no HTTP
stats are available 
- cleans up the resource detail page to show fewer blank
tables if the resource only has TCP traffic.
2019-03-26 14:39:54 -07:00
Carol A. Scott 384acf2731
Replacing native sort with lodash stable sortBy in Web UI (#2501)
Replaces native JS `sort()` with lodash stable `_sortBy` for table rows so that rows are always sorted consistently.
2019-03-21 16:21:30 -07:00
Kevin Lingerfelt 0d4eb02835
Add identity pod to check, web, and integration tests (#2529)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-03-19 20:49:31 -07:00
Oliver Gould 790c13b3b2
Introduce the Identity controller implementation (#2521)
This change introduces a new Identity service implementation for the
`io.linkerd.proxy.identity.Identity` gRPC service.

The `pkg/identity` contains a core, abstract implementation of the service
(generic over both the CA and (Kubernetes) Validator interfaces).

`controller/identity` includes a concrete implementation that uses the
Kubernetes TokenReview API to validate serviceaccount tokens when
issuing certificates.

This change does **NOT** alter installation or runtime to include the
identity service. This will be included in a follow-up.
2019-03-19 13:58:45 -07:00
Oliver Gould 81f645da66
Remove `--tls=optional` and `linkerd-ca` (#2515)
The proxy's TLS implementation has changed to use a new _Identity_ controller.

In preparation for this, the `--tls=optional` CLI flag has been removed
from install and inject; and the `ca` controller has been deleted. Metrics
and UI treatments for TLS have **not** been removed, as they will continue to
be valuable for the new Identity system.

With the removal of the old identity scheme, the Destination service's proxy
ID field is now set with an opaque string (e.g. `ns:emojivoto`) to enable
locality awareness.
2019-03-18 17:40:31 -07:00
Carol A. Scott ff7603f292
Adding text wrap to expanded Tap request
Fixes #1932.

This PR adds text wrap to the tap details page so the full request path can be seen.
2019-03-18 17:27:22 -07:00
Gaurav Kumar 277e644f5a Fix Order of tables change unexpectedly in Top Routes Web UI
Fixes #2420.

Sorts the data returned from a Top Routes query before rendering the tables in the web UI. Previously we rendered the data tables without sorting, leading to inadvertent flipping of table order if the API returned data in a different order.

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
2019-03-18 15:00:05 -07:00
Gaurav Kumar 3d5e7eeb9d Fix Top query button behavior in Web UI
Fixes #2347

Previously, running a Top query for a namespace and resource that did not return
data would permanently disable the 'start query' button even if a user chose a
new namespace/resource combination. This allows the user to perform a new query
after their previous query does not return data.

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
2019-03-14 15:44:23 -07:00
Gaurav Kumar cbcd201715 Add TCP stats to the Linkerd Pod Grafana dashboard (#2329) (#2477)
* Add TCP stats to the Linkerd Pod Grafana dashboard (#2329)
* Minimize tcp stats and link it to dashboard tcp tables
* Add rows to fix minimization issues

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
2019-03-14 14:49:13 -07:00
Carol A. Scott a2e63de966
Add "Community" menu item to dashboard that displays linkerd.io content (#2476)
Closes #2327.

This PR creates a "Community" menu item on the dashboard sidebar that, when clicked, displays an iFrame of a page on linkerd.io. A yellow badge appears on the menu item if there has been an update since the user last clicked the "Community" menu item. This is calculated by comparing a date in the user's localStorage to a JSON feed at linkerd.io.
2019-03-14 09:55:09 -07:00
Gaurav Kumar e9287cc8c8 Fix service profiles quoted filename download issue (#2473) (#2479)
* Fix service profiles quoted filename download issue (#2473)
* Change the tests accordingly to fix quotes in filename

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
2019-03-12 15:49:17 -07:00
Andrew Seigner e5d2460792
Remove single namespace functionality (#2474)
linkerd/linkerd2#1721 introduced a `--single-namespace` install flag,
enabling the control-plane to function within a single namespace. With
the introduction of ServiceProfiles, and upcoming identity changes, this
single namespace mode of operation is becoming less viable.

This change removes the `--single-namespace` install flag, and all
underlying support. The control-plane must have cluster-wide access to
operate.

A few related changes:
- Remove `--single-namespace` from `linkerd check`, this motivates
  combining some check categories, as we can always assume cluster-wide
  requirements.
- Simplify the `k8s.ResourceAuthz` API, as callers no longer need to
  make a decision based on cluster-wide vs. namespace-wide access.
  Components either have access, or they error out.
- Modify the web dashboard to always assume ServiceProfiles are enabled.

Reverts #1721
Part of #2337

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-03-12 00:17:22 -07:00
Risha Mars 3be5de1736
Fix name of default route to ensure DEFAULT route is sorted to the bottom (#2469)
Some time ago, I fixed sorting on these tables so that the default route ([default]) 
was sorted to the bottom. The name was changed to [DEFAULT] causing that sort 
to no longer put the default route at the bottom. Update to correct case.
2019-03-07 19:27:39 -04:00