File tree Expand file tree Collapse file tree 1 file changed +9
-57
lines changed
docs/root/configuration/other_features Expand file tree Collapse file tree 1 file changed +9
-57
lines changed Original file line number Diff line number Diff line change @@ -44,73 +44,27 @@ Using Dlb
44
44
45
45
Create a config file to make Envoy listen 10000 port as proxy, the upstream server listens 12000 port.
46
46
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
96
49
97
50
Run the upstream service:
98
- ```shell
51
+
52
+ .. code-block :: bash
99
53
$ docker run -d -p 12000:80 nginx
100
- ` ``
101
54
102
55
Run Envoy with dlb enabled:
103
- ```shell
56
+
57
+ .. code-block :: bash
104
58
$ ./envoy --concurrency 2 -c dlb-config.yaml
105
- ` ``
106
59
107
60
Test:
108
- ```shell
61
+
62
+ .. code-block :: bash
109
63
$ curl localhost:10000
110
64
```
111
65
112
66
You should get output from Nginx like below:
113
- `` `shell
67
+ .. code-block :: text
114
68
<!DOCTYPE html>
115
69
<html>
116
70
<head>
@@ -134,5 +88,3 @@ Commercial support is available at
134
88
<p><em>Thank you for using nginx.</em></p>
135
89
</body>
136
90
</html>
137
- ` ``
138
-
You can’t perform that action at this time.
0 commit comments