linkerd2/cli/cmd
Alex Leong 2367eea473
Create policy-controller-write Lease at runtime (#10823)
Fixes #10762 

The Linkerd control plane chart contains a Lease resource which is used by the Policy controller to do leader election.  ArgoCD considers Leases to be runtime resources and will not deploy them.  This means that Linkerd will not work for users of ArgoCD.

We remove the policy-controller-write Lease resource from the Helm chart and instead have the policy controller create this resource at startup.  We create it with an `Apply` patch with `resourceVersion="0"`.  This ensures that the Lease resource will only be created if it does not already exist and that if there are multiple replicas of the policy controller starting up at once, only one of them will create the Lease resource.

We also set the `linkerd-destination` Deployment as the owner reference of the Lease resource.  This means that when the `linkerd-destination` Deployment is deleted (for example, when Linkerd is uninstalled) then the Lease will be garbage collected by Kubernetes.

Signed-off-by: Alex Leong <alex@buoyant.io>
2023-04-27 09:59:06 -07:00
..
testdata Create policy-controller-write Lease at runtime (#10823) 2023-04-27 09:59:06 -07:00
alpha.go Remove SMI-Metrics charts and commands (#4843) 2020-08-24 14:35:33 -07:00
authz.go Update authz help text to indicate that it shows all authorizations (#9235) 2022-08-22 15:01:36 -07:00
check.go cli: Support running `check` on CLI-only extensions (#10588) 2023-03-29 12:07:36 -07:00
check_extensions.go cli: Support running `check` on CLI-only extensions (#10588) 2023-03-29 12:07:36 -07:00
check_extensions_test.go cli: Support running `check` on CLI-only extensions (#10588) 2023-03-29 12:07:36 -07:00
check_test.go Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
completion.go Add support for server resource aware completion (#6091) 2021-05-18 09:59:59 -04:00
completion_test.go build(deps): bump github.com/spf13/cobra from 1.4.0 to 1.5.0 (#8717) 2022-06-24 10:47:28 -07:00
controller-metrics.go Remove linkerd-viz dependency from linkerd-mutlicluster `gateways` command (#8467) 2022-05-31 13:51:38 -06:00
diagnostics.go Add diagnostics policy command (#9513) 2022-10-07 16:43:24 -07:00
doc.go Added missing proxy annotations in docs (#9440) 2022-09-23 16:32:34 -05:00
endpoints.go Fix --api-addr flag to be respected (#9270) 2022-09-23 13:28:27 -07:00
endpoints_test.go Fuzzing: Move fuzzers upstream (#7419) 2022-05-05 13:01:00 -06:00
identity.go enable `staticcheck` (#8037) 2022-03-10 15:43:35 -08:00
inject.go all: fix some comments (#10387) 2023-03-01 11:47:02 +00:00
inject_test.go Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
inject_util.go Add `gosec` and `errcheck` lints (#7954) 2022-03-03 10:09:51 -07:00
install-cni-plugin.go added --set flag to install-cni plugin (#10633) 2023-04-20 09:34:06 -05:00
install-cni-plugin_test.go Bump cni-plugin to v1.1.1 (#10780) 2023-04-20 12:21:09 -05:00
install.go Add support for Pod Security Admission (#9719) 2022-12-19 10:23:46 -05:00
install_cni_helm_test.go Bump cni-plugin to v1.1.1 (#10780) 2023-04-20 12:21:09 -05:00
install_helm_test.go policy: Remove `gateway.networking.k8s.io` `HTTPRoute` CRD (#8959) 2022-07-25 13:23:02 -07:00
install_test.go Removed dupe imports (#10049) 2023-01-10 14:34:56 -05:00
main_test.go viz: add render golden tests (#5433) 2021-01-12 11:59:16 +05:30
metrics.go feat(cli): add obfuscate flag for diagnostics proxy-metrics cmd (#7442) 2021-12-10 09:54:36 -08:00
metrics_diagnostics_util.go Remove linkerd-viz dependency from linkerd-mutlicluster `gateways` command (#8467) 2022-05-31 13:51:38 -06:00
metrics_diagnostics_util_test.go Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
options.go Removed dupe imports (#10049) 2023-01-10 14:34:56 -05:00
policy.go Add outbound policy support to diagnostics policy command (#10695) 2023-04-07 09:24:01 -07:00
profile.go all: fix some comments (#10387) 2023-03-01 11:47:02 +00:00
profile_test.go Bump helm.sh/helm/v3 from 3.4.1 to 3.6.1 (#6286) 2021-06-18 09:34:29 -06:00
prune.go Add prune command to linkerd and to extensions (#10303) 2023-02-17 10:44:30 -08:00
range_slice.go Enable mixed configuration of skip-[inbound|outbound]-ports (#3766) 2019-12-20 09:32:13 -05:00
range_slice_test.go Enable mixed configuration of skip-[inbound|outbound]-ports (#3766) 2019-12-20 09:32:13 -05:00
root.go Add prune command to linkerd and to extensions (#10303) 2023-02-17 10:44:30 -08:00
test_helper.go Enable gocritic linting (#7906) 2022-02-17 22:45:25 +00:00
uninject.go Remove namespace from charts and split them into `linkerd-crd` and `linkerd-control-plane` (#6635) 2021-12-10 15:53:08 -05:00
uninject_test.go test: Diff structured YAML when possible (#8432) 2022-05-10 08:40:29 -07:00
uninstall.go Upgrade golangci-lint (#7338) 2021-11-23 12:54:47 -07:00
upgrade.go Update `linkerd upgrade` instructions (#10700) 2023-04-10 11:51:57 -07:00
upgrade_test.go Removed dupe imports (#10049) 2023-01-10 14:34:56 -05:00
version.go Removed `Version` API from the public-api (#6000) 2021-04-16 11:23:55 -05:00