Commit Graph

19 Commits

Author SHA1 Message Date
Alex Leong e97b51b803
feat(mutlicluster): Add support for excluding labels and annotations from federated and mirror services (#13802)
Depends on https://github.com/linkerd/linkerd2/pull/13801

Adds support for excluding certain labels and annotations from being copied onto mirror and federated services.  This makes use of the `excludedLabels` and `excludedAnnoations` fields in the Link resource.  These fields take a list of strings which may be literal label/annotation names or they may be group globs of the form `<group>/*` which will match all labels/annotations beginning with `<group>/`.  Any matching labels or annotations will not be copied.

We also add corresponding flags to the `mc link` command: `--excluded-labels` and `--excluded-annotations` for setting these fields on the Link resource.
2025-03-26 15:08:09 -05:00
Alejandro Pedraza 37b23e11bf
feat(multicluster): have linkerd-multicluster chart be responsible for service mirror controllers - tests (#13800)
Followup to #13770, #13781 and #13782, based off of branch alpeb/multicluster-chart-manage-smc-cli-install

Addresses test task in #13768

This introduces a new boolean flag `multicluster-target-context` to the multicluster tests, that when set to true:

- the multicluster extension is installed in both clusters passing a config for a `controllers` entry.
- the `linkerd mc link` command is run with `--service-mirror=false` so it only outputs the Link CR and the credentials secrets.

This is used in a new test triggered in parallel in the test-multicluster integration test job.
2025-03-17 12:45:27 -05:00
Matei David 7d6695327c
Use proxy-init version from internal package in tests (#11921)
We keep track of our proxy-init and CNI plugin versions in two exported
variables in `pkg/version/version.go`. As part of our release process,
we require these versions to be bumped when the iptables dependencies
are bumped.

In our multicluster test, we provide a proxy-init version that's
hardcoded. Instead of relying on the release coordinator to bump the
image in the test (which can be easily missed), use the already exported
version.

Signed-off-by: Matei David <matei@buoyant.io>
2024-01-22 16:15:12 -05:00
Matei David 21046ab9ff
Skip `multicluster-gateways-endpoints` for links with no gateways (#11447)
The multicluster extension has always allowed the extension to be
installed without a gateway; the idea being that users would provide
their own. With p2p, we extended this to allow links that do not specify
a gateway at all, but in the process we missed changing a key check
-- `multicluster-gateways-endpoints` -- that asserts all links have a
probe service.

Without a gateway on the other end, a link will not have a probe spec
(or a gateway address) so it makes no sense to run this check, there
will never be a probe service created in the source cluster. To fix this
issue, we skip the check when the link misses either a gateway address
or a probe spec.

Fixes #11428

Signed-off-by: Matei David <matei@buoyant.io>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
2023-10-18 10:38:40 +01:00
Alejandro Pedraza ec1c898bd9
Bump proxy-init:v2.2.3 and cni-plugin:v1.2.2 (#11399)
https://github.com/linkerd/linkerd2-proxy-init/releases/tag/proxy-init%2Fv2.2.3
https://github.com/linkerd/linkerd2-proxy-init/releases/tag/cni-plugin%2Fv1.2.2

Updated to use go 1.21
2023-09-21 11:16:37 -05:00
Matei David c0da3b95bc
Bump CNI plugin and proxy-init versions (#11348)
* Bump CNI plugin to v1.2.1
* Bump proxy-init to v2.2.2

Both dependencies include a fix for CVE-2023-2603. Since alpine is used
as the runtime image, there is a security vulnerability detected in the
produced images (due to an issue with libcap). The alpine images have
been bumped to address the CVE.

Signed-off-by: Matei David <matei@buoyant.io>
2023-09-07 16:27:13 +01:00
Alex Leong a0af754089
Add p2p integration test (#11270)
Add an integration test that exercises the direct pod-to-pod multicluster mode.

Signed-off-by: Alex Leong <alex@buoyant.io>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
2023-08-22 09:59:36 -07:00
Arnaud Beun 2ebddd3841
Add log-format value to the multicluster-link helm chart (#10779)
Signed-off-by: Arnaud Beun <arnaud.beun@sorare.com>
Co-authored-by: Arnaud Beun <arnaud.beun@sorare.com>
2023-06-08 05:10:48 -05:00
dependabot[bot] e5830ad05b
build(deps): bump linkerd/dev from 39 to 40 (#10825)
* build(deps): bump linkerd/dev from 39 to 40

Bumps [linkerd/dev](https://github.com/linkerd/dev) from 39 to 40.
- [Release notes](https://github.com/linkerd/dev/releases)
- [Commits](https://github.com/linkerd/dev/compare/v39...v40)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alex Leong <alex@buoyant.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Leong <alex@buoyant.io>
2023-05-09 10:57:19 -07:00
Dima 46933500b7
Add new integration test for "linkerd multicluster allow" command (#6693) (#10632)
Fixes #6693

Signed-off-by: Dima Pugachev <krabradosty@gmail.com>
2023-04-20 09:34:52 -05:00
Alejandro Pedraza 0c202bf17b
Bump linkerd2-proxy-init packages (#10678)
proxy-init v2.2.1:
* Sanitize `subnets-to-ignore` flag
* Dep bumps

cni-plugin v1.1.0:
* Add support for the `config.linkerd.io/skip-subnets` annotation
* Dep bumps

validator v0.1.2:
* Dep bumps

Also, `linkerd-network-validator` is now released wrapped in a tar file, so this PR also amends `Dockerfile-proxy` to account for that.
2023-04-04 18:07:03 -05:00
Matei David 0fcf84939f
Remove viz dependency in multicluster tests (#10609)
Our multicluster integration tests used to depend on viz. Viz was used
to check the state of the gateways (`linkerd multicluster gateways`
required it). Since this is no longer the case, we can remove this
dependency to get back a few seconds of execution times (multicluster
tests are famously slow).

---------

Signed-off-by: Matei David <matei@buoyant.io>
2023-03-30 15:11:32 +01:00
Alejandro Pedraza 6247730141
Refactor `linkerd check` calls in the integration tests (#9989)
* Refactor `linkerd check` calls in the integration tests

Extracted logic into the new file `testutil/test_helper_check.go` which exposes the functions `TestCheckPre`, `TestCheck` and `TestCheckProxy`.

`linkerd check --output json` is called so its output is properly captured without the need of golden files.

Besides checking that there are no errors (although warnings are allowed), we check that the expected check categories are returned.

The plan is to leverage this in #9856 when re-enabling the helm-upgrade test.
2022-12-21 12:14:43 -05:00
Alex Leong 6762dd28ac
Add --crds flag to install/upgrade and remove config/control-plane stages (#8251)
Fixes: #8173 

In order to support having custom resources in the default Linkerd installation, it is necessary to add a separate install step to install CRDs before the core install.  The Linkerd Helm charts already accomplish this by having CRDs in a separate chart.

We add this functionality to the CLI by adding a `--crds` flag to `linkerd install` and `linkerd upgrade` which outputs manifests for the CRDs only and remove the CRD manifests when the `--crds` flag is not set.  To avoid a compounding of complexity, we remove the `config` and `control-plane` stages from install/upgrade.  The effect of this is that we drop support for splitting up an install by privilege level (cluster admin vs Linkerd admin).

The Linkerd install flow is now always a 2-step process where `linkerd install --crds` must be run first to install CRDs only and then `linkerd install` is run to install everything else.  This more closely aligns the CLI install flow with the Helm install flow where the CRDs are a separate chart.  Attempting to run `linkerd install` before the CRDs are installed will result in a helpful error message.

Similarly, upgrade is also a 2-step process of `linkerd upgrade --crds` follow by `linkerd upgrade`.

Signed-off-by: Alex Leong <alex@buoyant.io>
2022-04-28 09:36:14 -07:00
Matei David 61b75509da
Refactor multicluster test install (#8139)
This change continues the work from #7403 by refactoring the
multicluster tests in order to install components programatically.

As part of this change, we now generate certificates (a CA and a shared
issuer) in code, and add a few utilities to manage different Kubernetes
contexts; a few examples are `KubectlApplyWithContext` and a function to
re-initialise the clientset with an arbitrary context.

Few bits and pieces have also been changed as I went through this, such
as applying entire files as opposed to reading manifests in memory
before piping them to kubectl.

Some other changes:
* remove logic from test runner script that set-up multicluster
* add a more rigurous check test after linking source to target cluster
* remove `target1`, `source` and `target_statefulset` tests
* consolidated previous tests in one file

Signed-off-by: Matei David <matei@buoyant.io>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
Co-authored-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2022-04-20 10:59:12 +01:00
Ujjwal Goyal 786c9cf14a
cli: Deprecate proxy-version flag (#8027)
Fixes #7939 

Signed-off-by: Ujjwal Goyal <importujjwal@gmail.com>

Co-authored-by: Matei David <matei.david.35@gmail.com>
2022-03-30 14:44:19 -07:00
Alejandro Pedraza 88ce5ac762
Fix broken mirrored headles services after `repairEndpoints` runs (#7858)
Fixes mirrored headless services being disabled after the `repairEndpoints` function kicks-in, by just ignoring in this function the auxiliary services created to support mirrored headless services (given the `Endpoints` for these auxiliary services aren't really mirroring any `Endpoints` in the target cluster).

Supersedes #7733

## Tests

- Removed the `multicluster/target-statefulset` suite, and instead created the nginx SS as part of the `target1` suite. Then moved the tests for checking the nginx connections into the `target2` suite.
- Added two `linkerd mc check` tests in the `source` suite, the second triggered a minute after the first, in order to test things out after the `RepairEndoints` function has been triggered. 
- Also `TestMulticlusterCheck()` in `install_test.go` got a condition removed that is no longer necessary.

Co-authored-by:  Aaron Friel
2022-02-25 09:28:30 -07:00
Oliver Gould f5876c2a98
go: Enable `errorlint` checking (#7885)
Since Go 1.13, errors may "wrap" other errors. [`errorlint`][el] checks
that error formatting and inspection is wrapping-aware.

This change enables `errorlint` in golangci-lint and updates all error
handling code to pass the lint. Some comparisons in tests have been left
unchanged (using `//nolint:errorlint` comments).

[el]: https://github.com/polyfloyd/go-errorlint

Signed-off-by: Oliver Gould <ver@buoyant.io>
2022-02-16 18:32:19 -07:00
Matei David e46f7b4be2
Allow integration tests to run in parallel (#7773)
Go's test runner (`go test`) can be non-deterministic with the order in
which it runs the tests. Tests in Go seem to be always
run in parallel, but the specifics here differ depending on the
available CPU.

We can take advantage of parallelism here to get better timing on our
tests, however, we need to block the start of each test until the
control plane (or extension) pods are ready. In each `TestMain`, we
block until the pods are ready.

Signed-off-by: Matei David <matei@buoyant.io>
2022-02-07 15:21:57 +00:00