Skip to content

Commit 72f0d1d

Browse files
authored
Merge pull request #23283 from sftim/20200820_improve_diagrams_for_ingress
Switch Ingress concept to use MermaidJS diagrams
2 parents 7a1546f + 61fdeb7 commit 72f0d1d

File tree

2 files changed

+67
-17
lines changed

2 files changed

+67
-17
lines changed

assets/scss/_custom.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ body.td-404 main .error-details {
6161
margin-bottom: 0;
6262
}
6363

64+
/* Global - Mermaid.js diagrams */
65+
66+
.mermaid {
67+
overflow-x: auto;
68+
max-width: 80%;
69+
border: 1px solid rgb(222, 226, 230);
70+
border-radius: 5px;
71+
}
72+
6473
/* HEADER */
6574

6675
.td-navbar {
@@ -542,3 +551,4 @@ body.td-documentation {
542551
}
543552
}
544553
}
554+

content/en/docs/concepts/services-networking/ingress.md

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,24 @@ For clarity, this guide defines the following terms:
2929
{{< link text="services" url="/docs/concepts/services-networking/service/" >}} within the cluster.
3030
Traffic routing is controlled by rules defined on the Ingress resource.
3131

32-
```none
33-
internet
34-
|
35-
[ Ingress ]
36-
--|-----|--
37-
[ Services ]
38-
```
32+
Here is a simple example where an Ingress sends all its traffic to one Service:
33+
{{< mermaid >}}
34+
graph LR;
35+
client([client])-. Ingress-managed <br> load balancer .->ingress[Ingress];
36+
ingress-->|routing rule|service[Service];
37+
subgraph cluster
38+
ingress;
39+
service-->pod1[Pod];
40+
service-->pod2[Pod];
41+
end
42+
classDef plain fill:#ddd,stroke:#fff,stroke-width:4px,color:#000;
43+
classDef k8s fill:#326ce5,stroke:#fff,stroke-width:4px,color:#fff;
44+
classDef cluster fill:#fff,stroke:#bbb,stroke-width:2px,color:#326ce5;
45+
class ingress,service,pod1,pod2 k8s;
46+
class client plain;
47+
class cluster cluster;
48+
{{</ mermaid >}}
49+
3950

4051
An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name-based virtual hosting. An [Ingress controller](/docs/concepts/services-networking/ingress-controllers) is responsible for fulfilling the Ingress, usually with a load balancer, though it may also configure your edge router or additional frontends to help handle the traffic.
4152

@@ -274,10 +285,25 @@ A fanout configuration routes traffic from a single IP address to more than one
274285
based on the HTTP URI being requested. An Ingress allows you to keep the number of load balancers
275286
down to a minimum. For example, a setup like:
276287

277-
```
278-
foo.bar.com -> 178.91.123.132 -> / foo service1:4200
279-
/ bar service2:8080
280-
```
288+
{{< mermaid >}}
289+
graph LR;
290+
client([client])-. Ingress-managed <br> load balancer .->ingress[Ingress, 178.91.123.132];
291+
ingress-->|/foo|service1[Service service1:4200];
292+
ingress-->|/bar|service2[Service service2:8080];
293+
subgraph cluster
294+
ingress;
295+
service1-->pod1[Pod];
296+
service1-->pod2[Pod];
297+
service2-->pod3[Pod];
298+
service2-->pod4[Pod];
299+
end
300+
classDef plain fill:#ddd,stroke:#fff,stroke-width:4px,color:#000;
301+
classDef k8s fill:#326ce5,stroke:#fff,stroke-width:4px,color:#fff;
302+
classDef cluster fill:#fff,stroke:#bbb,stroke-width:2px,color:#326ce5;
303+
class ingress,service1,service2,pod1,pod2,pod3,pod4 k8s;
304+
class client plain;
305+
class cluster cluster;
306+
{{</ mermaid >}}
281307

282308
would require an Ingress such as:
283309

@@ -321,11 +347,26 @@ you are using, you may need to create a default-http-backend
321347

322348
Name-based virtual hosts support routing HTTP traffic to multiple host names at the same IP address.
323349

324-
```none
325-
foo.bar.com --| |-> foo.bar.com service1:80
326-
| 178.91.123.132 |
327-
bar.foo.com --| |-> bar.foo.com service2:80
328-
```
350+
{{< mermaid >}}
351+
graph LR;
352+
client([client])-. Ingress-managed <br> load balancer .->ingress[Ingress, 178.91.123.132];
353+
ingress-->|Host: foo.bar.com|service1[Service service1:80];
354+
ingress-->|Host: bar.foo.com|service2[Service service2:80];
355+
subgraph cluster
356+
ingress;
357+
service1-->pod1[Pod];
358+
service1-->pod2[Pod];
359+
service2-->pod3[Pod];
360+
service2-->pod4[Pod];
361+
end
362+
classDef plain fill:#ddd,stroke:#fff,stroke-width:4px,color:#000;
363+
classDef k8s fill:#326ce5,stroke:#fff,stroke-width:4px,color:#fff;
364+
classDef cluster fill:#fff,stroke:#bbb,stroke-width:2px,color:#326ce5;
365+
class ingress,service1,service2,pod1,pod2,pod3,pod4 k8s;
366+
class client plain;
367+
class cluster cluster;
368+
{{</ mermaid >}}
369+
329370

330371
The following Ingress tells the backing load balancer to route requests based on
331372
the [Host header](https://tools.ietf.org/html/rfc7230#section-5.4).
@@ -508,4 +549,3 @@ You can expose a Service in multiple ways that don't directly involve the Ingres
508549
* Learn about the [Ingress API](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io)
509550
* Learn about [Ingress controllers](/docs/concepts/services-networking/ingress-controllers/)
510551
* [Set up Ingress on Minikube with the NGINX Controller](/docs/tasks/access-application-cluster/ingress-minikube/)
511-

0 commit comments

Comments
 (0)