Commit Graph

715 Commits

Author SHA1 Message Date
Risha Mars 46c99febf2
Don't panic on stats that aren't included in StatAllResourceTypes (#1154)
Problem
`conduit stat` would cause a panic for any resource that wasn't in the list 
of StatAllResourceTypes
This bug was introduced by https://github.com/runconduit/conduit/pull/1088/files

Solution
Fix writeStatsToBuffer to not depend on what resources are in StatAllResourceTypes
Also adds a unit test and integration test for `conduit stat ns`
2018-06-19 17:00:16 -07:00
Kevin Lingerfelt 9a66641517
dest service: close open streams on shutdown (#1156)
* dest service: close open streams on shutdown
* Log instead of print in pkg packages
* Convert ServerClose to a receive-only channel

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-19 16:00:56 -07:00
Kevin Lingerfelt d3fdf5b504
Add integration tests for tap (#1152)
* Add integration tests for tap
* Collect fewer tap events

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-19 14:05:36 -07:00
Oliver Gould b711d005f6
proxy: Clarify Outbound::recognize (#1144)
The comments in Outbound::recognize had become somewhat stale as the
logic changed. Furthermore, this implementation may be easier to
understand if broken into smaller pieces.

This change reorganizes the Outbound:recognize method into helper
methods--`destination`, `host_port`, and `normalize`--each with
accompanying docstrings that more accurately reflect the current
implementation.

This also has the side-effect benefit of eliminating a string clone on
every request.
2018-06-19 14:01:27 -07:00
Risha Mars 8c9119dad2
Truncate very long error messages, small tweaks to error messages (#1150)
- If error messages are very long, truncate them and display a toggle to show the full message
- Tweak the headings - remove Pod, Container and Image - instead show them as titles
- Also move over from using Ant's Modal.method to the plain Modal component, which is a 
little simpler to hook into our other renders.
2018-06-19 13:58:38 -07:00
Eliza Weisman 13b33b6f3a
proxy: Add `tls="true"` metric label to connections accepted with TLS (#1050)
Depends on #1047.

This PR adds a `tls="true"` label to metrics produced by TLS connections and
requests/responses on those connections, and a `tls="no_config"` label on 
connections where TLS was enabled but the proxy has not been able to load
a valid TLS configuration.

Currently, these labels are only set on accepted connections, as we are not yet
opening encrypted connections, but I wired through the `tls_status` field on 
the `Client` transport context as well, so when we start opening client 
connections with TLS, the label will be applied to their metrics as well.

Closes #1046

Signed-off-by: Eliza Weisman <eliza@buoyanbt.io>
2018-06-19 12:30:11 -07:00
Brian Smith f82d16f50e
Proxy: Make TLS server aware of its own identity. (#1148)
* Proxy: Make TLS server aware of its own identity.

When validating the TLS configuration, make sure the certificate is
valid for the current pod. Make the pod's identity available at that
point in time so it can do so. Since the identity is available now,
simplify the validation of our own certificate by using Rustls's API
instead of dropping down to the lower-level webpli API.

This is a step towards the server differentiating between TLS
handshakes it is supposed to terminate vs. TLS handshakes it is
supposed to pass through.

This is also a step toward the client side (connect) of TLS, which will
reuse much of the configuration logic.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-18 12:53:10 -10:00
Oliver Gould 13716cd269
proxy: Upgrade h2 to 0.1.10 (#1149)
This picks up a fix for https://github.com/carllerche/h2/pull/285
2018-06-18 14:56:54 -07:00
Risha Mars df0bab80b4
Upgrade to webpack 4 and webpack-dev-server 3 (#1138)
Speeds up performance of webpack-dev-server.
2018-06-18 14:38:38 -07:00
Kevin Lingerfelt 9c77dfe00e
v0.4.4 release notes (#1145)
* v0.4.4 release notes

* Tweak wording about adblocker fix

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-18 11:29:31 -07:00
Kevin Lingerfelt 4278f9ec80
Fix unbound variable issue in docker-build script (#1146)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-18 11:29:09 -07:00
Alena Varkockova 6bb8b1328f Build CLI only for host platform (#884)
* Build CLI only for host platform

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

* Changes after code review

Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
2018-06-18 10:34:56 -07:00
Risha Mars fdb0b7f63f
Grafana: remove fill and stack from individual resource breakouts (#1092)
Remove the filling and stacking in request rate graphs that combine resources, 
to make it easier to spot outliers.

* Grafana: remove fill and stack from individual resource breakouts
* Remove all the stacks and fills from request rates everywhere
2018-06-18 10:14:39 -07:00
Andrew Seigner 0b9e7ff7df
Enable get for nodes/proxy for Prometheus RBAC (#1142)
The `kubernetes-nodes-cadvisor` Prometheus queries node-level data via
the Kubernetes API server. In some configurations of Kubernetes, namely
minikube and at least one baremetal kubespray cluster, this API call
requires the `get` verb on the `nodes/proxy` resource.

Enable `get` for `nodes/proxy` for the `conduit-prometheus` service
account.

Fixes #912

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-06-18 17:49:23 +01:00
Brian Smith 916ed609b1
Update Rustls to the latest Git version to fix a bug. (#1143)
Using MS Edge and probably other clients with the Conduit proxy when
TLS is enabled fails because Rustls doesn't take into consideration
that Conduit only supports one signature scheme (ECDSA P-256 SHA-256).
This bug was fixed in Rustls when ECDSA support was added, after the
latest release. With this change MS Edge can talk to Conduit.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-16 08:09:42 -10:00
Brian Smith a872e57c4c
Proxy: Make the control plane completely optional. (#1132)
Proxy: Make the control plane completely optional.
2018-06-16 08:09:12 -10:00
Eliza Weisman a82eec37ab
Attempt to load TLS settings immediately prior to starting watch (#1137)
Previously, the proxy would not attempt to load its TLS certificates until a fs
watch detected that one of them had changed. This means that if the proxy was
started with valid files already at the configured paths, it would not load 
them until one of the files changed.

This branch fixes that issue by starting the stream of changes with one event
_followed_ by any additional changes detected by watching the filesystem.

I've manually tested that this fixes the issue, both on Linux and on macOS, and
can confirm that this fixes the issue. In addition, when I start writing 
integration tests for certificate reloading, I'll make sure to include a test
to detect any regressions.

Closes #1133.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-15 17:32:55 -07:00
Brian Smith cef86f8d5b
Add optional TLS client certificate authentication. (#1135)
Refactor the way the TLS trust anchors are configured in preparation
for the client and server authenticating each others' certificates.

Make the use of client certificates optional pending the implementation
of authorization policy.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-15 14:26:26 -10:00
Brian Smith a121768a76
Keep accepting new connections after TLS handshake error. (#1134)
When a TLS handshake error occurs, the proxy just stops accepting
requests. It seems my expectations of how `Stream` handles errors
were wrong.

The test for this will be added in a separate PR after the
infrastructure needed for TLS testing is added. (This is a chicken
and egg problem.)

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-15 14:22:58 -10:00
Kevin Lingerfelt c750006bc0
Fix conduit version issue in integration tests (#1139)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-15 16:35:51 -07:00
Kevin Lingerfelt a68ca736fa
Start running integration tests in CI (#1064)
* Start running integration tests in CI
* Add gcp helper funcs
* Split integration test cleanup into separate phase

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-15 14:36:48 -07:00
Risha Mars 0ed40288e5
Display proxy container errors in the Web UI (#1130)
* Display proxy container errors in the Web UI

Add an error modal to display pod errors
Add icon to data tables to indicate errors are present
Display errors on the Service Mesh Overview Page and all the resource pages
2018-06-15 14:12:36 -07:00
Kevin Lingerfelt 5c42e4e22b
test: Use proxy instead of lb for external test traffic (#1129)
* test: Use proxy instead of lb for external test traffic
* Adjust timeouts on install and get tests

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-15 12:54:12 -07:00
Eliza Weisman 0eadcc542e
proxy: Fix Inotify falling back to polling when files don't exist yet (#1119)
This PR changes the proxy's Inotify watch code to avoid always falling back to
polling the filesystem when the watched files don't exist yet. It also contains
some additional cleanup and refactoring of the inotify code, including moving
the non-TLS-specific filesystem watching code out of the `tls::config` module
and into a new `fs_watch` module.

In addition, it adds tests for both the polling-based and inotify-based watch
implementations, and changes the polling-based watches to hash the files rather
than using timestamps from the file's metadata to detect changes. These changes
are originally from #1094 and #1091, respectively, but they're included here
because @briansmith asked that all the changes be made in one PR.

Closes #1094. Closes #1091. Fixes #1090. Fixes #1097. Fixes #1061.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-15 11:40:04 -07:00
Brian Smith 110d91e667
Simplify & clarify "No TLS" server configuration (#1131)
The same pattern will be used for the "No TLS" client configuration.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-14 19:10:03 -10:00
Oliver Gould be2d878fba
proxy: Update prost to 0.4.0 (#1127)
prost-0.4.0 has been released, which removes unnecessary dependencies.
tower-grpc is being updated simultaneously, as this is the proxy's
primary use of prost.

See: https://github.com/danburkert/prost/releases/tag/v0.4.0
2018-06-14 16:29:41 -07:00
Risha Mars e2c2f19d2c
Propagate errors in conduit containers to the api (#1117)
- It would be nice to display container errors in the UI. This PR gets the pod's container 
statuses and returns them in the public api

- Also add a terminationMessagePolicy to conduit's inject so that we can capture the 
proxy's error messages if it terminates
2018-06-14 16:22:31 -07:00
Oliver Gould 5dfc863049
proxy: Update `rand` to 0.5.1 (#1125)
* proxy: Update `rand` to 0.5.1

The proxy depends on rand-0.4, which is superceded by newer APIs in
rand-0.5. Since we're already using rand-0.5 via the tower-balance
crate, it seems appropriate to upgrade the proxy.

* Expand lock files in reviews
2018-06-14 15:09:58 -07:00
Thomas Rampelberg c8b8db7461
Use native yarn cache in travis (#1124)
Use native yarn cache
2018-06-14 14:16:11 -07:00
Oliver Gould 2a4f38b9e7
proto: Use explicit `go_package` option (#1120)
protobuf has a `go_package` option that can be used to explicitly name
Go packages such that they can be imported without additional rewrites.

This allows us to store proto files without additional, redundant
directories (which were used for packaging hints, previously).

This change adds an explicit `go_package` to all .proto files and
updates `bin/protoc-go.sh` to ensure these packages are output into
$GOPATH (so that the go_package can be absolute). This removes the need
to manually rewrite imports in bin/protoc-go.sh.
2018-06-14 14:03:00 -07:00
Thomas Rampelberg 516807bde6
Add readiness/liveness checks for third party components (#1121)
* Add readiness/liveness checks for third party components

Any possible issues with the third party control plane components can wedge the services.

Take the best practices for prometheus/grafana and add them to our template. See #1116

* Update test fixtures for new output
2018-06-14 13:01:13 -07:00
Risha Mars 72415d173e
Allow webpack to compile on lint error (#1104)
Add an emitWarning to the webpack config so that webpack will compile despite lint 
errors when running in development mode. This is necessary to enable development 
on the frontend using webpack-dev-server's automatic reloading.

Also sets a NODE_ENV in travis.yml so that the build will fail if linting fails.
2018-06-14 11:26:59 -07:00
Kevin Lingerfelt 13aaa82c95
Allow k8s API clients to watch a subset of resources (#1118)
* Allow k8s API clients to watch a subset of resources
* Sort resources

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-14 11:09:01 -07:00
Oliver Gould f90c3ef667
proxy: Update Rust to 1.26.2 (#1123)
Rust 1.26.2 addresses a correctness bug in the borrow checker.

See: https://blog.rust-lang.org/2018/06/05/Rust-1.26.2.html
2018-06-14 10:48:54 -07:00
Oliver Gould b6d1db898b
proxy: Fix docker build (#1122)
fb8d054e removed the `convert` crate, but did not remove references to
it from the proxy's Dockerfile.
2018-06-14 10:46:34 -07:00
Oliver Gould fb8d054e96
proxy: Convert `convert` from crate to module (#1115)
In e2093e3, we created a `convert` crate when refactoring the proxy's
gRPC bindings into a dedicated crate.

It's not really necessary to handle `convert` as a crate, given that it
holds a single 39-line file that's mostly comments. It's possible to
"vendor" this file in the proxy, and controller-grpc crate doesn't
even need this trait (in fact, the proxy probably doesn't either).
2018-06-13 16:18:51 -07:00
Kevin Lingerfelt 9f1df963e9
Move controller/util and web/util packages to pkg (#1109)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-13 11:25:56 -07:00
Kevin Lingerfelt b6d429e80d
dst svc: use shared informer instead of custom endpoints informer (#1079)
* Update destination service ot use shared informer instead of custom endpoints informer
* Add additional tests for dst svc endpoints watcher
* Remove service ports when all listeners unsubscribed
* Update go deps

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-13 11:11:57 -07:00
Kevin Lingerfelt bd1d1af38b
dst svc: use shared informer instead of pod watcher (#1073)
* Update desintation service to use shared informer instead of pod watcher
* Add const for pod IP index name

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-12 18:09:47 -07:00
Oliver Gould 4b4ab806d7
Remote unused cruft file (#1112)
In 8e7147f4, it seems that proxy/assert_macro was committed erroneously.

This change removes this unused file.
2018-06-12 15:42:11 -07:00
Eliza Weisman 65585699b6
Fix unbound `DOCKER_TRACE` var in `bin/docker-test-proxy` (#1107)
I forgot to export this since the script no longer sources `. bin/_docker.sh`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-12 13:19:14 -07:00
Risha Mars ea01378090
Upgrade enzyme-context-patch to its latest version (#1108)
https://www.npmjs.com/package/enzyme-context-patch

This is a temporary fix until enzyme releases with the fix for
Error: Enzyme Internal Error: unknown node with tag 12
2018-06-12 12:38:39 -07:00
Kevin Lingerfelt 6e66f6d662
Rename Lister to API and expose informers as well as listers (#1072)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-12 10:27:55 -07:00
Eliza Weisman b7399f484a
Add a script for running proxy tests in Docker (#1102)
When developing features in the proxy, that rely on Linux-only OS features,
developers using other operating systems may find it inconvenient to test
their changes. While we run CI builds on Linux, and may have access to Linux
testing environments, this is not as tightly integrated into the proxy 
development workflow as running a quick `cargo test` on the host OS.

For example, I found it inconvenient to test the `inotify` based filesystem
watch code I've been adding in recent commits, and had to do things like
opening a WIP PR for a branch to get CI to run the tests. This workflow is not
ideal.

This PR adds an (admittedly somewhat hacky) script and Dockerfile for running
the proxy's tests in Docker. This accomplishes approximately the same goal as 
the `PROXY_SKIP_TESTS` flag that we used to have, but with the advantage that 
we no longer include the test dependencies in release builds. 

Of course, this also means that we no longer share any of the dependencies 
between the test docker build and the release docker build, which is a shame. 
It might be worthwhile to re-introduce a dependencies image so that cached
builds of the proxy's dependencies can be shared between the test and release
Dockerfiles. However, I thought that deserved to be discussed separately from
the changes I made in this branch.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-11 16:44:39 -07:00
Thomas Rampelberg c3dc20d64f
Move from /api/stat to /api/tps-reports (#1105)
Common blacklists have `/api/stat` in them. This causes the dashboard to not load.

`/api/tps-reports` is not in any blacklists, suggests what this route does and is slightly tongue in cheek. Fixes #970
2018-06-11 16:39:00 -07:00
Dennis Adjei-Baah 3ae8dcd369 Prepare for v0.4.3 (#1099) 2018-06-11 10:55:12 -07:00
Oliver Gould 68786d85a6
proxy: Update tower-balance (#1093)
To pick up https://github.com/tower-rs/tower/pull/86
2018-06-08 15:52:52 -07:00
Risha Mars 7d4c4aa290
CLI: print resources in the same order every time stat all is run (#1088)
Previously, in conduit stat all we would just print the map of stat results, which 
resulted in the order in which stats were displayed varying between prints.

Fix:
Define an array, k8s.StatAllResourceTypes and use the order in this array to print 
the map; ensuring a consistent print order every time the command is run.
2018-06-08 15:02:17 -07:00
Risha Mars 53b713b2a8
Remove the ⚠️ emoji from non-tlsed grafana stat labels (#1089) 2018-06-08 15:00:56 -07:00
Risha Mars b930bc6b88
Fix conduit health grafana dashboard (#1086)
* Scope health queries to controller namespace

* Add a prometheus query variable to get the conduit namespace
2018-06-08 12:57:05 -07:00