linkerd2/multicluster/cmd
Matei David e1e7b1d280
Introduce support for StatefulSets across multicluster (#6090)
The purpose of this PR is to mirror StatefulSets in a multicluster setting. Currently, it isn't possible to communicate with a specific pod in a StatefulSet across clusters without manually creating clusterIP services for each pod backing the StatefulSet in the target cluster.

After some brainstorming, we decided that one way to solve this problem is to have the Service Mirror component create a "root" headless service in our source cluster along with clusterIP services (one for each pod backing the StatefulSet in the target cluster). The idea here is that each individual clusterIP service will also have an Endpoints object whose only
host is the Gateway IP -- this is the way mirrored services are constructed in a multicluster environment. The Endpoints object for the root service will contain pairs of hostnames and IP addresses; each hostname maps to the name of a pod in the StatefulSet, its IP corresponds to the clusterIP service that the Service Mirror would create in the source cluster.

To exemplify, assume a StatefulSet `foo` in a target cluster `west` with 2 pods (foo-0, foo-1). In the source cluster `east`, we create a headless root service foo-west` and 2 services (`foo-0-west`, `foo-1-west`) whose  Endpoints point to the Gateway IP.  Foo-west's Endpoints will contain an  AddressSet with two hosts:
```yaml
# foo-west Endpoints
  - hostname: foo-0 
     ip: <clusterIP of foo-0-west>
  - hostname: foo-1 
     ip: <clusterIP of foo-1-west>
```

By making these changes, we solve the concerns associated with manually creating these services since the Service Mirror would reconcile, create and delete  the clusterIP services (as opposed to requiring any interaction from the end user). Furthermore, by having a "root" headless service we can also configure DNS -- for an end user, there wouldn't be any difference in addressing a specific pod in the StatefulSet as far as syntax goes (i.e the host `foo-0.foo-west.default.svc.cluster.local` would point to the pod foo-0 in cluster west).

Closes #5162
2021-07-29 14:12:20 -06:00
..
service-mirror Introduce support for StatefulSets across multicluster (#6090) 2021-07-29 14:12:20 -06:00
allow.go add resource aware completion in jaeger and multicluster (#6183) 2021-05-28 13:45:30 -05:00
check.go Add support for legacy names in extension uninstall (#6226) 2021-06-08 20:18:52 +05:30
gateways.go Add nodePorts option to multicluster helm chart (#6059) 2021-05-11 17:41:59 -05:00
install.go Add missing psp for extensions (#6186) 2021-05-31 08:36:50 -05:00
link.go Add missing psp for extensions (#6186) 2021-05-31 08:36:50 -05:00
root.go add resource aware completion for core linkerd cmd (#6217) 2021-06-07 10:45:19 -05:00
uninstall.go Add support for legacy names in extension uninstall (#6226) 2021-06-08 20:18:52 +05:30
unlink.go add resource aware completion in jaeger and multicluster (#6183) 2021-05-28 13:45:30 -05:00