Skip to content

Commit 782314a

Browse files
committed
fix lint
Signed-off-by: Loong <[email protected]>
1 parent 691d1bd commit 782314a

File tree

1 file changed

+9
-57
lines changed
  • docs/root/configuration/other_features

1 file changed

+9
-57
lines changed

docs/root/configuration/other_features/dlb.rst

Lines changed: 9 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -44,73 +44,27 @@ Using Dlb
4444

4545
Create a config file to make Envoy listen 10000 port as proxy, the upstream server listens 12000 port.
4646

47-
```shell
48-
$ cat > dlb-config.yaml<<EOF
49-
static_resources:
50-
listeners:
51-
- address:
52-
socket_address:
53-
address: 0.0.0.0
54-
port_value: 10000
55-
connection_balance_config:
56-
extend_balance:
57-
name: envoy.network.connection_balance.dlb
58-
typed_config:
59-
"@type": type.googleapis.com/envoy.extensions.network.connection_balance.dlb.v3alpha.Dlb
60-
filter_chains:
61-
- filters:
62-
- name: envoy.filters.network.http_connection_manager
63-
typed_config:
64-
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
65-
codec_type: AUTO
66-
stat_prefix: ingress_http
67-
route_config:
68-
name: local_route
69-
virtual_hosts:
70-
- name: backend
71-
domains:
72-
- "*"
73-
routes:
74-
- match:
75-
prefix: "/"
76-
route:
77-
cluster: service1
78-
http_filters:
79-
- name: envoy.filters.http.router
80-
typed_config:
81-
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
82-
83-
clusters:
84-
- name: service1
85-
load_assignment:
86-
cluster_name: service1
87-
endpoints:
88-
- lb_endpoints:
89-
- endpoint:
90-
address:
91-
socket_address:
92-
address: 127.0.0.1
93-
port_value: 12000
94-
EOF
95-
```
47+
.. literalinclude:: _include/dlb_example_config.yaml
48+
:language: yaml
9649

9750
Run the upstream service:
98-
```shell
51+
52+
.. code-block:: bash
9953
$ docker run -d -p 12000:80 nginx
100-
```
10154

10255
Run Envoy with dlb enabled:
103-
```shell
56+
57+
.. code-block:: bash
10458
$ ./envoy --concurrency 2 -c dlb-config.yaml
105-
```
10659

10760
Test:
108-
```shell
61+
62+
.. code-block:: bash
10963
$ curl localhost:10000
11064
```
11165

11266
You should get output from Nginx like below:
113-
```shell
67+
.. code-block:: text
11468
<!DOCTYPE html>
11569
<html>
11670
<head>
@@ -134,5 +88,3 @@ Commercial support is available at
13488
<p><em>Thank you for using nginx.</em></p>
13589
</body>
13690
</html>
137-
```
138-

0 commit comments

Comments
 (0)