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

Add remote-discovery service mirroring #11201

Merged
merged 2 commits into from
Aug 8, 2023
Merged

Add remote-discovery service mirroring #11201

merged 2 commits into from
Aug 8, 2023

Conversation

adleong
Copy link
Member

@adleong adleong commented Aug 3, 2023

We add the ability to mirror services in "remote discovery" mode where no Endpoints are created for the service in the source cluster, but instead the multicluster.linkerd.io/remote-discovery and multicluster.linkerd.io/remote-service labels are set on the mirror service to indicate that the control plane should perform remote discovery for this service.

To accomplish this, we add a new field to the Link resource: remoteDiscoverySelector which is a parallel to selector but instead it selects Services to export in remote discovery mode. Since this field is purely additive, we do not change the Link CRD version. By treating an empty selector as "Nothing", we remain backwards compatible (an unset remoteDiscoverySelector will not export any services in remote discovery mode).

Signed-off-by: Alex Leong <[email protected]>
Signed-off-by: Alex Leong <[email protected]>
@adleong adleong requested a review from a team as a code owner August 3, 2023 23:49
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

This all looks solid to me 👍
Now I need to figure flat networking with k3d in my machine to test...

}

func (rcsw *RemoteClusterServiceWatcher) isRemoteDiscovery(svc *corev1.Service) bool {
// Treat an empty remoteDisocverySelector as "Nothing" instead of
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Treat an empty remoteDisocverySelector as "Nothing" instead of
// Treat an empty remoteDiscoverySelector as "Nothing" instead of

Copy link
Member

@mateiidavid mateiidavid left a comment

Choose a reason for hiding this comment

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

Looks great! I tested this out locally and it works as expected, no endpoints are created and the correct labels are added:

metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"service.kubernetes.io/topology-aware-hints":"auto"},"labels":{"mirror.linkerd.io/exported":"true"},"name":"podinfo","namespace":"default"},"spec":{"ports":[{"port":80,"targetPort":9898}],"selector":{"app":"podinfo"},"type":"ClusterIP"}}
    mirror.linkerd.io/remote-resource-version: "1510"
    mirror.linkerd.io/remote-svc-fq-name: podinfo.default.svc.cluster.local
    service.kubernetes.io/topology-aware-hints: auto
  creationTimestamp: "2023-08-08T13:02:27Z"
  labels:
    mirror.linkerd.io/cluster-name: target
    mirror.linkerd.io/mirrored-service: "true"
    multicluster.linkerd.io/remote-discovery: target
    multicluster.linkerd.io/remote-service: podinfo

One small nit. Should we make it so that service.kubernetes.io/topology-aware-hints is not copied over? We mentioned that a few times when talking about the service mirror's role in multicluster.

@adleong adleong merged commit 084e955 into main Aug 8, 2023
36 checks passed
@adleong adleong deleted the alex/telescope branch August 8, 2023 19:51
adleong added a commit that referenced this pull request Aug 9, 2023
This is a follow-up to #11201, addressing some feedback from that PR.

* fixes a typo in a comment
* do not copy the topology aware hints (TAH) annotation onto mirror service, becuase TAH is not multicluster aware.

Signed-off-by: Alex Leong <[email protected]>
hawkw added a commit that referenced this pull request Aug 11, 2023
## edge-23.8.2

This edge release adds improvements to Linkerd's multi-cluster features
as part of the [flat network support] planned for Linkerd stable-2.14.0.
In addition, it fixes an issue ([#10764]) where warnings about an
invalid metric were logged frequently by the Destination controller.

* Added a new `remoteDiscoverySelector` field to the multicluster `Link`
  CRD, which enables a service mirroring mod where the control plane
  performs discovery for the mirrored service from the remote cluster,
  rather than creating Endpoints for the mirrored service in the source
  cluster ([#11190], [#11201], [#11220], and [#11224])
* Fixed missing "Services" menu item in the Spanish localization for the
  `linkerd-viz` web dashboard ([#11229]) (thanks @mclavel!)
* Replaced `server_port_subscribers` Destination controller gauge metric
  with `server_port_subscribes` and `server_port_unsubscribes` counter
  metrics ([#11206]; fixes [#10764])
* Replaced deprecated `failure-domain.beta.kubernetes.io` labels in Helm
  charts with `topology.kubernetes.io` labels ([#11148]; fixes [#11114])
  (thanks @piyushsingariya!)

[#10764]: #10764
[#11114]: #11114
[#11148]: #11148
[#11190]: #11190
[#11201]: #11201
[#11206]: #11206
[#11220]: #11220
[#11224]: #11224
[#11229]: #11229
[flat network support]:
    https://linkerd.io/2023/07/20/enterprise-multi-cluster-at-scale-supporting-flat-networks-in-linkerd/
@hawkw hawkw mentioned this pull request Aug 11, 2023
hawkw added a commit that referenced this pull request Aug 11, 2023
## edge-23.8.2

This edge release adds improvements to Linkerd's multi-cluster features
as part of the [flat network support] planned for Linkerd stable-2.14.0.
In addition, it fixes an issue ([#10764]) where warnings about an
invalid metric were logged frequently by the Destination controller.

* Added a new `remoteDiscoverySelector` field to the multicluster `Link`
  CRD, which enables a service mirroring mode where the control plane
  performs discovery for the mirrored service from the remote cluster,
  rather than creating Endpoints for the mirrored service in the source
  cluster ([#11190], [#11201], [#11220], and [#11224])
* Fixed missing "Services" menu item in the Spanish localization for the
  `linkerd-viz` web dashboard ([#11229]) (thanks @mclavel!)
* Replaced `server_port_subscribers` Destination controller gauge metric
  with `server_port_subscribes` and `server_port_unsubscribes` counter
  metrics ([#11206]; fixes [#10764])
* Replaced deprecated `failure-domain.beta.kubernetes.io` labels in Helm
  charts with `topology.kubernetes.io` labels ([#11148]; fixes [#11114])
  (thanks @piyushsingariya!)

[#10764]: #10764
[#11114]: #11114
[#11148]: #11148
[#11190]: #11190
[#11201]: #11201
[#11206]: #11206
[#11220]: #11220
[#11224]: #11224
[#11229]: #11229
[flat network support]:
    https://linkerd.io/2023/07/20/enterprise-multi-cluster-at-scale-supporting-flat-networks-in-linkerd/
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.

3 participants