Skip to content

Commit 8e06ed4

Browse files
author
Tim Bannister
committed
Improve diagrams for Source IP tutorial
The existing diagrams were ASCII art. Use drawings instead.
1 parent 8082577 commit 8e06ed4

File tree

2 files changed

+499
-33
lines changed

2 files changed

+499
-33
lines changed

content/en/docs/tutorials/services/source-ip.md

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Using Source IP
33
content_type: tutorial
4+
mermaid: true
45
min-kubernetes-server-version: v1.5
56
---
67

@@ -206,18 +207,19 @@ Note that these are not the correct client IPs, they're cluster internal IPs. Th
206207

207208
Visually:
208209

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);
220217

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 >}}
221223

222224
To avoid this, Kubernetes has a feature to
223225
[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:
261263

262264
Visually:
263265

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 >}}
275278

276279

277280

@@ -324,17 +327,7 @@ deliberately failing health checks.
324327

325328
Visually:
326329

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+
![Source IP with externalTrafficPolicy](/images/docs/sourceip-externaltrafficpolicy.svg)
338331

339332
You can test this by setting the annotation:
340333

0 commit comments

Comments
 (0)