|
1 | 1 | ---
|
2 | 2 | title: Using Source IP
|
3 | 3 | content_type: tutorial
|
| 4 | +mermaid: true |
4 | 5 | min-kubernetes-server-version: v1.5
|
5 | 6 | ---
|
6 | 7 |
|
@@ -206,18 +207,19 @@ Note that these are not the correct client IPs, they're cluster internal IPs. Th
|
206 | 207 |
|
207 | 208 | Visually:
|
208 | 209 |
|
209 |
| -``` |
210 |
| - client |
211 |
| - \ ^ |
212 |
| - \ \ |
213 |
| - v \ |
214 |
| - node 1 <--- node 2 |
215 |
| - | ^ SNAT |
216 |
| - | | ---> |
217 |
| - v | |
218 |
| - endpoint |
219 |
| -``` |
| 210 | +{{< mermaid >}} |
| 211 | +graph LR; |
| 212 | + client(client)-->node2[Node 2]; |
| 213 | + node2-->client; |
| 214 | + node2-. SNAT .->node1[Node 1]; |
| 215 | + node1-. SNAT .->node2; |
| 216 | + node1-->endpoint(Endpoint); |
220 | 217 |
|
| 218 | + classDef plain fill:#ddd,stroke:#fff,stroke-width:4px,color:#000; |
| 219 | + classDef k8s fill:#326ce5,stroke:#fff,stroke-width:4px,color:#fff; |
| 220 | + class node1,node2,endpoint k8s; |
| 221 | + class client plain; |
| 222 | +{{</ mermaid >}} |
221 | 223 |
|
222 | 224 | To avoid this, Kubernetes has a feature to
|
223 | 225 | [preserve the client source IP](/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip).
|
@@ -261,17 +263,18 @@ This is what happens:
|
261 | 263 |
|
262 | 264 | Visually:
|
263 | 265 |
|
264 |
| -``` |
265 |
| - client |
266 |
| - ^ / \ |
267 |
| - / / \ |
268 |
| - / v X |
269 |
| - node 1 node 2 |
270 |
| - ^ | |
271 |
| - | | |
272 |
| - | v |
273 |
| - endpoint |
274 |
| -``` |
| 266 | +{{< mermaid >}} |
| 267 | +graph TD; |
| 268 | + client --> node1[Node 1]; |
| 269 | + client(client) --x node2[Node 2]; |
| 270 | + node1 --> endpoint(endpoint); |
| 271 | + endpoint --> node1; |
| 272 | + |
| 273 | + classDef plain fill:#ddd,stroke:#fff,stroke-width:4px,color:#000; |
| 274 | + classDef k8s fill:#326ce5,stroke:#fff,stroke-width:4px,color:#fff; |
| 275 | + class node1,node2,endpoint k8s; |
| 276 | + class client plain; |
| 277 | +{{</ mermaid >}} |
275 | 278 |
|
276 | 279 |
|
277 | 280 |
|
@@ -324,17 +327,7 @@ deliberately failing health checks.
|
324 | 327 |
|
325 | 328 | Visually:
|
326 | 329 |
|
327 |
| -``` |
328 |
| - client |
329 |
| - | |
330 |
| - lb VIP |
331 |
| - / ^ |
332 |
| - v / |
333 |
| -health check ---> node 1 node 2 <--- health check |
334 |
| - 200 <--- ^ | ---> 500 |
335 |
| - | V |
336 |
| - endpoint |
337 |
| -``` |
| 330 | + |
338 | 331 |
|
339 | 332 | You can test this by setting the annotation:
|
340 | 333 |
|
|
0 commit comments