Skip to content

Commit 9e696fc

Browse files
Change failover target example to API instead of decK'
Signed-off-by: Diana <[email protected]>
1 parent 14f1d92 commit 9e696fc

File tree

1 file changed

+54
-17
lines changed

1 file changed

+54
-17
lines changed

app/_how-tos/route-requests-to-backup-targets.md

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ docker run -d --rm --name primary2 -p 9002:5678 hashicorp/http-echo -text "PRIMA
5959
docker run -d --rm --name failover -p 9003:5678 hashicorp/http-echo -text "FAILOVER"
6060
```
6161

62-
## Configure a Gateway Service and Route
62+
## Configure a Gateway Service, Route, and Upstream
6363

64-
Configure a Gateway Service and Route to point to the Upstream you created in the prerequisites:
64+
Configure a Gateway Service and Route to point to the Upstream:
6565
{% entity_examples %}
6666
entities:
67+
upstreams:
68+
- name: example-upstream
6769
services:
6870
- name: example-service
6971
host: example-upstream
@@ -80,21 +82,56 @@ entities:
8082

8183
Now, you can configure Upstream with the two primary Targets `failover: false` and one failover Target `failover: true`.
8284

83-
{% entity_examples %}
84-
entities:
85-
upstreams:
86-
- name: example-upstream
87-
targets:
88-
- target: host.docker.internal:9001
89-
weight: 100
90-
failover: false
91-
- target: host.docker.internal:9002
92-
weight: 100
93-
failover: false
94-
- target: host.docker.internal:9003
95-
weight: 50
96-
failover: true
97-
{% endentity_examples %}
85+
1. Configure the first primary Target:
86+
{% capture primary %}
87+
<!--vale off -->
88+
{% control_plane_request %}
89+
url: /upstreams/example-upstream/targets/
90+
method: POST
91+
headers:
92+
- 'Accept: application/json'
93+
body:
94+
target: host.docker.internal:9001
95+
weight: 100
96+
failover: false
97+
{% endcontrol_plane_request %}
98+
<!--vale on -->
99+
{% endcapture %}
100+
{{ primary | indent: 3}}
101+
102+
1. Configure the second primary Target:
103+
{% capture secondary %}
104+
<!--vale off -->
105+
{% control_plane_request %}
106+
url: /upstreams/example-upstream/targets/
107+
method: POST
108+
headers:
109+
- 'Accept: application/json'
110+
body:
111+
target: host.docker.internal:9002
112+
weight: 100
113+
failover: false
114+
{% endcontrol_plane_request %}
115+
<!--vale on -->
116+
{% endcapture %}
117+
{{ secondary | indent: 3}}
118+
119+
1. Configure the failover Target:
120+
{% capture failover %}
121+
<!--vale off -->
122+
{% control_plane_request %}
123+
url: /upstreams/example-upstream/targets/
124+
method: POST
125+
headers:
126+
- 'Accept: application/json'
127+
body:
128+
target: host.docker.internal:9003
129+
weight: 50
130+
failover: true
131+
{% endcontrol_plane_request %}
132+
<!--vale on -->
133+
{% endcapture %}
134+
{{ failover | indent: 3}}
98135

99136
## Verify that the primary Targets handle traffic
100137

0 commit comments

Comments
 (0)