A purpose-built proxy for the Linkerd service mesh. Written in Rust.
Go to file
Oliver Gould c4b3765574
Unify Name/Host/Addr types under Addr (#120)
Currently, the proxy uses a variety of types to represent the logical
destination of a request. Outbound destinations use a `NameAddr` type
which may be either a `DnsNameAndPort` or a `SocketAddr`. Other parts of
the code used a `HostAndPort` enum that always contained a port and also
contained a `Host` which could either be a `dns::Name` or a `IpAddr`.
Furthermore, we coerce these types into a `http::uri::Authority` in many
cases.

All of these types represent the same thing; and it's not clear when/why
it's appropriate to use a given variant.

In order to simplify the situtation, a new `addr` module has been
introduced with `Addr` and `NameAddr` types. A `Addr` may
contain either a `NameAddr` or a `SocketAddr`.

The `Host` value has been removed from the `Settings::Http1` type,
replaced by a boolean, as it's redundant information stored elsewhere in
the route key.

There is one small change in behavior: The `authority` metrics label is
now omitted only for requests that include an `:authority` or `Host`
with a _name_ (i.e. and not an IP address).
2018-11-08 14:49:42 -08:00
.github Add a newline to dco.yml (#254) 2018-02-01 15:16:02 -08:00
lib Prepare HTTP metrics for per-route classification (#112) 2018-10-30 10:47:33 -07:00
src Unify Name/Host/Addr types under Addr (#120) 2018-11-08 14:49:42 -08:00
tests Introduce outbound route metrics (#117) 2018-11-05 16:30:39 -08:00
.dockerignore dev: Add a Dockerfile for development (#3) 2018-07-11 15:27:33 -07:00
.gitattributes Migrate `conduit-proxy` to `linkerd2-proxy` 2018-07-07 22:45:21 +00:00
.gitignore Migrate `conduit-proxy` to `linkerd2-proxy` 2018-07-07 22:45:21 +00:00
.travis.yml Revert "travis: Avoid caching proxy binaries (#69)" (#77) 2018-08-20 09:27:56 -07:00
CONTRIBUTING.md Replace references to _Conduit_ (#6) 2018-07-12 20:41:17 -07:00
Cargo.lock Introduce outbound route metrics (#117) 2018-11-05 16:30:39 -08:00
Cargo.toml Introduce outbound route metrics (#117) 2018-11-05 16:30:39 -08:00
DCO Add contributing doc and DCO file (#88) 2017-12-22 14:54:27 -08:00
Dockerfile Use rust:1.30.0 in development builds (#110) 2018-10-26 15:43:08 -07:00
GOVERNANCE.md Adopt Linkerd2's governance (#2) 2018-07-10 15:59:12 -07:00
LICENSE Introducing Conduit, the ultralight service mesh 2017-12-05 00:24:55 +00:00
MAINTAINERS.md Adopt Linkerd2's governance (#2) 2018-07-10 15:59:12 -07:00
Makefile Fix linkerd2-metrics test compilation (#98) 2018-09-18 16:16:56 -07:00
README.md Replace references to _Conduit_ (#6) 2018-07-12 20:41:17 -07:00

README.md

linkerd2

Build Status GitHub license Slack Status

This repo contains the transparent proxy component of Linkerd2. While the Linkerd2 proxy is heavily influenced by the Linkerd 1.X proxy, it comprises an entirely new codebase implemented in the Rust programming language.

This proxy's features include:

  • Transparent, zero-config proxying for HTTP, HTTP/2, and arbitrary TCP protocols.
  • Automatic Prometheus metrics export for HTTP and TCP traffic;
  • Transparent, zero-config WebSocket proxying;
  • Automatic, latency-aware, layer-7 load balancing;
  • Automatic layer-4 load balancing for non-HTTP traffic;
  • Automatic TLS (experimental);
  • An on-demand diagnostic tap API.

This proxy is primarily intended to run on Linux in containerized environments like Kubernetes, though it may also work on other Unix-like systems (like macOS).

The proxy supports service discovery via DNS and the linkerd2 Destination gRPC API.

The Linkerd project is hosted by the Cloud Native Computing Foundation (CNCF).

Building the project

A Makefile is provided to automate most build tasks. It provides the following targets:

  • make build -- Compiles the proxy on your local system using cargo
  • make test -- Runs unit and integration tests on your local system using cargo
  • make test-flakey -- Runs all tests, including those that may fail spuriously
  • make package -- Builds a tarball at target/release/linkerd2-proxy-${PACKAGE_VERSION}.tar.gz. If PACKAGE_VERSION is not set in the environment, the local git SHA is used.
  • make docker -- Builds a Docker container image that can be used for testing. If the DOCKER_TAG environment variable is set, the image is given this name. Otherwise, the image is not named.

Cargo

Usually, Cargo, Rust's package manager, is used to build and test this project. If you don't have Cargo installed, we suggest getting it via https://rustup.rs/.

Artifacts

Each version of the master branch is published to build.l5d.io/linkerd2-proxy/linkerd2-proxy-$PACKAGE_VERSION.tar.gz. The most recent version (and the package's SHA256 sum) can be discovered via:

:; curl https://build.l5d.io/linkerd2-proxy/latest.txt

The SHA256 sum of each package version is found at:

:; curl https://build.l5d.io/linkerd2-proxy/linkerd2-proxy-$PACKAGE_VERSION.txt

Code of conduct

This project is for everyone. We ask that our users and contributors take a few minutes to review our code of conduct.

License

linkerd2-proxy is copyright 2018 the linkerd2-proxy authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.