|
|
|
@ -40,6 +40,8 @@ To establish cluster peering through Kubernetes, deploy clusters with the follow
|
|
|
|
|
enabled: true
|
|
|
|
|
connectInject:
|
|
|
|
|
enabled: true
|
|
|
|
|
controller:
|
|
|
|
|
enabled: true
|
|
|
|
|
meshGateway:
|
|
|
|
|
enabled: true
|
|
|
|
|
replicas: 1
|
|
|
|
@ -98,7 +100,7 @@ To peer Kubernetes clusters running Consul, you need to create a peering token a
|
|
|
|
|
$ kubectl apply --filename peering-token.yml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
1. In "cluster-02," create the `PeeringDialer` custom resource.
|
|
|
|
|
1. In `cluster-02`, create the `PeeringDialer` custom resource.
|
|
|
|
|
|
|
|
|
|
<CodeBlockConfig filename="dialer.yml">
|
|
|
|
|
|
|
|
|
@ -139,7 +141,7 @@ To peer Kubernetes clusters running Consul, you need to create a peering token a
|
|
|
|
|
|
|
|
|
|
</CodeBlockConfig>
|
|
|
|
|
|
|
|
|
|
1. In "cluster-02," create an `ExportedServices` custom resource.
|
|
|
|
|
1. In `cluster-02`, create an `ExportedServices` custom resource.
|
|
|
|
|
|
|
|
|
|
<CodeBlockConfig filename="exportedsvc.yml">
|
|
|
|
|
|
|
|
|
@ -150,9 +152,9 @@ To peer Kubernetes clusters running Consul, you need to create a peering token a
|
|
|
|
|
name: default ## The name of the partition containing the service
|
|
|
|
|
spec:
|
|
|
|
|
services:
|
|
|
|
|
name: backend-service ## The name of the service you want to export
|
|
|
|
|
consumers:
|
|
|
|
|
peerName: cluster-01 ## The name of the peer that receives the service
|
|
|
|
|
- name: backend-service ## The name of the service you want to export
|
|
|
|
|
consumers:
|
|
|
|
|
- peer: cluster-01 ## The name of the peer that receives the service
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</CodeBlockConfig>
|
|
|
|
@ -184,13 +186,13 @@ To peer Kubernetes clusters running Consul, you need to create a peering token a
|
|
|
|
|
$ kubectl apply --filename backend-service.yml --filename exportedsvc.yml --filename intention.yml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
1. To confirm that you peered your clusters, in "cluster-01," query the `/health` HTTP endpoint.
|
|
|
|
|
1. To confirm that you peered your clusters, in `cluster-01`, query the `/health` HTTP endpoint.
|
|
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
|
$ curl "localhost:8500/v1/health/connect/backend?peer=cluster-02"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
1. For the services in "cluster-01" that you want to access the "backend-service," add the following annotations to the service file.
|
|
|
|
|
1. For the services in `cluster-01` that you want to access the "backend-service," add the following annotations to the service file.
|
|
|
|
|
|
|
|
|
|
<CodeBlockConfig filename="frontend-service.yml">
|
|
|
|
|
|
|
|
|
@ -227,7 +229,7 @@ To peer Kubernetes clusters running Consul, you need to create a peering token a
|
|
|
|
|
|
|
|
|
|
To end a peering connection, delete both the `PeeringAcceptor` and `PeeringDialer` resources.
|
|
|
|
|
|
|
|
|
|
To confirm that you deleted your peering connection, in "cluster-01," query the `/health` HTTP endpoint. The peered services should no longer appear.
|
|
|
|
|
To confirm that you deleted your peering connection, in `cluster-01`, query the `/health` HTTP endpoint. The peered services should no longer appear.
|
|
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
|
$ curl "localhost:8500/v1/health/connect/backend?peer=cluster-02"
|
|
|
|
|