Skip to content

Commit

Permalink
CodeBlockConfig removal
Browse files Browse the repository at this point in the history
  • Loading branch information
boruszak committed Feb 22, 2023
1 parent 17c4561 commit b955d67
Showing 1 changed file with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ To configure L7 traffic management behavior in deployments with cluster peering

The following example updates the [`service-resolver` CRD](/docs/connect/config-entries/) in `cluster-01` so that Consul redirects traffic intended for the `frontend` service to a backup instance in peer `cluster-02` when it detects multiple connection failures.

<CodeBlockConfig filename="failover-resolver.yaml">

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
Expand All @@ -42,20 +40,10 @@ To configure L7 traffic management behavior in deployments with cluster peering
namespace: 'default'
```
</CodeBlockConfig>
1. Apply the resource to the local cluster.
```shell-session
$ kubectl apply --filename failover-resolver.yaml
```

1. Define the desired behavior in `service-splitter` or `service-router` CRD.

The following example splits traffic evenly between `frontend` and `frontend-peer`:

<CodeBlockConfig filename="splitter.yaml">

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceSplitter
Expand All @@ -69,20 +57,10 @@ To configure L7 traffic management behavior in deployments with cluster peering
service: frontend-peer
```

</CodeBlockConfig>

1. Apply the resource to the local cluster.

```shell-session
$ kubectl apply --filename splitter.yaml
```

1. Create a second `service-resolver` configuration entry on the local cluster that resolves the name of the peer service you used when splitting or routing the traffic.

The following example uses the name `frontend-peer` to define a redirect targeting the `frontend` service on the peer `cluster-02`:

<CodeBlockConfig filename="peer-resolver.yaml">

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
Expand All @@ -92,12 +70,4 @@ To configure L7 traffic management behavior in deployments with cluster peering
redirect:
peer: 'cluster-02'
service: 'frontend'
```

</CodeBlockConfig>

1. Apply the resource to the local cluster.

```shell-session
$ kubectl apply --filename peer-resolver.yaml
```
```

0 comments on commit b955d67

Please sign in to comment.