Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MCS] Remove "derived-" prefix of MCS #2384

Closed
lihui920913 opened this issue Aug 16, 2022 · 4 comments · Fixed by #3694 or #3705
Closed

[MCS] Remove "derived-" prefix of MCS #2384

lihui920913 opened this issue Aug 16, 2022 · 4 comments · Fixed by #3694 or #3705
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@lihui920913
Copy link

What would you like to be added:
Remove "derived-" prefix of MCS, so user can use the same k8s service name in other k8s clusters.

Why is this needed:
Karmada is supposed to offer one-cluster view. However user need to change there application settings when using MCS.

Maybe there could be an validation to refuse the ServiceImport object when there has been a same-name service in the target cluster.

@lihui920913 lihui920913 added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 16, 2022
@GitHubxsy
Copy link
Contributor

Consider providing feature switches.
Allows users to associate endpointslices with the original service.
@RainbowMango @XiShanYongYe-Chang

@XiShanYongYe-Chang
Copy link
Member

Consider providing feature switches.
Allows users to associate endpointslices with the original service.

+1

But the current issue seems to be pointing to something else.

@bivas
Copy link
Contributor

bivas commented May 29, 2023

Following a discussion in Karmad'a community Slack channel

I've tested the following flows to support the service import idea:

  1. Deployment and Service are created on cluster member1 and the Service imported to cluster member2 using ServiceImport
  2. Deployment and Service are created on cluster member1 and both propagated to cluster member2. Service from cluster member1 is imported to cluster member2 using ServiceImport

Scenario 1

Service from member1 is available in member2. The service can be accessed inside member2 as an ordinary Service with the name foo.myspace.svc.cluster.local . The import process doesn't prefix the service with derived- prefix but still uses import- for the EndPointSlice

Scenario 2

Service from member1 has a conflict when attempting to import to member2. I changed the controller to avoid this collision and ignore the Service creation and only create the EndPointSlice (still prefixed with import-).
Cluster member2 has the following:

  • Service with the name foo
  • 2 EndPointSlice
    • First EndPointSlice is accessing the local Deployment running in member2
    • Imported EndPointSlice pointing to the remote Deployment running in member1
      When I attempt to access the service in cluster member2 using foo.myspace.svc.cluster.local the requests go round robin between local and remote services (member1 and member2).

The way that I implemented this flow is what can be referred to as local-and-remote service discovery. The options could be:

  1. Local only - in case there's a local service by the name foo Karmada never attempts to import the remote service and doesn't create the EndPointSlice
  2. Local and Remote - this is the scenario I implemented. Users accessing the foo service will reach either member1 or member2
  3. Remote only - in case there's a local service by the name foo Karmada will remove the local EndPointSlice and will create the EndPointSlice pointing to the other cluster (e.g. instead of resolving member2 cluster is will reach member1)

My tested code is missing a lot of the conflict resolution logic and I just created it as a highly tailored PoC. This implementation aligns with the KEP-1645 guidelines and adapts concepts from liqo and submariner for service import.

@XiShanYongYe-Chang
Copy link
Member

Hi @bivas, I'm very sorry for not keeping track of the progress and responding to your reply for such a long time. Recently, I have been busy with other things which caused a delay in this matter.

I think your testing and practice are great. Remove the "derived-" prefix from the service, which will be a very user-friendly action and bring us many benefits.

Can we further advance this plan? Would you like to propose a proposal so that we can further promote the implementation of this plan in the Karmada community?

Apologies again for my delayed response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
4 participants