@@ -29,13 +29,24 @@ For clarity, this guide defines the following terms:
29
29
{{< link text="services" url="/docs/concepts/services-networking/service/" >}} within the cluster.
30
30
Traffic routing is controlled by rules defined on the Ingress resource.
31
31
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
+
39
50
40
51
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.
41
52
@@ -274,10 +285,25 @@ A fanout configuration routes traffic from a single IP address to more than one
274
285
based on the HTTP URI being requested. An Ingress allows you to keep the number of load balancers
275
286
down to a minimum. For example, a setup like:
276
287
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 >}}
281
307
282
308
would require an Ingress such as:
283
309
@@ -321,11 +347,26 @@ you are using, you may need to create a default-http-backend
321
347
322
348
Name-based virtual hosts support routing HTTP traffic to multiple host names at the same IP address.
323
349
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
+
329
370
330
371
The following Ingress tells the backing load balancer to route requests based on
331
372
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
508
549
* Learn about the [ Ingress API] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io)
509
550
* Learn about [ Ingress controllers] ( /docs/concepts/services-networking/ingress-controllers/ )
510
551
* [ Set up Ingress on Minikube with the NGINX Controller] ( /docs/tasks/access-application-cluster/ingress-minikube/ )
511
-
0 commit comments