Skip to content

Allow configuration of cluster base domain#2930

Closed
arminbuerkle wants to merge 19 commits intolinkerd:masterfrom
alfatraining:add-cluster-domain
Closed

Allow configuration of cluster base domain#2930
arminbuerkle wants to merge 19 commits intolinkerd:masterfrom
alfatraining:add-cluster-domain

Conversation

@arminbuerkle
Copy link
Contributor

@arminbuerkle arminbuerkle commented Jun 12, 2019

PR for #1720

Adds a global --cluster-domain flag to linkerd which allows configuring linkerd in a non cluster.local setup.

You can test it by running

./bin/linkerd install --cluster-domain=mycluster.local

I tested it with go test -cover -race ./... as well as deployed it into our own cluster.


I still need to test whether upgrading your cluster works since the cluster-domain flag is now required in the global config and set to cluster.local by default.

Changing the value however is something that needs a reinstall.


I'll squash the commits when the PR looks.

@olix0r
Copy link
Member

olix0r commented Jun 13, 2019

Thanks @arminbuerkle! As one first bit of feedback, I think we'll need to start configuring the proxy's discovery suffixes:

https://github.com/linkerd/linkerd2-proxy/blob/1a52a5e6cd6d0084e5e4d928f95a08bead9c04f9/src/app/config.rs#L350-L351

The injector is going to have to be updated to support setting LINKERD2_PROXY_DESTINATION_GET_SUFFIXES and LINKERD2_PROXY_DESTINATION_PROFILE_SUFFIXES.

Because this branch is so large, it is likely to require a substantial amount of testing and review; and in that time it may run into conflicts with master as new features are merged in the next week or two.

I wonder if this can be broken into smaller PRs so that we can more easily ship tested pieces of this? For instance, if you can propose changes to the various controller components individually, and then follow with changes to the install flow that support setting non-default cluster names... We find that this incremental approach works best when adding these types of cross-cutting features to the project.

@arminbuerkle
Copy link
Contributor Author

arminbuerkle commented Jun 17, 2019

Hi @olix0r,

i started splitting this MR into smaller ones starting with #2950

The controller part still has a lot of changes, mostly auto generated though (proto, .golden, updating tests so it doesn't use cluster.local as default).

AFAIK LINKERD2_PROXY_DESTINATION_PROFILE_SUFFIXES is already set on the go side.

I can add LINKERD2_PROXY_DESTINATION_GET_SUFFIXES to the injector, though i cannot tell if there are changes required in rust since i'm not fluent in it.

The value will probably be the same as for profile suffixes, since it needs to change when external profiles are enabled?


Edit: Just added the other PRs to https://github.com/alfatraining/linkerd2/pulls. I'll add them one after the other.

@olix0r
Copy link
Member

olix0r commented Jun 17, 2019

@arminbuerkle thanks! That sounds correct. No changes should be necessary on the Rust side, as that configuration is already honored.

Signed-off-by: Armin Buerkle <[email protected]>
Signed-off-by: Armin Buerkle <[email protected]>
This probably needs a default fallback to `cluster.local`.

Otherwise when you upgrade your control plane it'll remove
"cluster.local" from every proxy injection since it'll most likely not
be set in the global config.

Needs testing.

Signed-off-by: Armin Buerkle <[email protected]>
Required to tap into resources

Signed-off-by: Armin Buerkle <[email protected]>
Changes:
- Add `-cluster-domain` flag to web srv
- Remove `clusterZoneSuffix` in profiles
  - Should be set by cmd default value
  - Added `svc.` to pkg/profiles/template.go
- Update `.golden` templates

Signed-off-by: Armin Buerkle <[email protected]>
Signed-off-by: Armin Buerkle <[email protected]>
@wmorgan
Copy link
Member

wmorgan commented Jun 25, 2019

Thanks @arminbuerkle, we will take a look soon!

@arminbuerkle
Copy link
Contributor Author

@wmorgan thanks!

I'll try and keep this branch updated as well as the ones which do the same changes but split up into several PRs starting with #2950

I use this one here currently for my local cluster and it works afaik 😄

@ihcsim
Copy link
Contributor

ihcsim commented Jun 28, 2019

@arminbuerkle Thanks again for taking this on. It's going to help out a number of people in the community. To confirm, you're going to split this PR into multiple smaller PRs, starting with #2950, right? If that's case, is it ok if we close this one?

@arminbuerkle
Copy link
Contributor Author

@ihcsim yes. I'm going to close this though i'll keep this branch updated as good as i can if anyone wants to build it themselve and try.

As i said before we're running this on two of our own clusters with different domains.

The branches for the other PRs are already created and linked above, though #2950 needs to be merged first since the others depend on that.

@ihcsim
Copy link
Contributor

ihcsim commented Jun 28, 2019

Appreciate it. We will try to get to #2950 soon as we know it affects you and a number of other users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants