Commit Graph

752 Commits

Author SHA1 Message Date
Risha Mars cf0ee70689
Continue to remove conduit branding from /web (#1290)
This PR adjusts the colour of a popup in the sidebar, as well as removes 
references to conduit in the frontend test fixtures.

All that's left in the Web UI code now is a few references to the conduit sites / githubs, 
as well as the CLI name.

* Remove a touch of conduit blue from the sidebar popup
* Remove minor references to conduit throughout the web code
* Fully colour the sidebar in new bg colour
2018-07-10 17:57:27 -07:00
Andrew Seigner e18fa48135
Name ClusterRole objects to be namespace-specific (#1295)
The control-plane's `ClusterRole` and `ClusterRoleBinding` objects are
global. Because their names did not vary across multiple control-plane
deployments, it prevented multiple control-planes from coexisting (when
RBAC is enabled).

Modify the `ClusterRole` and `ClusterRoleBinding` objects to include the
control-plane's namespace in their names. Also modify the integration
test to first install two control-planes, and then perform its full
suite of tests, to prevent regression.

Fixes #1292.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-07-10 16:21:20 -07:00
Oliver Gould 40e1b53ea9
docker: Ensure that TLS is validated when fetching the proxy (#1300)
Previously the proxy was fetched without verifying the endpoint's
signature.

Now, the `ca-certificates` package is installed prior to fetching the
package.

Additionally, the produced image contains a file containing the version.
2018-07-10 16:15:57 -07:00
Kevin Lingerfelt 1624a4ba0f
Ensure destination service always sends pod metadata (#1291)
* Ensure destination service always sends pod metadata
* Fix test that relied on hash ordering
* Stop using protobuf structs as map keys, fix logging

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-10 15:08:59 -07:00
Oliver Gould dbb3270ec8
Adopt Linkerd's governance (#1301) 2018-07-10 15:06:59 -07:00
Oliver Gould 941cad4a9c
Migrate build infrastructure to linkerd2 (#1298)
This PR begins to migrate Conduit to Linkerd2:
* The proxy has been completely removed from this repo, and is now located at
  github.com/linkerd/linkerd2-proxy.
* A `Dockerfile-proxy` has been added to fetch the most-recently published proxy
  binary from build.l5d.io.
* Proxy-specific protobuf bindings have been moved to
  github.com/linkerd/linkerd2-proxy-api.
* All docker images now use the gcr.io/linkerd-io registry.
* `inject` now uses `LINKERD2_PROXY_` environment variables
* Go paths have been updated to reflect the new (future) repo location.
2018-07-09 15:38:38 -07:00
Thomas Rampelberg cc524ebc4b
Update for current CLI (#1297) 2018-07-09 10:19:22 -07:00
Kevin Lingerfelt 6f804d600c
Remove docker-compose / simulate-proxy environment (#1294)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-06 17:44:35 -07:00
Risha Mars 9050b2d312
Fix authority stat queries when a --from flag is used (#1289)
* Fix bug where we were using dst_authorities as a group by instead of authorities
* Add test to make sure we don't dst_authorities

Previously, we were only checking to make sure we didn't add 
dst_authorities in the query labels in promDstQueryLabels but we 
weren't checking the groupBy labels in promDstGroupByLabelNames - 
this caused us to try to query for dst_authorities when a --from 
query was sent. There are no dst_authorities, so there would be no 
named results.
2018-07-06 17:29:08 -07:00
Risha Mars 219b017c28
Change sidebar branding from Conduit to Linkerd (#1262)
Use Linkerd branding in the sidebar.

This PR deals with visuals only. See #1260 for word changes.
2018-07-05 18:24:32 -07:00
Kevin Lingerfelt 930d1658c1
Fix default SMTP port in docs (#1284)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 18:21:53 -07:00
Kevin Lingerfelt 9379bd548c
Additional doc updates regarding protocol support (#1279)
* Additional doc updates regarding protocol support
* Re-add information about server-speaks-first protocols

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 17:22:33 -07:00
Eliza Weisman d76be26d85
proxy: Add tls_config_last_reload_seconds metric (#1204)
Depends on #1141.

This PR adds a `tls_config_last_reload_seconds` Prometheus metric
that reports the last time the TLS configuration files were reloaded.

Proof that it works:

Started the proxy with no certs, then generated them:
```
➜ http GET localhost:4191/metrics
HTTP/1.1 200 OK
content-encoding: gzip
content-length: 323
content-type: text/plain
date: Mon, 25 Jun 2018 23:02:52 GMT

# HELP tls_config_reload_total Total number of times the proxy's TLS config files were reloaded.
# TYPE tls_config_reload_total counter
tls_config_reload_total{status="io_error",path="example-example.crt",error_code="2"} 9
tls_config_reload_total{status="reloaded"} 3
# HELP tls_config_last_reload_seconds Timestamp of when the TLS configuration files were last reloaded successfully (in seconds since the UNIX epoch)
# TYPE tls_config_last_reload_seconds gauge
tls_config_last_reload_seconds 1529967764
# HELP process_start_time_seconds Time that the process started (in seconds since the UNIX epoch)
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1529967754
```

Started the proxy with certs already present:
```
➜ http GET localhost:4191/metrics
HTTP/1.1 200 OK
content-encoding: gzip
content-length: 285
content-type: text/plain
date: Mon, 25 Jun 2018 23:04:39 GMT

# HELP tls_config_reload_total Total number of times the proxy's TLS config files were reloaded.
# TYPE tls_config_reload_total counter
tls_config_reload_total{status="reloaded"} 4
# HELP tls_config_last_reload_seconds Timestamp of when the TLS configuration files were last reloaded successfully (in seconds since the UNIX epoch)
# TYPE tls_config_last_reload_seconds gauge
tls_config_last_reload_seconds 1529967876
# HELP process_start_time_seconds Time that the process started (in seconds since the UNIX epoch)
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1529967874
```

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-07-05 16:23:57 -07:00
Kevin Lingerfelt fd1aecfa63
Unhide --tls flag in conduit CLI (#1278)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 15:49:19 -07:00
Kevin Lingerfelt 693acdbf26
Update ListPods endpoint to return all pod owner types (#1275)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 15:14:16 -07:00
Risha Mars 372e145fea
Start removing references to conduit in the web UI (#1260)
This PR starts removing all references to the word "Conduit" in the web UI.
In the interest of not making huge changes all at once, I'll gradually start moving away
from the usage of "conduit" in the Web UI. For example, there are a lot of components that
have conduit in their names but they don't need to.

This branch is mostly component / variable names. There should be no visible changes except 
the spinner is no longer a Conduit spinner.

See #1262 for visible branding changes.

- Rename ConduitLink to PrefixedLink
- Remove ConduitSpinner in favour of antd.Spin
- Remove css classnames that are conduit- centered
- Parameterize the current Product Name so that it's easier to change in the future

Tracking ticket: linkerd/linkerd#2018
2018-07-05 15:07:51 -07:00
Oliver Gould b3dccca525
Update CHANGES for v0.5.0 (#1273) 2018-07-05 14:09:02 -07:00
Oliver Gould dcdf4b36b3
Document Conduit's Automatic TLS feature (#1268) 2018-07-05 13:54:25 -07:00
Kevin Lingerfelt 76110601d4
Update test helpers to work with kubernetes 1.8 (#1267)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 12:34:38 -07:00
Kevin Lingerfelt d42d7cb035
Re-run install integration test w/TLS enabled (#1230)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 10:32:29 -07:00
Franziska von der Goltz 9bf549b5ff
doc update to remove extra configurations for websockets (#1180)
* doc update to remove extra configurations for websockets and HTTP tunneling:
- remove instructions from readme and docs to set extra configs for websockets and  HTTP tunneling, since proxy upgrades automatically

Signed-off-by: Franziska von der Goltz <franziska@vdgoltz.eu>
2018-07-05 10:20:35 -07:00
Eliza Weisman a17177f73d
proxy: Fix out-of-control inotify CPU use (#1263)
The `inotify-rs` library's `EventStream` implementation currently 
calls `task::current().notify()` in a hot loop when a poll returns
`WouldBlock`, causing the task to constantly burn CPU. 

This branch updates the `inotify-rs` dependency to point at a branch
of `inotify-rs` I had previously written. That branch  rewrites the 
`EventStream` to use `mio` to  register interest in the `inotify` file 
descriptor instead, fixing the out-of-control polling. 

When inotify-rs/inotify#105 is merged upstream, we can go back to 
depending on the master version of the library.

Fixes #1261

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-07-03 20:16:12 -07:00
Risha Mars ba2e13c731
Small tweaks to error modal, add Reason to api error response (#1246)
- Add Reason to the error data passed from the api
- Rewrite error logic in the UI to try to make it clearer
- Show 0/0 pods meshed instead of 0/0 pods meshed (N/A) if 0 pods are meshed
2018-07-03 17:14:27 -07:00
Oliver Gould 647b93d967
proxy: Handle connection close during TLS detection (#1256)
During protocol detection, we buffer data to detect a TLS Client Hello
message. If the client disconnects while this detection occurs, we do
not properly handle the disconnect, and the proxy may busy loop.

To fix this, we must handle the case where `read(2)` returns 0 by
creating a `Connection` with the already-closed socket.

While doing this, I've moved some of the implementation of
`ConditionallyUpgradeServerToTls::poll` into helpers on
`ConditionallyUpgradeServerToTlsInner` so that the poll method is easier
to read, hiding the inner details from the polling logic.
2018-07-03 15:36:48 -07:00
Eliza Weisman 1c5e9eeaa6
proxy: Add a Prometheus metric for reporting errors loading TLS configs (#1141)
This PR adds a Prometheus stat tracking the number of times
TLS config files have been reloaded, and the number of times
reloading those files has errored. 

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-07-03 15:24:20 -07:00
Risha Mars 2002a8ba50
Add more tests for the stat summary endpoint --from flags (#1237)
Also add dst_ labels in the metrics we mock, so we can do --from queries with results.
2018-07-03 14:30:15 -07:00
Kevin Lingerfelt f0ba8f3ee8
Fix owner types in TLS identity strings (#1257)
* Fix owner types in TLS identity strings
* Update documentation on TLSIdentity struct

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-03 14:20:24 -07:00
Eliza Weisman b4d1d43f9f
proxy: Add TLS label in `transparency::retry_reconnect_errors` test (#1258) 2018-07-03 12:27:08 -07:00
Risha Mars 83b982b25a
Change CLI and web TLS indicators from Secured to TLS (#1247)
Previously, we had "Secured" columns in the web and CLI for the percentage of traffic 
that is TLSed. Change this to "TLS"
2018-07-03 10:51:38 -07:00
Brian Smith 252a8d39d3
Generate an ephemeral CA at startup that distributes TLS credentials (#1245)
Create a ephemeral, in-memory TLS certificate authority and integrate it into the certificate distributor.

Remove the re-creation of deleted ConfigMaps; this will be added back later in #1248.

Signed-off-by: Brian Smith brian@briansmith.org
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-02 18:09:31 -10:00
Oliver Gould 20276b106e
tap: Support `tls` labeling (#1244)
The proxy's metrics are instrumented with a `tls` label that describes
the state of TLS for each connection and associated messges.

This same level of detail is useful to get in `tap` output as well.

This change updates Tap in the following ways:
* `TapEvent` protobuf updated:
  * Added `source_meta` field including source labels
  * `proxy_direction` enum indicates which proxy server was used.
* The proxy adds a `tls` label to both source and destination meta indicating the state of each peer's connection
* The CLI uses the `proxy_direction` field to determine which `tls` label should be rendered.
2018-07-02 17:19:20 -07:00
Oliver Gould 593c839862
proxy: Always inlcude `tls` label in metrics (#1243)
The `tls` label could sometimes be formatted incorrectly, without a
preceding comma.

To fix this, the `TlsStatus` type no longer formats commas so that they
must be provided in the context in which they are used (as is done
otherwise in this file).
2018-07-02 16:21:06 -07:00
Eliza Weisman e018050cf9
proxy: Fall back to plaintext communication when a TLS handshake fails (#1173)
This branch modifies the proxy's logic for opening a connection so
that when an attempted TLS handshake fails, the proxy will retry that
connection without TLS.

This is implemented by changing the `UpgradeToTls` case in the `Future`
implementation for `Connecting`, so that rather than simply wrapping
a poll to the TLS upgrade future with `try_ready!` (and thus failing
the future if the upgrade future fails), we reset the state of the
future to the `Plaintext` state and continue looping. The `tls_status`
field of the future is changed to `ReasonForNoTls::HandshakeFailed`,
and the `Plaintext` state is changed so that if its `tls_status` is
`HandshakeFailed`, it will no longer attempt to upgrade to TLS when the
plaintext connection is successfully established.

Closes #1084 

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-29 17:08:03 -07:00
Kevin Lingerfelt a685dba873
Use parent name instead of pod name in identity string (#1236)
* Use parent name instead of pod name in identity string
* Update protobuf comment

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-29 14:28:13 -07:00
Risha Mars 8ebc969d2f
Fix bug where we wouldn't run stat table assertions if we expected 0 results (#1235)
I realized that our stat summary expectation checker would only check the actual
proto responses against the expectations if the expectations were non-empty.

Problem
If we expected empty results and the api returned actual results, we never actually 
check those results against the expectations.

The bug can be reproduced by replacing any nonzero metric we expect in 
expectedResponse with expectedResponse: genEmptyResponse() 
The tests on master will still pass.

Solution
Remove this line and ensure we get the expected number of stat tables.
2018-06-29 14:23:14 -07:00
Brian Smith f989c56127
Proxy: Skip TLS for control plane loopback connections. (#1229)
If the controller address has a loopback host then don't use TLS to connect
to it. TLS isn't needed for security in that case. In mormal configurations
the proxy isn't terminating TLS for loopback connections anyway.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-28 17:24:09 -10:00
Risha Mars 5ed7fc563c
Add controller component pod uptimes to the ServiceMesh page (#1205)
- Return pod uptimes from the GetPods endpoint
- Adds filtering by namespace to api.GetPods
- Adds a --namespace filter to conduit get pods
- Adds pod uptimes to the controller component toolitps on the ServiceMesh page
- Moves the ServiceMesh page back to using /api/pods
2018-06-28 15:42:00 -07:00
Risha Mars 5963b2ac24
Better format empty errors (#1202) 2018-06-28 14:52:04 -07:00
Risha Mars 68586fe697
Add the ability to query stats by authority (#1181)
Adds the ability to query by a new non-kubernetes resource type, "authorities",
in the StatSummary api.

This includes an extensive refactor of stat_summary.go to deal with non-kubernetes 
resource types.

- Add documentation to Resource in the public api so we can use it for authority
- Handle non-k8s resource requests in the StatSummary endpoint
- Rewrite stat summary fetching and parsing to handle non-k8s resources
- keys stat summary metric handling by Resource instead of a generated string
- Adds authority to the CLI
- Adds /authorities to the Web UI
- Adds some more stat integration and unit tests
2018-06-28 14:31:44 -07:00
Kevin Lingerfelt ef9c890505 Fix issue with injected resource name, add test (#1226)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-28 10:23:38 -10:00
Oliver Gould 9f274526d6
cli: tap: Use safe accessors (#1224)
The `tap` command is prone to panic due to use of `nil` values.
This is  because we don't use the safe `Get*()` field accessors
provided by protobuf.

This change fixes several unsafe field access paths.

Fixes #47
2018-06-28 11:10:56 -07:00
Thomas Rampelberg fafce1b8b3
Add important comment back (#1219) 2018-06-28 08:18:52 -07:00
Brian Smith afbc88ac44
Proxy: Get identity of pod & controller from configuration. (#1221)
Instead of attempting to construct identities itself, have the proxy
accept fully-formed identities from whatever configures it. This allows
us to centralize the formatting of the identity strings in the Go code
that is shared between the `conduit inject`, `conduit install`, and CA
components.

One wrinkle: The pod namespace isn't necessarily available at
`conduit inject` time, so the proxy must implement a simple variable
substitution mechanism to insert the pod namespace into its identity.

This has the side-effect of enabling TLS to the controller since the
controller's identity is now available.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-27 17:17:34 -10:00
Brian Smith cca8e7077d
Add TLS support to `conduit inject`. (#1220)
* Add TLS support to `conduit inject`.

Add the settings needed to enable TLs when `--tls=optional` is passed on the
commend line. Later the requirement to add `--tls` will be removed.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-27 16:04:07 -10:00
Kevin Lingerfelt f502596577
Update go bindings for destination.proto change (#1223)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-27 18:26:13 -07:00
Brian Smith 06d3c09ca5
Proxy: Use new destination service TLS identity scheme. (#1222)
Signed-off-by: Brian Smith <brian@briansmith.org>
2018-06-27 14:47:57 -10:00
Eliza Weisman 06d0209d0b
proxy: Replace >=100,000 ms latency buckets with 1, 2, 3, 4, and 5 ms (#1218)
This branch adds buckets for latencies below 10 ms to the proxy's latency
histograms, and removes the buckets for 100, 200, 300, 400, and 500 
seconds, so the largest non-infinity bucket is 50,000 ms. It also removes
comments that claimed that these buckets were the same as those created
by the control plane, as this is no longer true (the metrics are now scraped
by Prometheus from the proxy directly).

Closes #1208

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-27 16:53:42 -07:00
Thomas Rampelberg 97868f654f
Add Pod to injectable types (#1213)
* Add Pod to injectable types

* Remove the pod label for pods
2018-06-27 14:37:05 -07:00
Kevin Lingerfelt b8ba627ee5
Update dest service with a different tls identity strategy (#1215)
* Update dest service with a different tls identity strategy
* Send controller namespace as separate field

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-27 11:40:02 -07:00
Kevin Lingerfelt d265e8d942
Add integration tests for pod and service stats (#1214)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-27 10:19:52 -07:00