Skip to content

Commit 51dc07d

Browse files
authored
docs: Update start/install section (envoyproxy#13490)
Signed-off-by: Ryan Northey <[email protected]>
1 parent 2758575 commit 51dc07d

39 files changed

+678
-364
lines changed

Diff for: docs/redirects.txt

+8
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ install/tools/route_table_check_tool.rst start/install/tools/route_table_ch
99
install/tools/schema_validator_check_tool.rst start/install/tools/schema_validator_check_tool.rst
1010
install/tools/tools.rst start/install/tools/tools.rst
1111
install/install.rst start/start.rst
12+
13+
start/install/ref_configs.rst intro/deployment_types/deployment_types.rst
14+
start/install/sandboxes/local_docker_build.rst start/building/local_docker_build.rst
15+
16+
start/install/tools/tools.rst operations/tools/tools.rst
17+
start/install/tools/route_table_check_tool.rst operations/tools/route_table_check_tool.rst
18+
start/install/tools/schema_validator_check_tool.rst operations/tools/schema_validator_check_tool.rst
19+
start/install/tools/config_load_check_tool.rst operations/tools/config_load_check_tool.rst

Diff for: docs/root/intro/arch_overview/operations/dynamic_configuration.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ collectively known as :ref:`"xDS" <xds_protocol>` (* discovery service). This do
1212
overview of the options currently available.
1313

1414
* Top level configuration :ref:`reference <config>`.
15-
* :ref:`Reference configurations <install_ref_configs>`.
15+
* :ref:`Reference configurations <intro_deployment_types>`.
1616
* Envoy :ref:`v3 API overview <config_overview>`.
1717
* :ref:`xDS API endpoints <config_overview_management_server>`.
1818

Diff for: docs/root/intro/deployment_types/deployment_types.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _intro_deployment_types:
2+
13
Deployment types
24
================
35

Diff for: docs/root/intro/deployment_types/double_proxy.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Configuration template
2222
^^^^^^^^^^^^^^^^^^^^^^
2323

2424
The source distribution includes an example double proxy configuration. See
25-
:ref:`here <install_ref_configs>` for more information.
25+
:ref:`here <intro_deployment_types>` for more information.

Diff for: docs/root/intro/deployment_types/front_proxy.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Configuration template
2222
^^^^^^^^^^^^^^^^^^^^^^
2323

2424
The source distribution includes an example front proxy configuration. See
25-
:ref:`here <install_ref_configs>` for more information.
25+
:ref:`here <intro_deployment_types>` for more information.

Diff for: docs/root/intro/deployment_types/service_to_service.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ load balancing, statistics gathering, etc.
6464
Configuration template
6565
^^^^^^^^^^^^^^^^^^^^^^
6666

67-
The source distribution includes :ref:`an example service-to-service configuration<install_ref_configs>`.
67+
The source distribution includes :ref:`an example service-to-service configuration<intro_deployment_types>`.

Diff for: docs/root/operations/operations.rst

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ Operations and administration
1515
traffic_tapping
1616
certificates
1717
performance
18+
tools/tools

Diff for: docs/root/start/install/ref_configs.rst renamed to docs/root/operations/tools/config_generator.rst

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
.. _install_ref_configs:
2-
3-
Reference configurations
4-
========================
5-
6-
The source distribution includes a set of example configuration templates for each of the three
7-
major Envoy deployment types:
8-
9-
* :ref:`Service to service <deployment_type_service_to_service>`
10-
* :ref:`Front proxy <deployment_type_front_proxy>`
11-
* :ref:`Double proxy <deployment_type_double_proxy>`
12-
13-
The goal of this set of example configurations is to demonstrate the full capabilities of Envoy in
14-
a complex deployment. All features will not be applicable to all use cases. For full documentation
15-
see the :ref:`configuration reference <config>`.
1+
.. _start_tools_configuration_generator:
162

173
Configuration generator
184
-----------------------
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
.. _start_tools:
2+
13
Tools
24
=====
35

46
.. toctree::
57
:maxdepth: 2
68

9+
config_generator
710
config_load_check_tool
811
route_table_check_tool
912
schema_validator_check_tool

Diff for: docs/root/start/_include/dockerhub-images.csv

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
,,stable,stable,master,master
2+
Docker image,description,amd64,arm64,amd64,arm64
3+
`envoyproxy/envoy <https://hub.docker.com/r/envoyproxy/envoy/tags/>`_,Release binary with symbols stripped on top of an Ubuntu Bionic base.,v1.16-latest,v1.16-latest,,
4+
`envoyproxy/envoy-alpine <https://hub.docker.com/r/envoyproxy/envoy-alpine/tags/>`_,Release binary with symbols stripped on top of a **glibc** alpine base.,v1.16-latest,,,
5+
`envoyproxy/envoy-debug <https://hub.docker.com/r/envoyproxy/envoy-debug/tags/>`_,Release binary with debug symbols on top of an Ubuntu Bionic base.,v1.16-latest,v1.16-latest,,
6+
`envoyproxy/envoy-dev <https://hub.docker.com/r/envoyproxy/envoy-dev/tags/>`_,Release binary with symbols stripped on top of an Ubuntu Bionic base.,,,latest,latest
7+
`envoyproxy/envoy-alpine-dev <https://hub.docker.com/r/envoyproxy/envoy-alpine-dev/tags/>`_,Release binary with symbols stripped on top of a **glibc** alpine base.,,,latest,
8+
`envoyproxy/envoy-debug-dev <https://hub.docker.com/r/envoyproxy/envoy-debug-dev/tags/>`_,Release binary with debug symbols on top of an Ubuntu Bionic base.,,,latest,latest
9+
`envoyproxy/envoy-build-ubuntu <https://hub.docker.com/r/envoyproxy/envoy-debug-dev/tags/>`_,Build image which includes tools for building multi-arch Envoy and containers.,,,see dockerhub,see dockerhub

Diff for: docs/root/start/_include/envoy-demo.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
static_resources:
2+
3+
listeners:
4+
- name: listener_0
5+
address:
6+
socket_address: { address: 0.0.0.0, port_value: 10000 }
7+
filter_chains:
8+
- filters:
9+
- name: envoy.filters.network.http_connection_manager
10+
typed_config:
11+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
12+
stat_prefix: ingress_http
13+
codec_type: AUTO
14+
route_config:
15+
name: local_route
16+
virtual_hosts:
17+
- name: local_service
18+
domains: ["*"]
19+
routes:
20+
- match: { prefix: "/" }
21+
route: { host_rewrite_literal: www.google.com, cluster: service_google }
22+
http_filters:
23+
- name: envoy.filters.http.router
24+
25+
clusters:
26+
- name: service_google
27+
connect_timeout: 0.25s
28+
type: LOGICAL_DNS
29+
# Comment out the following line to test on v6 networks
30+
dns_lookup_family: V4_ONLY
31+
lb_policy: ROUND_ROBIN
32+
load_assignment:
33+
cluster_name: service_google
34+
endpoints:
35+
- lb_endpoints:
36+
- endpoint:
37+
address:
38+
socket_address:
39+
address: www.google.com
40+
port_value: 443
41+
transport_socket:
42+
name: envoy.transport_sockets.tls
43+
typed_config:
44+
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
45+
sni: www.google.com
46+
47+
admin:
48+
access_log_path: /tmp/admin_access.log
49+
address:
50+
socket_address: { address: 0.0.0.0, port_value: 9901 }

Diff for: docs/root/start/building.rst

+6-61
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
Building
55
========
66

7-
The Envoy build system uses Bazel. In order to ease initial building and for a quick start, we
8-
provide an Ubuntu 16 based docker container that has everything needed inside of it to build
9-
and *statically link* Envoy, see :repo:`ci/README.md`.
7+
The Envoy build system uses `Bazel <https://bazel.build/>`_.
108

11-
In order to build manually, follow the instructions at :repo:`bazel/README.md`.
9+
In order to ease initial building and for a quick start, we provide an Ubuntu 16 based docker container that
10+
has everything needed inside of it to build and *statically link* Envoy, see :repo:`ci/README.md`.
11+
12+
In order to build without using the Docker container, follow the instructions at :repo:`bazel/README.md`.
1213

1314
.. _install_requirements:
1415

@@ -28,62 +29,6 @@ for more information on performing manual builds.
2829
Please note that for Clang/LLVM 8 and lower, Envoy may need to be built with `--define tcmalloc=gperftools`
2930
as the new tcmalloc code is not guaranteed to compile with lower versions of Clang.
3031

31-
.. _install_binaries:
32-
33-
Pre-built binaries
34-
------------------
35-
36-
We build and tag Docker images with release versions when we do official releases. These images can
37-
be found in the following repositories:
38-
39-
* `envoyproxy/envoy <https://hub.docker.com/r/envoyproxy/envoy/tags/>`_: Release binary with
40-
symbols stripped on top of an Ubuntu Bionic base.
41-
* `envoyproxy/envoy-debug <https://hub.docker.com/r/envoyproxy/envoy-debug/tags/>`_: Release
42-
binary with debug symbols on top of an Ubuntu Bionic base.
43-
* `envoyproxy/envoy-alpine <https://hub.docker.com/r/envoyproxy/envoy-alpine/tags/>`_: Release
44-
binary with symbols stripped on top of a **glibc** alpine base.
45-
46-
.. note::
47-
48-
In the above repositories, we tag a *vX.Y-latest* image for each security/stable release line.
49-
50-
On every master commit we additionally create a set of development Docker images. These images can
51-
be found in the following repositories:
52-
53-
* `envoyproxy/envoy-dev <https://hub.docker.com/r/envoyproxy/envoy-dev/tags/>`_: Release binary with
54-
symbols stripped on top of an Ubuntu Bionic base.
55-
* `envoyproxy/envoy-debug-dev <https://hub.docker.com/r/envoyproxy/envoy-debug-dev/tags/>`_: Release
56-
binary with debug symbols on top of an Ubuntu Bionic base.
57-
* `envoyproxy/envoy-alpine-dev <https://hub.docker.com/r/envoyproxy/envoy-alpine-dev/tags/>`_: Release
58-
binary with symbols stripped on top of a **glibc** alpine base.
59-
60-
In the above *dev* repositories, the *latest* tag points to the last Envoy SHA in master that passed
61-
tests.
62-
63-
.. note::
64-
65-
The Envoy project considers master to be release candidate quality at all times, and many
66-
organizations track and deploy master in production. We encourage you to do the same so that
67-
issues can be reported as early as possible in the development process.
68-
69-
Packaged Envoy pre-built binaries for a variety of platforms are available via
70-
`GetEnvoy.io <https://www.getenvoy.io/>`_.
71-
72-
We will consider producing additional binary types depending on community interest in helping with
73-
CI, packaging, etc. Please open an `issue in GetEnvoy <https://github.com/tetratelabs/getenvoy/issues>`_
74-
for pre-built binaries for different platforms.
75-
76-
.. _arm_binaries:
77-
78-
ARM64 binaries
79-
^^^^^^^^^^^^^^
80-
81-
`envoyproxy/envoy <https://hub.docker.com/r/envoyproxy/envoy/tags/>`_,
82-
`envoyproxy/envoy-debug <https://hub.docker.com/r/envoyproxy/envoy-debug/tags/>`_,
83-
`envoyproxy/envoy-dev <https://hub.docker.com/r/envoyproxy/envoy-dev/tags/>`_ and
84-
`envoyproxy/envoy-debug-dev <https://hub.docker.com/r/envoyproxy/envoy-debug-dev/tags/>`_ are Docker
85-
`multi-arch <https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/>`_ images
86-
and should run transparently on compatible ARM64 hosts.
8732

8833
Modifying Envoy
8934
---------------
@@ -95,4 +40,4 @@ Envoy binary, and putting the binary in an Ubuntu container.
9540
.. toctree::
9641
:maxdepth: 2
9742

98-
install/sandboxes/local_docker_build
43+
building/local_docker_build

Diff for: docs/root/start/install/sandboxes/local_docker_build.rst renamed to docs/root/start/building/local_docker_build.rst

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
.. _install_sandboxes_local_docker_build:
23

34
Building an Envoy Docker image
@@ -19,6 +20,14 @@ That command will take some time to run because it is compiling an Envoy binary
1920

2021
For more information on building and different build targets, please refer to :repo:`ci/README.md`.
2122

23+
.. warning::
24+
25+
These instructions for building Envoy use
26+
`envoyproxy/envoy-build-ubuntu <https://hub.docker.com/r/envoyproxy/envoy-build-ubuntu/tags>`_ image.
27+
You will need 4-5GB of disk space to accommodate this image.
28+
29+
This script runs as effective root on your host system.
30+
2231
**Step 2: Build image with only Envoy binary**
2332

2433
In this step we'll build an image that only has the Envoy binary, and none

Diff for: docs/root/start/docker.rst

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
.. _start_docker:
2+
3+
Using the Envoy Docker Image
4+
============================
5+
6+
The following examples use the :ref:`official Envoy Docker image <start_install_docker>`.
7+
8+
These instructions are known to work for the ``x86_64`` and ``arm64`` architectures.
9+
10+
Running Envoy with docker-compose
11+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12+
13+
If you would like to use Envoy with docker-compose you can overwrite the provided configuration file
14+
by using a volume.
15+
16+
.. substitution-code-block:: yaml
17+
18+
version: '3'
19+
services:
20+
envoy:
21+
image: envoyproxy/|envoy_docker_image|
22+
ports:
23+
- "10000:10000"
24+
volumes:
25+
- ./envoy.yaml:/etc/envoy/envoy.yaml
26+
27+
If you use this method, you will have to ensure that the ``envoy`` user can read the mounted file
28+
either by ensuring the correct permissions on the file, or making it world-readable, as described
29+
below.
30+
31+
32+
Build and run a Docker image
33+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34+
35+
Create a simple Dockerfile to execute Envoy.
36+
37+
If you create a custom ``envoy.yaml`` you can create your own Docker image with it using the following
38+
Dockerfile recipe:
39+
40+
.. substitution-code-block:: dockerfile
41+
42+
FROM envoyproxy/|envoy_docker_image|
43+
COPY envoy.yaml /etc/envoy/envoy.yaml
44+
RUN chmod go+r /etc/envoy/envoy.yaml
45+
46+
Build the Docker image using:
47+
48+
.. code-block:: console
49+
50+
$ docker build -t envoy:v1 .
51+
52+
Assuming Envoy is configured to listen on ports ``9901`` and ``10000``, you can now start it
53+
with:
54+
55+
.. code-block:: console
56+
57+
$ docker run -d --name envoy -p 9901:9901 -p 10000:10000 envoy:v1
58+
59+
Permissions for running Docker Envoy containers as a non-root user
60+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61+
62+
The Envoy Docker image should be started as ``root``, but switches when run to the ``envoy`` user
63+
created at build time.
64+
65+
The user is switched in the Docker ``ENTRYPOINT``.
66+
67+
Changing the ``uid`` and/or ``gid`` of the ``envoy`` user
68+
*********************************************************
69+
70+
The default ``uid`` and ``gid`` for the ``envoy`` user are ``101``.
71+
72+
The ``uid`` and ``gid`` of this user can be set at runtime using the ``ENVOY_UID`` and ``ENVOY_GID``
73+
environment variables.
74+
75+
This can be done, for example, on the Docker command line:
76+
77+
.. substitution-code-block:: console
78+
79+
$ docker run -d --name envoy -e ENVOY_UID=777 -e ENVOY_GID=777 envoyproxy/|envoy_docker_image|
80+
81+
This can be useful if you wish to restrict or provide access to ``unix`` sockets inside the container, or
82+
for controlling access to an Envoy socket from outside of the container.
83+
84+
To run the process inside the container as the ``root`` user you can set ``ENVOY_UID`` to ``0``,
85+
but doing so has the potential to weaken the security of your running container.
86+
87+
Logging permissions inside the Envoy container
88+
**********************************************
89+
90+
The ``envoy`` image sends application logs to ``/dev/stdout`` and ``/dev/stderr`` by default, and these
91+
can be viewed in the container log.
92+
93+
If you send application, admin or access logs to a file output, the ``envoy`` user will require the
94+
necessary permissions to write to this file. This can be achieved by setting the ``ENVOY_UID`` and/or
95+
by making the file writeable by the envoy user.
96+
97+
For example, to mount a log folder from the host and make it writable, you can:
98+
99+
.. substitution-code-block:: console
100+
101+
$ mkdir logs
102+
$ chown 777 logs
103+
$ docker run -d --name envoy -v $(pwd)/logs:/var/log -e ENVOY_UID=777 envoyproxy/|envoy_docker_image|
104+
105+
You can then configure ``envoy`` to log to files in ``/var/log``
106+
107+
Configuration and binary file permissions inside the Envoy container
108+
********************************************************************
109+
110+
The ``envoy`` user also needs to have permission to access any required configuration files mounted
111+
into the container.
112+
113+
Any binary files specified in the configuration should also be executable by the ``envoy`` user.
114+
115+
If you are running in an environment with a strict ``umask`` setting, you may need to provide ``envoy``
116+
with access by setting the ownership and/or permissions of the file.
117+
118+
One method of doing this without changing any file permissions is to start the container with the
119+
host user's ``uid``, for example:
120+
121+
.. substitution-code-block:: console
122+
123+
$ docker run -d --name envoy -v $(pwd)/envoy.yaml:/etc/envoy/envoy.yaml -e ENVOY_UID=$(id -u) envoyproxy/|envoy_docker_image|
124+
125+
Listen only on ports > 1024 inside the Docker Envoy container
126+
*************************************************************
127+
128+
Unix-based systems restrict opening ``well-known`` ports (ie. with a port number < ``1024``) to the ``root`` user.
129+
130+
If you need to listen on a ``well-known`` port you can use Docker to do so.
131+
132+
For example, to create an Envoy server listening on port ``8000``, with forwarding from port ``80``:
133+
134+
.. substitution-code-block:: console
135+
136+
$ docker run -d --name envoy -p 80:8000 envoyproxy/|envoy_docker_image|

0 commit comments

Comments
 (0)