Commit Graph

7 Commits

Author SHA1 Message Date
Alex Leong 049bc0cb04
feat(multicluster): Add Link v1alpha3 (#13801)
We add a new v1alpha3 resource version to the Link custom resource.  This version adds `excludedAnnotations` and `excludedLabels` fields to the spec which will be used to exclude labels and annotations from being copied onto mirror and federated services.

Signed-off-by: Alex Leong <alex@buoyant.io>
2025-03-19 12:13:16 -07:00
Alex Leong 396af7c946
refactor(multicluster): Replace use of unstructured API with typed bindings for Link CR (#13420)
The linkerd-multicluster extension uses client-go's `unstructured` API to access Link custom resources.  This API allowed us to develop quickly without the work of generating typed bindings.  However, using the unstrucutred API is error prone since fields must be accessed by their string name.  It is also inconsistent with the rest of the project which uses typed bindings.

We replace the use of the unstructured API for Link resources with generated typed bindings.  The client-go APIs are slightly different and client-go does not provide a way to update subresources for typed bindings.  Therefore, when updating a Link's status subresource, we use a patch instead of an update.

Signed-off-by: Alex Leong <alex@buoyant.io>
2024-12-10 11:44:19 -08:00
Alex Leong 3bc12b7807
Add json output to install and related commands (#12641)
We add support for the `--output/-o` flag in linkerd install and related commands. The supported output formats are yaml (default) and json. Kubectl is able to accept both of these formats which means that the output can be piped into kubectl regardless of which output format is used.

The full list of install related commands which we add json support to is:

* linkerd install
* linkerd prune
* linkerd upgrade
* linkerd uninstall
* linkerd viz install
* linkerd viz prune
* linkerd viz uninstall
* linkerd multicluster install
* linkerd multicluster prune
* linkerd multicluster uninstall
* linkerd jaeger install
* linkerd jaeger prune
* linkerd jaeger uninstall

Signed-off-by: Alex Leong <alex@buoyant.io>
2024-06-04 12:43:23 -07:00
Matei David e17a796d88
Add support for legacy names in extension uninstall (#6226)
Because extension label values have been changed, an older install of an extension will fail to be uninstalled with a more recent CLI version. This is because the uninstall command checks the new label value which doesn't match older installs.

This small change fixes that by checking both -- the new, non-prefixed version and the old prefixed one. The bug should have a relatively small impact since there are only a few edge releases that contain the prefixed label value (an exception being stable-2.10.0 which used the prefixed version still).

Signed-off-by: Matei David <matei@buoyant.io>
2021-06-08 20:18:52 +05:30
Alex Leong 5ab9f1c3f7
Print error message when there is nothing to uninstall (#6014)
Fixes #5994 

When running an uninstall command for Linkerd or a Linkerd extension and there are no resources to delete the command silently exits and prints no output.  This can be confusing.

We update the uninstall commands to print an error message to stderr if there are no resources to delete.  Since this message is printed to stderr instead of stdout, it does not interfere with piping the output to kubectl.

```console
> linkerd viz uninstall | kubectl delete -f -
No resources found to uninstall
No resources found
```

Signed-off-by: Alex Leong <alex@buoyant.io>
2021-04-13 16:12:09 -07:00
Piyush Singariya 76e00cae02
Multicluster: Uninstall multicluster without Linkerd control plane (#5744)
Problem

If the main Linkerd control plane has been uninstalled, it is no longer possible to uninstall the multicluster extension.

```
$ bin/linkerd mc uninstall | k delete -f -
Error: you need Linkerd to be installed in order to install multicluster addons
Usage:
  linkerd multicluster uninstall [flags]
```
Solution

Fetch resources with the label `linkerd.io/extension: linkerd-multicluster` and delete them

Closes #5624

Signed-off-by: Piyush Singariya <piyushsingariya@gmail.com>
2021-02-17 13:05:05 -05:00
Tarun Pothulapati 72a0ca974d
extension: Separate multicluster chart and binary (#5293)
Fixes #5257

This branch movies mc charts and cli level code to a new
top level directory. None of the logic is changed.

Also, moves some common types into `/pkg` so that they
are accessible both to the main cli and extensions.

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-12-04 16:36:10 -08:00