linkerd2/bin
Alejandro Pedraza f9f3ebefa9
Remove namespace from charts and split them into `linkerd-crd` and `linkerd-control-plane` (#6635)
Fixes #6584 #6620 #7405

# Namespace Removal

With this change, the `namespace.yaml` template is rendered only for CLI installs and not Helm, and likewise the `namespace:` entry in the namespace-level objects (using a new `partials.namespace` helper).

The `installNamespace` and `namespace` entries in `values.yaml` have been removed.

There in the templates where the namespace is required, we moved from `.Values.namespace` to `.Release.Namespace` which is filled-in automatically by Helm. For the CLI, `install.go` now explicitly defines the contents of the `Release` map alongside `Values`.

The proxy-injector has a new `linkerd-namespace` argument given the namespace is no longer persisted in the `linkerd-config` ConfigMap, so it has to be passed in. To pass it further down to `injector.Inject()` without modifying the `Handler` signature, a closure was used.

------------
Update: Merged-in #6638: Similar changes for the `linkerd-viz` chart:

Stop rendering `namespace.yaml` in the `linkerd-viz` chart.

The additional change here is the addition of the `namespace-metadata.yaml` template (and its RBAC), _not_ rendered in CLI installs, which is a Helm `post-install` hook, consisting on a Job that executes a script adding the required annotations and labels to the viz namespace using a PATCH request against kube-api. The script first checks if the namespace doesn't already have an annotations/labels entries, in which case it has to add extra ops in that patch.

---------
Update: Merged-in the approved #6643, #6665 and #6669 which address the `linkerd2-cni`, `linkerd-multicluster` and `linkerd-jaeger` charts. 

Additional changes from what's already mentioned above:
- Removes the install-namespace option from `linkerd install-cni`, which isn't found in `linkerd install` nor `linkerd viz install` anyways, and it would add some complexity to support.
- Added a dependency on the `partials` chart to the `linkerd-multicluster-link` chart, so that we can tap on the `partials.namespace` helper.
- We don't have any more the restriction on having the muticluster objects live in a separate namespace than linkerd. It's still good practice, and that's the default for the CLI install, but I removed that validation.


Finally, as a side-effect, the `linkerd mc allow` subcommand was fixed; it has been broken for a while apparently:

```console
$ linkerd mc allow --service-account-name foobar
Error: template: linkerd-multicluster/templates/remote-access-service-mirror-rbac.yaml:16:7: executing "linkerd-multicluster/templates/remote-access-service-mirror-rbac.yaml" at <include "partials.annotations.created-by" $>: error calling include: template: no template "partials.annotations.created-by" associated with template "gotpl"
```
---------
Update: see helm/helm#5465 describing the current best-practice

# Core Helm Charts Split

This removes the `linkerd2` chart, and replaces it with the `linkerd-crds` and `linkerd-control-plane` charts. Note that the viz and other extension charts are not concerned by this change.

Also note the original `values.yaml` file has been split into both charts accordingly.

### UX

```console
$ helm install linkerd-crds --namespace linkerd --create-namespace linkerd/linkerd-crds
...
# certs.yaml should contain identityTrustAnchorsPEM and the identity issuer values
$ helm install linkerd-control-plane --namespace linkerd -f certs.yaml linkerd/linkerd-control-plane
```

### Upgrade

As explained in #6635, this is a breaking change. Users will have to uninstall the `linkerd2` chart and install these two, and eventually rollout the proxies (they should continue to work during the transition anyway).

### CLI

The CLI install/upgrade code was updated to be able to pick the templates from these new charts, but the CLI UX remains identical as before.

### Other changes

- The `linkerd-crds` and `linkerd-control-plane` charts now carry a version scheme independent of linkerd's own versioning, as explained in #7405.
- These charts are Helm v3, which is reflected in the `Chart.yaml` entries and in the removal of the `requirements.yaml` files.
- In the integration tests, replaced the `helm-chart` arg with `helm-charts` containing the path `./charts`, used to build the paths for both charts.

### Followups

- Now it's possible to add a `ServiceProfile` instance for Destination in the `linkerd-control-plane` chart.
2021-12-10 15:53:08 -05:00
..
win Update CI and docs to reference `main` branch (#4662) 2020-06-24 12:39:22 -07:00
_docker.sh Fix install-pr to use correct registry (#7083) 2021-10-20 13:55:00 -06:00
_log.sh Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
_os.sh Consider arch when building policy-controller (#7343) 2021-11-23 12:51:56 -07:00
_release.sh Fix spelling mistakes using codespell (#4700) 2020-07-07 17:07:22 -05:00
_tag.sh Migrate CI to docker buildx and other improvements (#4765) 2020-07-22 14:27:45 -05:00
_test-helpers.sh Remove namespace from charts and split them into `linkerd-crd` and `linkerd-control-plane` (#6635) 2021-12-10 15:53:08 -05:00
build-cli-bin viz: move some components into linkerd-viz (#5340) 2020-12-23 20:17:31 +05:30
certs-openssl Ability for int tests to use external certs generated with openssl (#4997) 2020-09-25 11:25:29 -05:00
create-release-tag Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
docker Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
docker-build Import the linkerd-policy-controller (#6485) 2021-08-11 12:56:12 -07:00
docker-build-cli-bin Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-cni-plugin Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-controller Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-debug Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-grafana Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-jaeger-webhook Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-metrics-api Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-policy-controller Consider arch when building policy-controller (#7343) 2021-11-23 12:51:56 -07:00
docker-build-proxy Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-tap Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-build-web Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-cache-prune Migrate CI to docker buildx and other improvements (#4765) 2020-07-22 14:27:45 -05:00
docker-pull Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-pull-binaries Speed improvements for `integration_tests.yml` and CLI docker target changes (#6762) 2021-08-27 16:02:43 -05:00
docker-push Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-retag-all Fix up docker build scripts (#6781) 2021-09-01 09:37:56 -07:00
docker-test-proxy build: Remove the DOCKER_TRACE environment variable (#5583) 2021-01-20 22:09:47 -08:00
fetch-proxy Build ARM docker images (#4794) 2020-08-05 11:14:01 -07:00
fmt Extract from public-api all the Prometheus dependencies, and moves things into a new viz component 'linkerd-metrics-api' (#5560) 2021-01-21 18:26:38 -05:00
git-commit-proxy-version Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
go-run go-run: Move temporary binary into `target` directory (#4657) 2020-06-23 15:55:34 -07:00
goimports Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
helm Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
helm-build Remove namespace from charts and split them into `linkerd-crd` and `linkerd-control-plane` (#6635) 2021-12-10 15:53:08 -05:00
helm-docs Add automatic readme generation for charts (#5316) 2020-12-02 14:37:45 -05:00
helm-docs-diff bin/shellcheck-all was missing some files (#5335) 2020-12-08 09:30:52 -05:00
image-load CI: fix image load issue in k3d (#7414) 2021-12-06 21:33:58 +05:30
install-deps Bump helm.sh/helm/v3 from 3.4.1 to 3.6.1 (#6286) 2021-06-18 09:34:29 -06:00
install-pr Fix install-pr to use correct registry (#7083) 2021-10-20 13:55:00 -06:00
k3d pin k8s versions with integration tests (#7236) 2021-11-11 21:15:50 +05:30
kind Upgrade kind to 0.11.1 (#6944) 2021-09-22 13:22:29 +01:00
kubectl Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
linkerd Created ./bin/_os.sh lib for os-arch detection (#4880) 2020-08-14 09:59:52 -05:00
lint Upgrade golangci-lint (#7338) 2021-11-23 12:54:47 -07:00
markdownlint Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
markdownlint-all Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
minikube-start-hyperv.bat Introducing Conduit, the ultralight service mesh 2017-12-05 00:24:55 +00:00
mkube Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
protoc Bump google.golang.org/protobuf from 1.27.0 to 1.27.1 (#6409) 2021-07-01 14:50:04 -06:00
protoc-diff bin/protoc-diff: Don't assume Debian and don't install unzip (#5347) 2020-12-09 09:12:38 -05:00
protoc-go.sh Remove legacy upgrade and it's references (#7309) 2021-11-29 20:08:58 +05:30
root-tag Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
shellcheck Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
shellcheck-all bin/shellcheck-all was missing some files (#5335) 2020-12-08 09:30:52 -05:00
test-cleanup Remove namespace from charts and split them into `linkerd-crd` and `linkerd-control-plane` (#6635) 2021-12-10 15:53:08 -05:00
test-clouds Improve shellscript portability by using /bin/env (#4628) 2020-06-19 15:49:29 -04:00
test-clouds-cleanup Use linkerd path in test-cleanup (#5498) 2021-01-08 15:24:14 -05:00
test-scale cli: Remove the install-sp command (#6118) 2021-05-24 13:31:07 -07:00
tests Use linkerd path in test-cleanup (#5498) 2021-01-08 15:24:14 -05:00
update-codegen.sh add mc crd to codegen (#7335) 2021-11-23 15:49:14 -07:00
web Remove browser integration tests (#6583) 2021-08-04 10:28:50 -07:00