A purpose-built proxy for the Linkerd service mesh. Written in Rust.
Go to file
katelyn martin d39d82181c chore(cargo): add `config.toml` file
we use the `kubert` crate to export a collection of metrics measuring
the behavior of our asynchronous tokio runtime.

in order for this crate to compile, one must set a compile-time flag.
this can be done either by setting the `RUSTFLAGS` environment variable,
or via a toml file in `.cargo/config.toml`.

helpful links:

- <https://github.com/olix0r/kubert?tab=readme-ov-file#kubert-prometheus-tokio>
- <https://docs.rs/tokio-metrics/latest/tokio_metrics/>
- <https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags>

this commit introduces a file providing this `rustflags` flag.

note that, per the cargo reference (linked above), the environment
variable takes precedence over the value provided in the `config.toml`
file.

so, providing this flag here will allow a conventional `cargo build` to
build the project successfully without setting any environment
variables, without interfering with users' ability to provide additional
compiler flags when needed.

Signed-off-by: katelyn martin <kate@buoyant.io>
2024-12-10 14:23:22 -05:00
.cargo chore(cargo): add `config.toml` file 2024-12-10 14:23:22 -05:00
.checksec build(deps): Update rustls and ring (#2735) 2024-02-21 16:03:35 -08:00
.devcontainer build(deps): bump linkerd/dev from v43 to v44 (#3420) 2024-12-06 10:50:41 -05:00
.github build(deps): bump tj-actions/changed-files from 45.0.4 to 45.0.5 (#3434) 2024-12-09 08:56:16 -08:00
docs ci: Lint markdown files (#1707) 2022-05-25 11:46:19 -07:00
hyper-balance chore(hyper): enable `deprecated` feature flag 2024-12-03 12:50:11 -05:00
linkerd refactor(app/test): address hyper deprecations in test helpers (#3433) 2024-12-09 14:44:01 -05:00
linkerd2-proxy build(deps): bump linkerd/dev from v43 to v44 (#3420) 2024-12-06 10:50:41 -05:00
opencensus-proto build(deps): Bump prost-build from 0.12.3 to 0.12.4 (#2877) 2024-04-09 16:52:36 -07:00
opentelemetry-proto build(deps): bump the opentelemetry group with 2 updates (#3356) 2024-11-22 18:53:27 +00:00
spiffe-proto build(deps): Bump prost-build from 0.12.3 to 0.12.4 (#2877) 2024-04-09 16:52:36 -07:00
tools Integrate OpenTelemetry into the proxy 2024-10-01 10:49:35 -04:00
.clippy.toml clippy: Disallow lock and instant types from `std` (#1458) 2022-02-02 11:59:03 -08:00
.codecov.yml ci: Fixup codecov config (#2545) 2023-12-03 11:53:02 -08:00
.dockerignore Add proxy_build_info metric (#600) 2020-07-24 09:19:40 -07:00
.gitattributes Update to linkerd2-proxy-api v0.5 and tonic v0.7 (#1596) 2022-04-11 11:29:33 -07:00
.gitignore vscode: Move workspace settings to devcontainer (#2557) 2023-12-12 13:10:33 -08:00
CONTRIBUTING.md dev: Update markdowlint-cli2 to 5.0.1 (#1892) 2022-08-15 13:42:18 -07:00
Cargo.lock build(deps): bump rustix from 0.38.40 to 0.38.42 (#3441) 2024-12-10 10:42:11 -05:00
Cargo.toml refactor(proxy/http): extricate `Body` middleware types (#3382) 2024-11-26 15:01:54 -05:00
DCO Add contributing doc and DCO file (#88) 2017-12-22 14:54:27 -08:00
Dockerfile build(deps): bump linkerd/dev from v43 to v44 (#3420) 2024-12-06 10:50:41 -05:00
GOVERNANCE.md ci: Lint markdown files (#1707) 2022-05-25 11:46:19 -07:00
LICENSE Introducing Conduit, the ultralight service mesh 2017-12-05 00:24:55 +00:00
MAINTAINERS.md ci: Lint markdown files (#1707) 2022-05-25 11:46:19 -07:00
README.md readme: mTLS has been prod for years (#2782) 2024-03-11 20:52:23 -07:00
deny.toml build(deps): bump thiserror from 1.0.68 to 2.0.4 (#3417) 2024-12-06 19:53:44 +00:00
justfile ci: increase linkerd-install readiness timeout (#3418) 2024-12-04 11:09:32 -05:00
rust-toolchain.toml build(deps): bump linkerd/dev from v43 to v44 (#3420) 2024-12-06 10:50:41 -05:00

README.md

The Linkerd Proxy

linkerd2

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 Mutual TLS;
  • 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

We use just-cargo which provide a thin wrapper around just and cargo.

We recommend that you use the included Dev Container to avoid setting up the complex development environment by hand.

Just

A justfile is provided to automate most build tasks. It provides the following recipes:

  • just build -- Compiles the proxy on your local system using cargo
  • just test -- Runs unit and integration tests on your local system using cargo
  • just docker -- Builds a Docker container image that can be used for testing.

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/.

Devcontainer

A Devcontainer is provided for use with Visual Studio Code. It includes all of the tooling needed to build and test the proxy.

Repository Structure

This project is broken into many small libraries, or crates, so that components may be compiled & tested independently. The following crate targets are especially important:

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.

Security

We test our code by way of fuzzing and this is described in FUZZING.md.

A third party security audit focused on fuzzing Linkerd2-proxy was performed by Ada Logics in 2021. The full report is available here.

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.