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

Docs/cluster peering 1.15 updates #16291

Merged
merged 63 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e878d2d
initial commit
boruszak Jan 3, 2023
5a378f5
initial commit
boruszak Jan 3, 2023
1f7e812
Overview updates
boruszak Jan 3, 2023
e7c9bd9
Overview page improvements
boruszak Jan 3, 2023
114e2e2
More Overview improvements
boruszak Jan 4, 2023
7de3fde
improvements
boruszak Jan 6, 2023
8a02c06
Small fixes/updates
boruszak Jan 18, 2023
ccacb95
Updates
boruszak Jan 20, 2023
7d258eb
Merge branch 'main' into docs/cluster-peering-1-15
boruszak Feb 13, 2023
af8c762
Overview updates
boruszak Feb 13, 2023
9a8d6b7
Nav data
boruszak Feb 13, 2023
6b883ca
More nav updates
boruszak Feb 13, 2023
09f5410
Fix
boruszak Feb 13, 2023
e097e9c
updates
boruszak Feb 13, 2023
61a1ede
Updates + tip test
boruszak Feb 13, 2023
3537863
Directory test
boruszak Feb 13, 2023
eff206e
refining
boruszak Feb 14, 2023
c9cbf30
Create restructure w/ k8s
boruszak Feb 14, 2023
1134cb5
Single usage page
boruszak Feb 15, 2023
43cd275
Technical Specification
boruszak Feb 15, 2023
2ad793f
k8s pages
boruszak Feb 15, 2023
aee7767
typo
boruszak Feb 15, 2023
258fbc9
L7 traffic management
boruszak Feb 16, 2023
8524b8d
Manage connections
boruszak Feb 16, 2023
0ad0d2f
k8s page fix
boruszak Feb 16, 2023
323865f
Create page tab corrections
boruszak Feb 16, 2023
0b424b9
link to k8s
boruszak Feb 16, 2023
c6e2d78
intentions
boruszak Feb 16, 2023
06bdd63
corrections
boruszak Feb 16, 2023
f9d8c38
Add-on intention descriptions
boruszak Feb 16, 2023
3649acd
adjustments
boruszak Feb 16, 2023
e55c1a3
Missing </CodeTabs>
boruszak Feb 16, 2023
841d351
Diagram improvements
boruszak Feb 21, 2023
5bd19e0
Final diagram update
boruszak Feb 21, 2023
48de336
Apply suggestions from code review
boruszak Feb 22, 2023
f1c006f
diagram name fix
boruszak Feb 22, 2023
542350e
Fixes
boruszak Feb 22, 2023
0bc3374
Updates to index.mdx
boruszak Feb 22, 2023
e1365b6
Tech specs page corrections
boruszak Feb 22, 2023
975ffcb
Tech specs page rename
boruszak Feb 22, 2023
c27bc97
update link to tech specs
boruszak Feb 22, 2023
b482900
K8s - new pages + tech specs
boruszak Feb 22, 2023
aa4406f
k8s - manage peering connections
boruszak Feb 22, 2023
9455d46
k8s L7 traffic management
boruszak Feb 22, 2023
ec13a85
Separated establish connection pages
boruszak Feb 22, 2023
20b78d6
Directory fixes
boruszak Feb 22, 2023
72693f5
Usage clean up
boruszak Feb 22, 2023
d846066
k8s docs edits
boruszak Feb 22, 2023
67bf051
Updated nav data
boruszak Feb 22, 2023
0ee5fc4
CodeBlock Component fix
boruszak Feb 22, 2023
17c4561
filename
boruszak Feb 22, 2023
b955d67
CodeBlockConfig removal
boruszak Feb 22, 2023
56eeda3
Redirects
boruszak Feb 22, 2023
4d23304
Update k8s filenames
im2nguyen Feb 23, 2023
3533a73
Reshuffle k8s tech specs for clarity, fmt yaml files
im2nguyen Feb 23, 2023
7bf20dd
Update general cluster peering docs, reorder CLI > API > UI, cross li…
im2nguyen Feb 23, 2023
6863c6e
Fix config rendering in k8s usage docs, cross link to general usage f…
im2nguyen Feb 23, 2023
9a17957
fix legacy link
im2nguyen Feb 23, 2023
8ea006d
update k8s docs
im2nguyen Feb 23, 2023
41def9c
fix nested list rendering
im2nguyen Feb 23, 2023
70e4061
redirect fix
boruszak Feb 23, 2023
2666d18
Merge branch 'main' into docs/cluster-peering-1-15
boruszak Feb 23, 2023
5fdb4f2
page error
boruszak Feb 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

74 changes: 54 additions & 20 deletions website/content/docs/connect/cluster-peering/index.mdx
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
---
layout: docs
page_title: Service Mesh - What is Cluster Peering?
page_title: Cluster Peering Overview
description: >-
Cluster peering establishes communication between independent clusters in Consul, allowing services to interact across datacenters. Learn about the cluster peering process, differences with WAN federation for multi-datacenter deployments, and technical constraints.
Cluster peering establishes communication between independent clusters in Consul, allowing services to interact across datacenters. Learn how cluster peering works, its differences with WAN federation for multi-datacenter deployments, and how to troubleshoot common issues.
---

# What is Cluster Peering?
# Cluster peering overview

You can create peering connections between two or more independent clusters so that services deployed to different partitions or datacenters can communicate.
This topic provides an overview of cluster peering, which lets you connect two or more independent Consul clusters so that services deployed to different partitions or datacenters can communicate.
Cluster peering is enabled in Consul by default. For specific information about cluster peering configuration and usage, refer to following pages.

## Overview
## What is cluster peering?

Cluster peering is a process that allows Consul clusters to communicate with each other. The cluster peering process consists of the following steps:
Consul supports cluster peering connections between two [admin partitions](/consul/docs/enterprise/admin-partitions) _in different datacenters_. Deployments without an Enterprise license can still use cluster peering because every datacenter automatically includes a default partition. Meanwhile, admin partitions _in the same datacenter_ do not require cluster peering connections because you can export services between them without generating or exchanging a peering token.

1. Create a peering token in one cluster.
1. Use the peering token to establish peering with a second cluster.
1. Export services between clusters.
1. Create intentions to authorize services for peers.
The following diagram describes Consul's cluster peering architecture.

This process establishes cluster peering between two [admin partitions](/consul/docs/enterprise/admin-partitions). Deployments without an Enterprise license can still use cluster peering because every datacenter automatically includes a `default` partition.
![Diagram of cluster peering with admin partitions](/img/cluster-peering-diagram.png)
boruszak marked this conversation as resolved.
Show resolved Hide resolved

For detailed instructions on establishing cluster peering connections, refer to [Create and Manage Peering Connections](/consul/docs/connect/cluster-peering/create-manage-peering).
In this diagram, the `default` partition in Consul DC 1 has a cluster peering connection with the `web` partition in Consul DC 2. Enforced by their respective mesh gateways, this cluster peering connection enables `Service B` to communicate with `Service C` as a service upstream.

> To learn how to peer clusters and connect services across peers in AWS Elastic Kubernetes Service (EKS) environments, complete the [Consul Cluster Peering on Kubernetes tutorial](/consul/tutorials/developer-mesh/cluster-peering-aws?utm_source=docs).
Cluster peering leverages several components of Consul's architecture to enforce secure communication between services:

### Differences between WAN federation and cluster peering
- A _peering token_ contains an embedded secret that securely establishes communication when shared symetrically between datacenters. Sharing this token enables each datacenter's server agents to recognize requests from authorized peers, similar to how the [gossip encryption key secures agent LAN gossip](/consul/docs/security/encryption#gossip-encryption).
boruszak marked this conversation as resolved.
Show resolved Hide resolved
- A _mesh gateway_ encrypts outgoing traffic, decrypts incoming traffic, and directs traffic to healthy services. Consul's service mesh features must be enabled in order to use mesh gateways. Mesh gateways support the specific admin partitions they are deployed on. Refer to [Mesh gateways](/consul/docs/connect/gateways/mesh-gateway) for more information.
- An _exported service_ communicates with downstreams deployed in other admin partitions. They are explicitly defined in an [`exported-services` configuration entry](/consul/docs/connect/config-entries/exported-services).
- A _service intention_ secures [service-to-service communication in a service mesh](/consul/docs/connect/intentions). Intentions enable identity-based access between services by exchanging TLS certificates, which the service's sidecar proxy verifies upon each request.

WAN federation and cluster peering are different ways to connect Consul deployments. WAN federation connects multiple datacenters to make them function as if they were a single cluster, while cluster peering treats each datacenter as a separate cluster. As a result, WAN federation requires a primary datacenter to maintain and replicate global states such as ACLs and configuration entries, but cluster peering does not.
### Compared with WAN federation

WAN federation and cluster peering are different ways to connect services through mesh gateways so that they can communicate across datacenters. WAN federation connects multiple datacenters to make them function as if they were a single cluster, while cluster peering treats each datacenter as a separate cluster. As a result, WAN federation requires a primary datacenter to maintain and replicate global states such as ACLs and configuration entries, but cluster peering does not.

WAN federation and cluster peering also treat encrypted traffic differently. While mesh gateways between WAN federated datacenters use mTLS to keep data encrypted, mesh gateways between peers terminate mTLS sessions, decrypt data to HTTP services, and then re-encrypt traffic to send to services. Data must be decrypted in order to evaluate and apply dynamic routing rules at the destination cluster, which reduces coupling between peers.

Regardless of whether you connect your clusters through WAN federation or cluster peering, human and machine users can use either method to discover services in other clusters or dial them through the service mesh.

Expand All @@ -42,11 +47,40 @@ Regardless of whether you connect your clusters through WAN federation or cluste
| Shares key/value stores | &#9989; | &#10060; |
| Can replicate ACL tokens, policies, and roles | &#9989; | &#10060; |

## Important Cluster Peering Constraints
## Guidance

The following resources are available to help you use Consul's cluster peering features.

**Tutorials:**

- To learn how to peer clusters and connect services across peers in AWS Elastic Kubernetes Service (EKS) and Google Kubernetes Engine (GKE) environments, complete the [Consul Cluster Peering on Kubernetes tutorial](/consul/tutorials/developer-mesh/cluster-peering).

**Usage documentation:**

- [Establish cluster peering connections](/consul/docs/connect/cluster-peering/usage/establish-peering)
- [Manage cluster peering connections](/consul/docs/connect/cluster-peering/usage/manage-connections)
- [Manage L7 traffic with cluster peering](/consul/docs/connect/cluster-peering/usage/peering-traffic-management)

**Kubernetes-specific documentation:**

- [Cluster peering on Kubernetes technical specifications](/consul/docs/k8s/connect/cluster-peering/tech-specs)
- [Establish cluster peering connections on Kubernetes](/consul/docs/k8s/connect/cluster-peering/usage/establish-peering)
- [Manage cluster peering connections on Kubernetes](/consul/docs/k8s/connect/cluster-peering/usage/manage-peering)
- [Manage L7 traffic with cluster peering on Kubernetes](/consul/docs/k8s/connect/cluster-peering/usage/l7-traffic)

**Reference documentation:**

- [Cluster peering technical specifications](/consul/docs/connect/cluster-peering/tech-specs)
- [HTTP API reference: `/peering/` endpoint](/consul/api-docs/peering)
- [CLI reference: `peering` command](/consul/commands/peering).

## Basic troubleshooting

Consider the following technical constraints:
If you experience errors when using Consul's cluster peering features, refer to the following list of technical constraints.

- Peer names can only contain lowercase characters.
- Services with node, instance, and check definitions totaling more than 8MB cannot be exported to a peer.
- Two admin partitions in the same datacenter cannot be peered. Use [`exported-services`](/consul/docs/connect/config-entries/exported-services#exporting-services-to-peered-clusters) directly.
- The `consul intention` CLI command is not supported. To manage intentions that specify services in peered clusters, use [configuration entries](/consul/docs/connect/config-entries/service-intentions).
- Accessing key/value stores across peers is not supported.
- Two admin partitions in the same datacenter cannot be peered. Use the [`exported-services` configuration entry](/consul/docs/connect/config-entries/exported-services#exporting-services-to-peered-clusters) instead.
- To manage intentions that specify services in peered clusters, use [configuration entries](/consul/docs/connect/config-entries/service-intentions). The `consul intention` CLI command is not supported.
- The Consul UI does not support exporting services between clusters or creating service intentions. Use either the API or the CLI to complete these required steps when establishing new cluster peering connections.
- Accessing key/value stores across peers is not supported.
Loading