From 4ba1e752595d0b17b4b2edc39f8419e898796768 Mon Sep 17 00:00:00 2001 From: David Yu Date: Mon, 17 Oct 2022 10:34:05 -0700 Subject: [PATCH] docs: formatting on backend application and delete peering CRDs (#15007) * docs: formatting on backend application and delete peering CRDs Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> --- .../docs/connect/cluster-peering/k8s.mdx | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/website/content/docs/connect/cluster-peering/k8s.mdx b/website/content/docs/connect/cluster-peering/k8s.mdx index 391eddb18..1bddbd5d3 100644 --- a/website/content/docs/connect/cluster-peering/k8s.mdx +++ b/website/content/docs/connect/cluster-peering/k8s.mdx @@ -292,7 +292,7 @@ The examples described in this section demonstrate how to export a service named 1. Add the `"consul.hashicorp.com/connect-inject": "true"` annotation to your service's pods before deploying the workload so that the services in `cluster-01` can dial `backend` in `cluster-02`. To dial the upstream service from an application, configure the application so that that requests are sent to the correct DNS name as specified in [Service Virtual IP Lookups](/docs/discovery/dns#service-virtual-ip-lookups). In the following example, the annotation that allows the workload to join the mesh and the configuration provided to the workload that enables the workload to dial the upstream service using the correct DNS name is highlighted. - + ```yaml # Service to expose frontend @@ -405,12 +405,38 @@ The examples described in this section demonstrate how to export a service named ## End a peering connection To end a peering connection, delete both the `PeeringAcceptor` and `PeeringDialer` resources. + +1. Delete the `PeeringDialer` resource from the second cluster. -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 + $ kubectl --context $CLUSTER2_CONTEXT delete --filename dialer.yaml + ``` -```shell-session -$ curl "localhost:8500/v1/health/connect/backend?peer=cluster-02" -``` +1. Delete the `PeeringAcceptor` resource from the first cluster. + + ```shell-session + $ kubectl --context $CLUSTER1_CONTEXT delete --filename acceptor.yaml + ```` + +1. Confirm that you deleted your peering connection in `cluster-01` by querying the the `/health` HTTP endpoint. The peered services should no longer appear. + + 1. Exec into the server pod for the first cluster. + + ```shell-session + $ kubectl exec -it consul-server-0 -- /bin/sh + ``` + + 1. Export an ACL token to access the `/health` HTP endpoint for services. The bootstrap token may be used if an ACL token is not already provisioned. + + ```shell-session + $ export CONSUL_HTTP_TOKEN= + ``` + + 1. Query the the `/health` HTTP endpoint. The peered services should no longer appear. + + ```shell-session + $ curl "localhost:8500/v1/health/connect/backend?peer=cluster-02" + ``` ## Recreate or reset a peering connection