@@ -59,11 +59,13 @@ docker run -d --rm --name primary2 -p 9002:5678 hashicorp/http-echo -text "PRIMA
59
59
docker run -d --rm --name failover -p 9003:5678 hashicorp/http-echo -text " FAILOVER"
60
60
```
61
61
62
- ## Configure a Gateway Service and Route
62
+ ## Configure a Gateway Service, Route, and Upstream
63
63
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:
65
65
{% entity_examples %}
66
66
entities:
67
+ upstreams:
68
+ - name: example-upstream
67
69
services:
68
70
- name: example-service
69
71
host: example-upstream
@@ -80,21 +82,56 @@ entities:
80
82
81
83
Now, you can configure Upstream with the two primary Targets ` failover: false ` and one failover Target ` failover: true ` .
82
84
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}}
98
135
99
136
## Verify that the primary Targets handle traffic
100
137
0 commit comments