Skip to content

Commit 335b72e

Browse files
authored
docs: Cleanups/improvements (envoyproxy#722)
Signed-off-by: Ryan Northey <ryan@synca.io>
1 parent 7c1b77d commit 335b72e

40 files changed

Lines changed: 379 additions & 351 deletions

File tree

brotli/example.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Brotli
88
.. include:: _include/docker-env-setup-link.rst
99

1010
:ref:`curl <start_sandboxes_setup_curl>`
11-
Used to make ``HTTP`` requests.
11+
Used to make HTTP requests.
1212

1313
By enabling compression in Envoy you can save some network bandwidth, at the expense of increased processor usage.
1414

1515
Envoy supports compression and decompression for both requests and responses.
1616

17-
This sandbox provides an example of response compression served over ``HTTPS``.
17+
This sandbox provides an example of response compression served over HTTPS.
1818

1919
The sandbox covers two scenarios:
2020

@@ -24,12 +24,12 @@ The sandbox covers two scenarios:
2424
Step 1: Start all of our containers
2525
***********************************
2626

27-
Change to the ``examples/brotli`` directory and bring up the docker composition.
27+
Change to the ``brotli`` directory and bring up the docker composition.
2828

2929
.. code-block:: console
3030
3131
$ pwd
32-
envoy/examples/brotli
32+
examples/brotli
3333
$ docker compose pull
3434
$ docker compose up --build -d
3535
$ docker compose ps

cache/example.rst

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ Cache filter
1111
:ref:`curl <start_sandboxes_setup_curl>`
1212
Used to make ``HTTP`` requests.
1313

14-
In this example, we demonstrate how HTTP caching can be utilized in Envoy by using the Cache Filter.
14+
In this example, we demonstrate how HTTP caching can be utilized in Envoy by using the Cache filter.
1515
The setup of this sandbox is based on the setup of the :ref:`Front Proxy sandbox <install_sandboxes_front_proxy>`.
1616

1717
All incoming requests are routed via the front Envoy, which acts as a reverse proxy sitting on
18-
the edge of the ``envoymesh`` network.
18+
the edge of the Docker network.
1919

20-
Port ``8000`` is exposed by :download:`docker-compose.yaml <_include/cache/docker-compose.yaml>` to handle ``HTTP`` calls
20+
Port ``8000`` is exposed by :download:`docker-compose.yaml <_include/cache/docker-compose.yaml>` to handle HTTP calls
2121
to the services. Two backend services are deployed behind the front Envoy, each with a sidecar Envoy.
2222

23-
The front Envoy is configured to run the Cache Filter, which stores cacheable responses in an in-memory cache,
23+
The front Envoy is configured to run the Cache filter, which stores cacheable responses in an in-memory cache,
2424
and serves it to subsequent requests.
2525

2626
In this demo, the responses that are served by the deployed services are stored in :download:`responses.yaml <_include/cache/responses.yaml>`.
@@ -37,12 +37,12 @@ Responses served from the backend service have no ``age`` header, and their ``da
3737
Step 1: Start all of our containers
3838
***********************************
3939

40-
Change to the ``examples/cache`` directory.
40+
Change to the ``cache`` directory.
4141

4242
.. code-block:: console
4343
4444
$ pwd
45-
envoy/examples/cache
45+
examples/cache
4646
$ docker compose pull
4747
$ docker compose up --build -d
4848
$ docker compose ps
@@ -56,13 +56,18 @@ Change to the ``examples/cache`` directory.
5656
Step 2: Test Envoy's HTTP caching capabilities
5757
**********************************************
5858

59-
You can now send a request to both services via the ``front-envoy``. Note that since the two services have different routes,
60-
identical requests to different services have different cache entries (i.e. a request sent to service 2 will not be served by a cached
61-
response produced by service 1).
59+
You can now send a request to both services via the ``front-envoy``.
60+
61+
.. note::
62+
Since the two services have different routes,
63+
identical requests to different services have different cache entries (i.e. a request sent to service 2 will not be served by a cached
64+
response produced by service 1).
6265

6366
To send a request:
6467

65-
``curl -i localhost:8000/service/<service_no>/<response>``
68+
.. code-block:: console
69+
70+
$ curl -i localhost:8000/service/<service_no>/<response>
6671
6772
``service_no``: The service to send the request to, 1 or 2.
6873

cors/example.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ The CORS enforcement choices are:
3333
Step 1: Start all of our containers
3434
***********************************
3535

36-
Change to the ``examples/cors/frontend`` directory, and start the containers:
36+
Change to the ``cors/frontend`` directory, and start the containers:
3737

3838
.. code-block:: console
3939
4040
$ pwd
41-
envoy/examples/cors/frontend
41+
examples/cors/frontend
4242
$ docker compose pull
4343
$ docker compose up --build -d
4444
$ docker compose ps
@@ -53,7 +53,7 @@ Now, switch to the ``backend`` directory in the ``cors`` example, and start the
5353
.. code-block:: console
5454
5555
$ pwd
56-
envoy/examples/cors/backend
56+
examples/cors/backend
5757
$ docker compose pull
5858
$ docker compose up --build -d
5959
$ docker compose ps
@@ -68,9 +68,9 @@ Step 2: Test Envoy's CORS capabilities
6868

6969
You can now open a browser to view your frontend service at http://localhost:8000.
7070

71-
Results of the cross-origin request will be shown on the page under *Request Results*.
71+
Results of the cross-origin request will be shown on the page under *Request results*.
7272

73-
Your browser's ``CORS`` enforcement logs can be found in the browser console.
73+
Your browser's CORS enforcement logs can be found in the browser console.
7474

7575
For example:
7676

@@ -87,10 +87,10 @@ When Envoy runs, it can listen to ``admin`` requests if a port is configured.
8787
In the example configs, the backend admin is bound to port ``8003``.
8888

8989
If you browse to http://localhost:8003/stats you will be able to view
90-
all of the Envoy stats for the backend. You should see the ``CORS`` stats for
90+
all of the Envoy stats for the backend. You should see the CORS stats for
9191
invalid and valid origins increment as you make requests from the frontend cluster.
9292

93-
.. code-block:: none
93+
.. code-block:: yaml
9494
9595
http.ingress_http.cors.origin_invalid: 2
9696
http.ingress_http.cors.origin_valid: 7

cors/frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Envoy CORS Webpage</title>
4+
<title>Envoy CORS webpage</title>
55
<link rel="shortcut icon" href="https://www.envoyproxy.io/img/favicon.ico">
66
<script type="text/javascript">
77
var client = new XMLHttpRequest();
@@ -56,7 +56,7 @@ <h5>CORS Enforcement</h5>
5656
<br/>
5757
</div>
5858
<div style="float:left;">
59-
<h3>Request Results</h3>
59+
<h3>Request results</h3>
6060
<p id="results"></p>
6161
</div>
6262
</div>

csrf/example.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ deploys a service with both a frontend and backed. This service will be started
1919
on two different virtual machines with different origins.
2020

2121
The frontend has a field to input the remote domain of where you would like to
22-
send POST requests along with radio buttons to select the remote domain's CSRF
22+
send ``POST`` requests along with radio buttons to select the remote domain's CSRF
2323
enforcement. The CSRF enforcement choices are:
2424

2525
* Disabled: CSRF is disabled on the requested route. This will result in a
2626
successful request since there is no CSRF enforcement.
2727
* Shadow Mode: CSRF is not enforced on the requested route but will record
2828
if the request contains a valid source origin.
29-
* Enabled: CSRF is enabled and will return a 403 (Forbidden) status code when
29+
* Enabled: CSRF is enabled and will return a ``403 (Forbidden)`` status code when
3030
a request is made from a different origin.
31-
* Ignored: CSRF is enabled but the request type is a GET. This should bypass
31+
* Ignored: CSRF is enabled but the request type is a ``GET``. This should bypass
3232
the CSRF filter and return successfully.
3333

3434
Step 1: Start all of our containers
3535
***********************************
3636

37-
Change to the ``examples/csrf/samesite`` directory, and start the containers:
37+
Change to the ``csrf/samesite`` directory, and start the containers:
3838

3939
.. code-block:: console
4040
4141
$ pwd
42-
envoy/examples/csrf/samesite
42+
examples/csrf/samesite
4343
$ docker compose pull
4444
$ docker compose up --build -d
4545
$ docker compose ps
@@ -54,7 +54,7 @@ Now, switch to the ``crosssite`` directory in the ``csrf`` example, and start th
5454
.. code-block:: console
5555
5656
$ pwd
57-
envoy/examples/csrf/crosssite
57+
examples/csrf/crosssite
5858
$ docker compose up --build -d
5959
$ docker compose ps
6060
@@ -75,8 +75,8 @@ with ``localhost``.
7575
To demonstrate same-site requests open the frontend service for ``samesite`` at http://localhost:8000
7676
and enter the IP address of the ``samesite`` machine as the destination.
7777

78-
Results of the cross-site request will be shown on the page under *Request Results*.
79-
Your browser's ``CSRF`` enforcement logs can be found in the browser console and in the
78+
Results of the cross-site request will be shown on the page under *Request results*.
79+
Your browser's CSRF enforcement logs can be found in the browser console and in the
8080
network tab.
8181

8282
For example:
@@ -86,7 +86,7 @@ For example:
8686
Failed to load resource: the server responded with a status of 403 (Forbidden)
8787
8888
If you change the destination to be the same as one displaying the website and
89-
set the ``CSRF`` enforcement to enabled the request will go through successfully.
89+
set the CSRF enforcement to enabled the request will go through successfully.
9090

9191
Step 3: Check stats of backend via admin
9292
****************************************
@@ -98,7 +98,7 @@ If you browse to http://localhost:8001/stats you will be able to view
9898
all of the Envoy stats for the backend. You should see the CORS stats for
9999
invalid and valid origins increment as you make requests from the frontend cluster.
100100

101-
.. code-block:: none
101+
.. code-block:: yaml
102102
103103
http.ingress_http.csrf.missing_source_origin: 0
104104
http.ingress_http.csrf.request_invalid: 1

csrf/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h5>CSRF Enforcement</h5>
6060
<br/>
6161
</div>
6262
<div style="float:left;">
63-
<h3>Request Results</h3>
63+
<h3>Request results</h3>
6464
<p id="results"></p>
6565
</div>
6666
</div>

datadog-tracing/example.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ Datadog tracing
77

88
.. include:: _include/docker-env-setup-link.rst
99

10-
.. note:: Before proceeding, please ensure you have a Datadog account set up. If you don't already have one, you can `sign up for Datadog here <https://app.datadoghq.eu/signup>`_.
11-
1210
:ref:`curl <start_sandboxes_setup_curl>`
1311
Used to make HTTP requests.
1412

13+
14+
.. note::
15+
16+
Before proceeding, please ensure you have a Datadog account set up.
17+
18+
If you don't already have one, you can `sign up for Datadog here <https://app.datadoghq.eu/signup>`_.
19+
20+
1521
The Datadog tracing sandbox demonstrates Envoy's :ref:`request tracing <arch_overview_tracing>`
1622
capabilities using `Datadog <https://datadoghq.com/>`_ as the tracing provider.
1723

@@ -29,14 +35,12 @@ Each span records the latency of upstream API calls as well as information neede
2935
Step 1: Build the sandbox
3036
*************************
3137

32-
Change directory to ``examples/datadog-tracing`` in the Envoy repository.
33-
34-
To build this sandbox example, and start the example services run the following commands:
38+
Change to the ``datadog-tracing`` directory, and start the containers, with the following commands:
3539

3640
.. code-block:: console
3741
3842
$ pwd
39-
envoy/examples/datadog-tracing
43+
examples/datadog-tracing
4044
$ export DD_API_KEY=<YOUR_API_KEY>
4145
$ docker compose pull
4246
$ docker compose up --build -d

double-proxy/example.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _install_sandboxes_double_proxy:
22

3-
Double proxy (with ``mTLS`` encryption)
4-
=======================================
3+
Double proxy (with mTLS encryption)
4+
===================================
55

66
.. sidebar:: Requirements
77

@@ -13,7 +13,7 @@ Double proxy (with ``mTLS`` encryption)
1313
:ref:`openssl <start_sandboxes_setup_openssl>`
1414
Generate ``SSL`` keys and certificates.
1515

16-
This sandbox demonstrates a basic "double proxy" configuration, in which a simple ``aiohttp`` app
16+
This sandbox demonstrates a basic "double proxy" configuration, in which a simple aiohttp app
1717
connects to a PostgreSQL database, with two Envoy proxies in between.
1818

1919
``Envoy (front)`` -> ``aiohttp`` -> ``Envoy (postgres-front)`` -> ``Envoy (postgres-back)`` -> ``PostgreSQL``
@@ -27,16 +27,16 @@ Another common use case is with Envoy configured to provide "Points of presence"
2727
and to relay requests to upstream servers and services.
2828

2929
This example encrypts the transmission of data between the two middle proxies and provides mutual authentication
30-
using ``mTLS``.
30+
using mTLS.
3131

3232
This can be useful if the proxies are physically separated or transmit data over untrusted networks.
3333

34-
In order to use the sandbox you will first need to generate the necessary ``SSL`` keys and certificates.
34+
In order to use the sandbox you will first need to generate the necessary SSL keys and certificates.
3535

3636
This example walks through creating a certificate authority, and using it to create a domain key and sign
3737
certificates for the proxies.
3838

39-
Change to the ``examples/double-proxy`` directory.
39+
Change to the ``double-proxy`` directory.
4040

4141
Step 1: Create a certificate authority
4242
**************************************
@@ -46,7 +46,7 @@ First create a key for the certificate authority:
4646
.. code-block:: console
4747
4848
$ pwd
49-
envoy/examples/double-proxy
49+
examples/double-proxy
5050
$ mkdir -p certs
5151
$ openssl genrsa -out certs/ca.key 4096
5252
Generating RSA private key, 4096 bit long modulus (2 primes)
@@ -158,7 +158,7 @@ This will load the required keys and certificates into the frontend and backend
158158
.. code-block:: console
159159
160160
$ pwd
161-
envoy/examples/double-proxy
161+
examples/double-proxy
162162
$ docker compose pull
163163
$ docker compose up --build -d
164164
$ docker compose ps
@@ -171,10 +171,10 @@ This will load the required keys and certificates into the frontend and backend
171171
double-proxy_proxy-postgres-backend_1 /docker-entrypoint.sh /usr ... Up 10000/tcp
172172
double-proxy_proxy-postgres-frontend_1 /docker-entrypoint.sh /usr ... Up 10000/tcp
173173
174-
Step 6: Check the ``aiohttp`` app can connect to the database
175-
*************************************************************
174+
Step 6: Check the aiohttp app can connect to the database
175+
*********************************************************
176176

177-
Checking the response at http://localhost:10000, you should see the output from the ``aiohttp`` app:
177+
Checking the response at http://localhost:10000, you should see the output from the aiohttp app:
178178

179179
.. code-block:: console
180180
@@ -187,4 +187,4 @@ Checking the response at http://localhost:10000, you should see the output from
187187
Outline of key concepts for securing Envoy.
188188

189189
:ref:`TLS sandbox <install_sandboxes_tls>`
190-
Examples of various ``TLS`` termination patterns with Envoy.
190+
Examples of various TLS termination patterns with Envoy.

0 commit comments

Comments
 (0)