Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

TrafficSplit: Clarify root service can be any addressable name that resolves to an application accessible by the mesh #223

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

johnsonshi
Copy link

@johnsonshi johnsonshi commented May 20, 2021

TrafficSplit: Clarify root service can be any addressable name that resolves to an application accessible by the mesh

This clarifies that the TrafficSplit root
can be referenced through an FQDN.
The TrafficSplit root FQDN can either be a
(1) Kubernetes service that resolves
to the FQDN (such as service.service-namespace)
(2) other FQDNs (such as foo.com)

Resolves #215.

Signed-off-by: Johnson Shi [email protected]

@johnsonshi
Copy link
Author

@michelleN I've opened this PR to address #215.

Copy link
Contributor

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

The name of this PR is misleading. This is not just a clarification as it breaks the current API v1alpha4 and all its implementations in a backwards incompatible manner.

@johnsonshi johnsonshi changed the title Clarify that TrafficSplit root can be FQDN Chabge TrafficSplit root key from service to fqdn May 26, 2021
@johnsonshi johnsonshi changed the title Chabge TrafficSplit root key from service to fqdn Change TrafficSplit root key from service to fqdn May 26, 2021
@michelleN
Copy link
Contributor

michelleN commented May 26, 2021

@stefanprodan - I can see where you're coming from. This proposal came from a conversation that @johnsonshi and I had about TrafficSplit. I asked him to open a PR with the change so we could use it to discuss. This can probably be broken into two PRs (1) Clarifying that the root service does not need to be a Kubernetes service and (2) The proposed change of changing the service key to "fqdn". Thoughts on this are welcome.

Thanks @johnsonshi for the PR.

@stefanprodan
Copy link
Contributor

@michelleN this PR went in the opposite direction, we already released v1alpha4 https://github.com/servicemeshinterface/smi-sdk-go/tree/main/pkg/apis/split/v1alpha4 so such a change can't happen here but in v1alpha5. I also think we should't be renaming fields, in v1alpha5 we could add the fqdn field and mark service as deprecated, then in a couple of month we could release v1alpha6 that drops service.

@stefanprodan
Copy link
Contributor

stefanprodan commented May 28, 2021

Maybe a better option would be to point the service to a Kubernetes service of type ExternalName, this way we don't break the SMI API https://kubernetes.io/docs/concepts/services-networking/service/#externalname

@johnsonshi
Copy link
Author

johnsonshi commented Jun 13, 2021

Hi @michelleN and @stefanprodan, as per the last SMI community meeting, we decided to split up this PR into two. This PR is the first one, which is the uncontroversial PR that clarifies the language. We can open another PR (replacing spec.service with spec.fqdn) after this PR is merged.

https://docs.google.com/document/d/1NTBaJf6LhUBlF8_lfvBBt_MbyPvT-6CZNg6Ckpm_yCo/edit#
image

@stefanprodan stefanprodan changed the title Change TrafficSplit root key from service to fqdn Clarify that TrafficSplit root can be a FQDN Jun 14, 2021
stefanprodan
stefanprodan previously approved these changes Jun 14, 2021
Copy link
Contributor

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @johnsonshi

@stefanprodan
Copy link
Contributor

@johnsonshi @michelleN have you considered my proposal?

Maybe a better option would be to point the service to a Kubernetes service of type ExternalName, this way we don't break the SMI API https://kubernetes.io/docs/concepts/services-networking/service/#externalname

@johnsonshi
Copy link
Author

That's a great idea @stefanprodan. I'll look up info on k8s ExternalName services and see what can be done. Thanks!

@michelleN
Copy link
Contributor

@stefanprodan - I don't think we'd be breaking the SMI API by updating this language. I think the original intention was always to use the service key as an fqdn the way @johnsonshi has described. Please correct me if I'm wrong @grampelberg @nicholasjackson and others. I think we'd be making things a little more complicated for the end user by making them use ExternalName Service.

@nicholasjackson
Copy link
Collaborator

Service was always designed to be a loose coupling in the original spec, this would allow for virtual services that only have meaning to the service mesh, external services such as those running on VMs, and other clusters. As far as I am aware there is no validation that attempts to tie service to a Kubernetes service in any of the current implementations. Not sure we needed to enforce this either as this does not really break the API as it was always a string.

@nicholasjackson
Copy link
Collaborator

Reading back through this though, are we confident that this needs to be an FQDN? For example, in Consul you can define a service that is addressable just by its name from within the data center (cluster). E.G. payments, you can also have a Virtual service in a different data center that is addressable with payments.datacenter. There is no requirement to have a TLD for either of these services.

If I were to implement the proposal to the letter I would have to add a fake TLD .consul this is not a massive deal but I think could cause confusion for users as the Consul documentation does not use this approach. In addition, specifying the data center in a single DC setup feels like overkill. Realistically what I would probably do in the controller is ignore the FQDN requirement completely as just referencing the service name would work and provides a better UX to the Consul user. Obviously, if we add validation to the CRDs it is not possible to ignore the formatting of FQWDN.

In the instance that the service mesh just supports simple service names and does not support multi-cluster or TLDs, does enforcing FQDN make sense.

I agree with the sentiment in the PR to clean up the use but I honestly think that this just needs to be something like an addressable name for an application accessible by the service mesh.

@michelleN
Copy link
Contributor

@nicholasjackson Those are really good points and I am for using the wording you suggested.

@johnsonshi johnsonshi changed the title Clarify that TrafficSplit root can be a FQDN TrafficSplit: Clarify root service can be any addressable name that resolves to an application accessible by the mesh Sep 8, 2021
@johnsonshi
Copy link
Author

Incorporated wording as suggested by @nicholasjackson into my PR. Thanks!

stefanprodan
stefanprodan previously approved these changes Sep 9, 2021
Copy link
Contributor

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @johnsonshi

@michelleN
Copy link
Contributor

Thanks @johnsonshi ... We've updated our contributing guidelines to reflect a new process. Contributions / updates to the spec will now be taken on the draft branch off of this repository. Once PR #231 is merged, could you PR your changes against the draft branch? Sorry for the trouble.

@johnsonshi johnsonshi changed the base branch from main to draft September 13, 2021 12:57
@johnsonshi johnsonshi dismissed stefanprodan’s stale review September 13, 2021 12:57

The base branch was changed.

Copy link
Contributor

@michelleN michelleN left a comment

Choose a reason for hiding this comment

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

Changes look great @johnsonshi . Thank you.
Could you move these changes to apis/traffic-split/traffic-split.md?

TrafficSplit: Clarify root service can be any
addressable name that resolves to an application
accessible by the mesh.

The TrafficSplit root service can either be a
  (1) Kubernetes service that resolves
  to the desired root service (such as `service-name`
  or `service-name.service-namespace`)
  (2) other endpoints/FQDNs that resolve to the
  desired root service (such as `foo.com`)
  (3) any other addressable name for an application
  accessible by the service mesh.

Resolves #215.

Signed-off-by: Johnson Shi <[email protected]>
@johnsonshi
Copy link
Author

@michelleN done.

Copy link
Contributor

@michelleN michelleN left a comment

Choose a reason for hiding this comment

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

We can update the version of the document as a follow up

@michelleN michelleN merged commit 13ad9c4 into servicemeshinterface:draft Sep 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify SMI root/apex service does not need to be a Kubernetes service
4 participants