-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for federated services to the service mirror controller #13269
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alex Leong <[email protected]>
} | ||
} | ||
|
||
func (rcsw *RemoteClusterServiceWatcher) updateLinkStatus(statusSection, remoteName, namespace string, condition map[string]interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we get types API for all that? Does it involve regenerating the clients code, etc. We should be able to get the statuses as go types into the API and no rely on the dynamic client? We have some prior art for the HTTPRoute I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we use the dynamic client for interacting with Link resources instead of the generated binding. I think we should migrate off the dynamic client and replace it with the generated bindings, but I didn't want to block this work on that.
} | ||
} | ||
|
||
func (rcsw *RemoteClusterServiceWatcher) deleteLinkStatus(statusSection, remoteName, namespace string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment on types here. I think having explicit status types will simplify things quite a lot.
Signed-off-by: Alex Leong <[email protected]>
Signed-off-by: Alex Leong <[email protected]>
Depends on #13268
When the service mirror controller detects a service in the remote cluster which matches the federated service selector (
mirror.linkerd.io/federated=memeber
by default), it will add that service to the federated service in the local cluster named<svc>-federated
, creating this service if it does not already exist. To join a service to a federated service, it is added to themulticluster.linkerd.io/remote-discovery
annotation on the federated service which contains a comma separated list of values in the form<svc>@<cluster>
. When a remote service no longer exists or matches the federated service selector, it is removed from the federated service by removing it from themutlicluster.linkerd.io/remote-discovery
annotation.We also add a new
local-service-mirror
deployment to the Linkerd-multicluster extension which watches the local cluster for any services which match the federated service selector. Any services in the local cluster which match will be added to the federated service by setting themutlicluster.linkerd.io/local-discovery
annotation on the federated service to the local service name.