Ultralight, security-first service mesh for Kubernetes. Main repo for Linkerd 2.x.
Go to file
Kevin Leimkuhler 2442ca07bf
Parse Pod labels for owning Deployment instead of name (#8920)
Closes #8916

When a random Pod (meshed or not) is created in the `linkerd`, `linkerd-viz`, or
`linkerd-jaeger` namespaces their respective `check` subcommands can fail.

We parse Pod names for their owning Deployment by assuming the Pod name has a
randomized suffix. For example, the `linkerd-destination` Deployment creates the
`linkerd-destination-58c57dd675-7tthr` Pod. We split the name on `-` and take
the first two parts (`["linkerd", "destination"]`); those first two parts make
up the Deployment name.

Now, if a random Pod is created in the namespace with the name `test`, we apply
that same logic but hit a runtime error when trying to get the first two parts
of the split. `test` did not split at all since it contains no `-` and therefore
we error with `slice bounds out of range`.

To fix this, we now use the fact that all Linkerd components have a
`linkerd.io/control-plane-component` or `component` label with a value that is
the owning Deployment. This allows us to avoid any extra parsing logic and just
look at a single label value.

Additionally, some of these checks get all the Pods in a namespace with the
`GetPodsByNamespace` method but we don't always need something so general. In
the places where we are checking specifically for Linkerd components, we can
narrow this further by using the expected LabelSelector such as
`linkerd.io/extension=viz`.

Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2022-07-19 12:14:55 -06:00
.devcontainer dev: Update build tooling (#8883) 2022-07-14 08:27:44 -07:00
.github build(deps): bump olix0r/cargo-action-fmt (#8921) 2022-07-18 22:43:22 -07:00
audits add Trail of Bits audit; reorganize into audits/ (#8735) 2022-06-24 13:34:56 -07:00
bin Revert "feat: use direct image import in policy controller tests (#8771)" (#8813) 2022-07-05 13:33:00 -07:00
charts Bump proxy-init version to v1.6.1 (#8913) 2022-07-18 13:03:26 -07:00
cli Bump proxy-init version to v1.6.1 (#8913) 2022-07-18 13:03:26 -07:00
cni-plugin Bump proxy-init version to v1.6.1 (#8913) 2022-07-18 13:03:26 -07:00
controller Bump proxy-init version to v1.6.1 (#8913) 2022-07-18 13:03:26 -07:00
grafana Parametrized datasource in grafana dashboards, better script handling (#7603) 2022-01-14 11:30:19 -05:00
jaeger Parse Pod labels for owning Deployment instead of name (#8920) 2022-07-19 12:14:55 -06:00
multicluster Allow extension deployments to be evicted by autoscaler (#8828) 2022-07-12 10:46:31 -07:00
pkg Parse Pod labels for owning Deployment instead of name (#8920) 2022-07-19 12:14:55 -06:00
policy-controller policy: Simplify port conversion syntax (#8899) 2022-07-15 13:04:31 -07:00
policy-test policy: Use `NonZeroU16` to represent ports (#8897) 2022-07-15 11:41:56 -07:00
proto Remove legacy upgrade and it's references (#7309) 2021-11-29 20:08:58 +05:30
proxy-identity Add `gosec` and `errcheck` lints (#7954) 2022-03-03 10:09:51 -07:00
test Use prommatch everywhere (#8674) 2022-06-21 21:48:51 -06:00
testutil Use prommatch everywhere (#8674) 2022-06-21 21:48:51 -06:00
viz Parse Pod labels for owning Deployment instead of name (#8920) 2022-07-19 12:14:55 -06:00
web build(deps-dev): bump eslint from 8.19.0 to 8.20.0 in /web/app (#8905) 2022-07-18 10:04:35 -07:00
.dockerignore Update to `linkerd2-proxy-api` v0.5.0 (#8229) 2022-04-11 11:46:16 -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 Deprecate Gateways API and skip lints until 2.13 (#8600) 2022-06-07 14:19:11 -06:00
.helmdocsignore Add automatic readme generation for charts (#5316) 2020-12-02 14:37:45 -05:00
.markdownlint.yaml Lint all markdown files in CI (#4402) 2020-05-19 23:03:50 -07:00
.proxy-version proxy: v2.183.0 (#8869) 2022-07-13 18:37:27 -07:00
ADOPTERS.md Update ADOPTERS.md (#8648) 2022-06-13 07:03:12 -05:00
BUILD.md Run lint action from the devcontainer, remove bin/lint script (#7895) 2022-02-17 14:46:57 -08:00
CHANGES.md Fix edge heading version (#8850) 2022-07-11 13:00:20 -07:00
CODE_OF_CONDUCT.md Lint all markdown files (#4403) 2020-05-19 09:59:26 -07:00
CONTRIBUTING.md Spelling (#6215) 2021-06-07 15:16:59 -06:00
Cargo.lock build(deps): bump crypto-common from 0.1.5 to 0.1.6 (#8914) 2022-07-18 09:54:02 -07:00
Cargo.toml Test the policy controller admission webhook (#8008) 2022-03-07 11:53:28 -08:00
DCO Add contributing doc and DCO file (#88) 2017-12-22 14:54:27 -08:00
Dockerfile-debug Update debian to bullseye (#8287) 2022-04-19 14:25:30 -07:00
Dockerfile-proxy Update Go to the latest 1.17 release (#8603) 2022-06-03 08:33:21 -05:00
EXTENSIONS.md Versioned `linkerd check` hint URLs (#6102) 2021-05-10 13:21:15 -05:00
GOVERNANCE.md add preamble to GOVERNANCE.md (#6008) 2021-04-12 17:49:20 -05:00
LICENSE Introducing Conduit, the ultralight service mesh 2017-12-05 00:24:55 +00:00
MAINTAINERS.md Add @mateiidavid to maintainers (#6597) 2021-08-04 09:02:47 -07:00
README.md add godoc links to README (#8649) 2022-06-13 07:06:01 -05:00
RELEASE.md Add release instructions (#7574) 2022-01-12 10:24:24 -08: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 Remove browser integration tests (#6583) 2021-08-04 10:28:50 -07:00
deny.toml build(deps): bump unicode-ident from 1.0.1 to 1.0.2 (#8910) 2022-07-18 08:58:39 -07:00
go.mod Bump proxy-init version to v1.6.1 (#8913) 2022-07-18 13:03:26 -07:00
go.sum Bump proxy-init version to v1.6.1 (#8913) 2022-07-18 13:03:26 -07:00
rust-toolchain dev: Update build tooling (#8883) 2022-07-14 08:27:44 -07:00
tools.go Update protoc (#6333) 2021-06-21 16:37:57 -07: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.

A third party security audit was performed by Cure53 in June 2019. You can see the full report here.

License

Copyright 2021 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.