Ultralight, security-first service mesh for Kubernetes. Main repo for Linkerd 2.x.
Go to file
Matei David 958d7983ac
Add leader election to the service-mirror controller (#11046)
In order to support an HA mode for the service-mirror component, some
form of synchronization should be used to coordinate between replicas of
the service-mirror controller. Although in practice most of the updates
done by the replicas are idempotent (and have benign effects on
correctness), there are some downsides, such as: resource usage
implications from setting-up multiple watches, log pollution, errors
associated with writes on resources that out of date, and increased
difficulty in debugging.

This change adds coordination between the replicas through leader
election. To achieve leader election, client-go's `coordination` package
is used. The change refactors the existing code; the previous nested
loops now reside in a closure (to capture the necessary configuration),
and the closure is run when a leader is elected.

Leader election functions as part of a loop: a lease resource is created
(if it does not exist), and the controller blocks until it has acquired
the lease. The loop is terminated only on shutdown from an interrupt
signal. If the lease is lost, it is released, watchers are cleaned-up,
and the controller returns to blocking until it acquires the lease once
again.

Shutdown logic has been changed to rely on context cancellation
propagation so that the  watchers may be ended either by the leader
elector (when claim is lost) or by the main routine when an interrupt is
handled.

---------

Signed-off-by: Matei David <matei@buoyant.io>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
2023-06-29 11:27:40 +01:00
.devcontainer build(deps): bump linkerd/dev from 39 to 40 (#10825) 2023-05-09 10:57:19 -07:00
.github build(deps): bump tj-actions/changed-files from 37.0.3 to 37.0.4 (#11067) 2023-06-28 10:34:45 -07:00
audits add Trail of Bits audit; reorganize into audits/ (#8735) 2022-06-24 13:34:56 -07:00
bin Add codegen for httproute v1beta3 (#11008) 2023-06-14 15:01:56 -07:00
charts Fix support of config.linkerd.io/admin-port annotation (#11031) 2023-06-28 10:17:01 +01:00
cli Fix support of config.linkerd.io/admin-port annotation (#11031) 2023-06-28 10:17:01 +01:00
cni-plugin linkerd-cni v1.2.0 (#10973) 2023-06-02 09:10:04 -05:00
controller Fix support of config.linkerd.io/admin-port annotation (#11031) 2023-06-28 10:17:01 +01:00
grafana Fix Grafana dashboard regex for filesystem usage on Linode (#10445) 2023-03-06 08:49:31 -07:00
jaeger Updated release notes for edge-23.6.2 (#11030) 2023-06-16 16:58:17 -07:00
multicluster Add leader election to the service-mirror controller (#11046) 2023-06-29 11:27:40 +01:00
pkg fix: supplement the HA flag (#11011) 2023-06-15 13:40:09 +01:00
policy-controller Add codegen for httproute v1beta3 (#11008) 2023-06-14 15:01:56 -07:00
policy-test implement GEP-1742 timeouts in the policy controller (#10975) 2023-06-02 11:32:40 -07:00
proto Remove legacy upgrade and it's references (#7309) 2021-11-29 20:08:58 +05:30
proxy-identity Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
test Add log-format value to the multicluster-link helm chart (#10779) 2023-06-08 05:10:48 -05:00
testutil build(deps): bump linkerd/dev from 39 to 40 (#10825) 2023-05-09 10:57:19 -07:00
viz Implement jsonpath Relax func in linkerd (#11001) 2023-06-23 12:24:14 +01:00
web build(deps): bump @babel/eslint-plugin from 7.19.1 to 7.22.5 in /web/app (#11057) 2023-06-26 11:10:02 -07:00
.dockerignore dev: Add a reusable action-dev-check script (#9185) 2022-08-16 18:14:37 -07:00
.editorconfig Add PodDisruptionBudgets to control plane (#5398) (#5406) 2021-01-06 09:19:15 -05:00
.gitattributes Update gitattributes to improve PR file visilibity (#6767) 2021-08-30 14:52:53 -07:00
.gitignore Upload code coverage of unit tests to codecov (#6321) 2021-06-23 10:15:01 -06:00
.golangci.yml build(deps): bump linkerd/dev from 39 to 40 (#10825) 2023-05-09 10:57:19 -07:00
.helmdocsignore
.markdownlint.yaml
.proxy-version proxy: v2.204.0 (#11024) 2023-06-15 15:24:41 -07:00
ADOPTERS.md Add PITS Global Data Recovery Services to the adopters list (#10942) 2023-05-30 09:32:05 +01:00
BUILD.md doc: update BUILD (#10579) 2023-03-20 17:42:35 -07:00
CHANGES.md Updated release notes for edge-23.6.2 (#11030) 2023-06-16 16:58:17 -07:00
CODE_OF_CONDUCT.md build(deps): bump DavidAnson/markdownlint-cli2-action from 9.0.0 to 10.0.1 (#10843) 2023-05-02 10:08:28 -07:00
CONTRIBUTING.md Spelling (#6215) 2021-06-07 15:16:59 -06:00
Cargo.lock implement GEP-1742 timeouts in the policy controller (#10975) 2023-06-02 11:32:40 -07:00
Cargo.toml update `linkerd2-proxy-api` to v0.9.0 (#10724) 2023-04-10 13:27:36 -07:00
DCO
Dockerfile-debug Update debian to bullseye (#8287) 2022-04-19 14:25:30 -07:00
Dockerfile-proxy Bump linkerd2-proxy-init packages (#10678) 2023-04-04 18:07:03 -05:00
EXTENSIONS.md cli: Support running `check` on CLI-only extensions (#10588) 2023-03-29 12:07:36 -07:00
GOVERNANCE.md add preamble to GOVERNANCE.md (#6008) 2021-04-12 17:49:20 -05:00
LICENSE
MAINTAINERS.md Update MAINTAINERS.md (#10534) 2023-03-15 14:08:27 -05:00
README.md Fix github-actions-badge in the README.md file (#11028) 2023-06-20 15:48:27 -07:00
RELEASE.md build(deps): bump DavidAnson/markdownlint-cli2-action from 9.0.0 to 10.0.1 (#10843) 2023-05-02 10:08:28 -07:00
ROADMAP.md Update roadmap (#7413) 2021-12-13 16:11:32 -05:00
SECURITY.md add Trail of Bits audit; reorganize into audits/ (#8735) 2022-06-24 13:34:56 -07:00
STEERING.md add STEERING.md (#5607) 2021-01-27 09:39:32 -06:00
TEST.md dev: Update markdowlint-cli2 to v0.5.1 (#9166) 2022-08-15 12:59:59 -07:00
deny.toml update `kubert` to v0.16 (#10725) 2023-04-10 12:50:49 -07:00
go.mod build(deps): bump google.golang.org/grpc from 1.55.0 to 1.56.1 (#11051) 2023-06-27 11:58:05 -07:00
go.sum build(deps): bump google.golang.org/grpc from 1.55.0 to 1.56.1 (#11051) 2023-06-27 11:58:05 -07:00
justfile Remove viz dependency in multicluster tests (#10609) 2023-03-30 15:11:32 +01:00
rust-toolchain build(deps): bump linkerd/dev from 39 to 40 (#10825) 2023-05-09 10:57:19 -07:00
tools.go Update to dev:v39 with Go 1.19 (#10336) 2023-02-16 08:25:42 -08:00

README.md

Linkerd

Linkerd

CII Best Practices GitHub Actions Status GitHub license Go Report Card Go Reference Slack Status

🎈 Welcome to Linkerd! 👋

Linkerd is an ultralight, security-first service mesh for Kubernetes. Linkerd adds critical security, observability, and reliability features to your Kubernetes stack with no code change required.

Linkerd is a Cloud Native Computing Foundation (CNCF) project.

Repo layout

This is the primary repo for the Linkerd 2.x line of development.

The complete list of Linkerd repos is:

Quickstart and documentation

You can run Linkerd on any modern Kubernetes cluster in a matter of seconds. See the Linkerd Getting Started Guide for how.

For more comprehensive documentation, start with the Linkerd docs. (The doc source code is available in the website repo.)

Working in this repo

BUILD.md includes general information on how to work in this repo.

We ❤️ pull requests! See CONTRIBUTING.md for info on contributing changes.

Get involved

Community meetings

We host regular online meetings for contributors, adopters, maintainers, and anyone else interested to connect in a synchronous fashion. These meetings usually take place the last Thursday of the month at 9am Pacific / 4pm UTC.

We're a friendly group, so please feel free to join us!

Steering Committee meetings

We host regular online meetings for the Linkerd Steering Committee. All are welcome to attend, but audio and video participation is limited to Steering Committee members and maintainers. These meetings are currently scheduled on an ad-hoc basis and announced on the linkerd-users mailing list.

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

See SECURITY.md for our security policy, including how to report vulnerabilities.

Linkerd undergoes periodic third-party security audits and we publish the results here.

License

Copyright 2023 the Linkerd 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.