Skip to content

Allow setting custom cluster domain in service profiles#3148

Merged
adleong merged 2 commits intolinkerd:masterfrom
alfatraining:add-cluster-domain-to-service-profiles-2
Aug 7, 2019
Merged

Allow setting custom cluster domain in service profiles#3148
adleong merged 2 commits intolinkerd:masterfrom
alfatraining:add-cluster-domain-to-service-profiles-2

Conversation

@arminbuerkle
Copy link
Contributor

Continue of #2950.

I decided to check for the clusterDomain in the config map in web server main for the same reasons as as pointed out here #3113 (comment)

It decouples the server implementations from the config.

@@ -99,13 +99,13 @@ func newCmdProfile() *cobra.Command {
}

if options.template {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be reading the cluster domain from the config object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no:

I think there's two different use cases here:

  1. I want to create my default service profile with the cluster domain read from the config (default)
  2. I want to create a custom service profile with the cluster domain overwritten from cmd args

Allowing both uses cases at the same time shouldn't be a problem. I'd implement that behaviour in the (possible) next PR which introduces the cli flag to actually set a custom cluster domain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you want to create a custom service profile with a different domain from the control plane?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you have multiple clusters, each with a different domain you don't want to switch into different kubectl contexts to create the appropriate service profile.

Instead it'd be easier to pass this as a cli flag so you can generate your service profile and then add it to source control.

So mostly out of convenience.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arminbuerkle I see what you're saying, but I think it will ultimately be confusing if the Linkerd CLI's behavior doesn't match with the current kubectl context. I'd prefer to maintain the assumption that the Linkerd CLI should always work with relation to the current kubectl context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adleong I understand, although i wouldn't agree. I think having both options can only be beneficial especially when the default option (when --cluster-domain cli arg is NOT set) generates a service profile from the cluster config.


That being said: I implemented your suggestion in 8420bb3

Overwriting it from CLI wouldn't be part of this PR anyways.

@arminbuerkle arminbuerkle force-pushed the add-cluster-domain-to-service-profiles-2 branch from fe738a4 to 0d2677c Compare July 26, 2019 18:09
@arminbuerkle arminbuerkle force-pushed the add-cluster-domain-to-service-profiles-2 branch from 0d2677c to 8420bb3 Compare July 30, 2019 12:09
@arminbuerkle arminbuerkle force-pushed the add-cluster-domain-to-service-profiles-2 branch from 8420bb3 to f0e61dd Compare July 31, 2019 07:34
@arminbuerkle arminbuerkle force-pushed the add-cluster-domain-to-service-profiles-2 branch from f0e61dd to ad19a8c Compare August 7, 2019 08:14
@arminbuerkle
Copy link
Contributor Author

Just rebased to get the changes from #3187 in.

Could someone take a look so we can get this merged?

Copy link
Contributor

@ihcsim ihcsim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@arminbuerkle IIRC, all that is left is the new CLI option and an update to the proxy container's environment variables (in the proxy injector), per #2930 (comment), right? Thanks again!

@adleong adleong merged commit e3d68da into linkerd:master Aug 7, 2019
alpeb added a commit that referenced this pull request Aug 7, 2019
Followup to #3148

Wrong args order in call to `profiles.RenderOpenAPI` was generating an
invalid service profile name.

Signed-off-by: Alejandro Pedraza <[email protected]>
alpeb added a commit that referenced this pull request Aug 7, 2019
Followup to #3148

Wrong args order in call to `profiles.RenderOpenAPI` was generating an
invalid service profile name.

Signed-off-by: Alejandro Pedraza <[email protected]>
@arminbuerkle
Copy link
Contributor Author

@ihcsim yes. CLI option and setting the proxy container env variable.

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