From cf796ce3305b6f9cf8bb81879c8b98bf1a362036 Mon Sep 17 00:00:00 2001 From: boruszak Date: Tue, 4 Oct 2022 10:20:14 -0500 Subject: [PATCH] More group fix attempts --- .../cluster-peering/create-manage-peering.mdx | 119 +++++++++--------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/website/content/docs/connect/cluster-peering/create-manage-peering.mdx b/website/content/docs/connect/cluster-peering/create-manage-peering.mdx index 1a6b682000..330c8a705b 100644 --- a/website/content/docs/connect/cluster-peering/create-manage-peering.mdx +++ b/website/content/docs/connect/cluster-peering/create-manage-peering.mdx @@ -34,52 +34,52 @@ To begin the cluster peering process, generate a peering token in one of your cl Every time you generate a peering token, a single-use establishment secret is embedded in the token. Because regenerating a peering token invalidates the previously generated secret, you must use the most recently created token to establish peering connections. - + -In `cluster-01`, use the [`/peering/token` endpoint](/api-docs/peering#generate-a-peering-token) to issue a request for a peering token. + In `cluster-01`, use the [`/peering/token` endpoint](/api-docs/peering#generate-a-peering-token) to issue a request for a peering token. -```shell-session -$ curl --request POST --data '{"PeerName":"cluster-02"}' --url http://localhost:8500/v1/peering/token -``` + ```shell-session + $ curl --request POST --data '{"PeerName":"cluster-02"}' --url http://localhost:8500/v1/peering/token + ``` -The CLI outputs the peering token, which is a base64-encoded string containing the token details. + The CLI outputs the peering token, which is a base64-encoded string containing the token details. -Create a JSON file that contains the first cluster's name and the peering token. + Create a JSON file that contains the first cluster's name and the peering token. - + -```json -{ - "PeerName": "cluster-01", - "PeeringToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6IlNvbHIifQ.5T7L_L1MPfQ_5FjKGa1fTPqrzwK4bNSM812nW6oyjb8" -} -``` + ```json + { + "PeerName": "cluster-01", + "PeeringToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6IlNvbHIifQ.5T7L_L1MPfQ_5FjKGa1fTPqrzwK4bNSM812nW6oyjb8" + } + ``` - - + + - + -In `cluster-01`, use the [`consul peering generate-token` command](/commands/operator/generate-token) to issue a request for a peering token. + In `cluster-01`, use the [`consul peering generate-token` command](/commands/operator/generate-token) to issue a request for a peering token. -```shell-session -$ consul peering generate-token -name cluster-02 -``` + ```shell-session + $ consul peering generate-token -name cluster-02 + ``` -The CLI outputs the peering token, which is a base64-encoded string containing the token details. -Save this value to a file or clipboard to be used in the next step on `cluster-02`. + The CLI outputs the peering token, which is a base64-encoded string containing the token details. + Save this value to a file or clipboard to be used in the next step on `cluster-02`. - + - + -1. In the Consul UI for the datacenter associated with `cluster-01`, click **Peers**. -1. Click **Add peer connection**. -1. In the **Generate token** tab, enter `cluster-02` in the **Name of peer** field. -1. Click the **Generate token** button. -1. Copy the token before you proceed. You cannot view it again after leaving this screen. If you lose your token, you must generate a new one. + 1. In the Consul UI for the datacenter associated with `cluster-01`, click **Peers**. + 1. Click **Add peer connection**. + 1. In the **Generate token** tab, enter `cluster-02` in the **Name of peer** field. + 1. Click the **Generate token** button. + 1. Copy the token before you proceed. You cannot view it again after leaving this screen. If you lose your token, you must generate a new one. - + ### Establish a connection between clusters @@ -87,47 +87,47 @@ Save this value to a file or clipboard to be used in the next step on `cluster-0 Next, use the peering token to establish a secure connection between the clusters. - + -In one of the client agents in "cluster-02," use `peering_token.json` and the [`/peering/establish` endpoint](/api-docs/peering#establish-a-peering-connection) to establish the peering connection. This endpoint does not generate an output unless there is an error. + In one of the client agents in "cluster-02," use `peering_token.json` and the [`/peering/establish` endpoint](/api-docs/peering#establish-a-peering-connection) to establish the peering connection. This endpoint does not generate an output unless there is an error. + + ```shell-session + $ curl --request POST --data @peering_token.json http://127.0.0.1:8500/v1/peering/establish + ``` -```shell-session -$ curl --request POST --data @peering_token.json http://127.0.0.1:8500/v1/peering/establish -``` + When you connect server agents through cluster peering, their default behavior is to peer to the `default` partition. To establish peering connections for other partitions through server agents, you must add the `Partition` field to `peering_token.json` and specify the partitions you want to peer. For additional configuration information, refer to [Cluster Peering - HTTP API](/api-docs/peering). -When you connect server agents through cluster peering, their default behavior is to peer to the `default` partition. To establish peering connections for other partitions through server agents, you must add the `Partition` field to `peering_token.json` and specify the partitions you want to peer. For additional configuration information, refer to [Cluster Peering - HTTP API](/api-docs/peering). + You can dial the `peering/establish` endpoint once per peering token. Peering tokens cannot be reused after being used to establish a connection. If you need to re-establish a connection, you must generate a new peering token. -You can dial the `peering/establish` endpoint once per peering token. Peering tokens cannot be reused after being used to establish a connection. If you need to re-establish a connection, you must generate a new peering token. + - + - + In one of the client agents in "cluster-02," issue the [`consul peering establish` command](/commands/peering/establish) and specify the token generated in the previous step. The command establishes the peering connection. + The commands prints "Successfully established peering connection with cluster-01" after the connection is established. -In one of the client agents in "cluster-02," issue the [`consul peering establish` command](/commands/peering/establish) and specify the token generated in the previous step. The command establishes the peering connection. -The commands prints "Successfully established peering connection with cluster-01" after the connection is established. + ```shell-session + $ consul peering establish -name cluster-01 -peering-token token-from-generate + ``` -```shell-session -$ consul peering establish -name cluster-01 -peering-token token-from-generate -``` + When you connect server agents through cluster peering, they peer their default partitions. + To establish peering connections for other partitions through server agents, you must add the `-partition` flag to the `establish` command and specify the partitions you want to peer. + For additional configuration information, refer to [`consul peering establish` command](/commands/peering/establish) . -When you connect server agents through cluster peering, they peer their default partitions. -To establish peering connections for other partitions through server agents, you must add the `-partition` flag to the `establish` command and specify the partitions you want to peer. -For additional configuration information, refer to [`consul peering establish` command](/commands/peering/establish) . + You can run the `peering establish` command once per peering token. + Peering tokens cannot be reused after being used to establish a connection. + If you need to re-establish a connection, you must generate a new peering token. -You can run the `peering establish` command once per peering token. -Peering tokens cannot be reused after being used to establish a connection. -If you need to re-establish a connection, you must generate a new peering token. + - + - + 1. In the Consul UI for the datacenter associated with `cluster 02`, click **Peers** and then **Add peer connection**. + 1. Click **Establish peering**. + 1. In the **Name of peer** field, enter `cluster-01`. Then paste the peering token in the **Token** field. + 1. Click **Add peer**. -1. In the Consul UI for the datacenter associated with `cluster 02`, click **Peers** and then **Add peer connection**. -2. Click **Establish peering**. -3. In the **Name of peer** field, enter `cluster-01`. Then paste the peering token in the **Token** field. -4. Click **Add peer**. - - + ### Export services between clusters @@ -521,4 +521,5 @@ spec: ``` + \ No newline at end of file