Envoy is an L7 proxy and communication bus designed for large modern service-oriented architecture. The project was born out of the belief that the network should be transparent to applications. When network and applications problems occur, it should be easy to determine the source of the problem.
Envoy is an open-source edge and service proxy, designed for cloud-native applications. Let’s dive in and learn how to install Envoy on Debian 11.
High Level Envoy features
- Its known for its advanced load balancing technique. It implements load balancing in a single place and have them accessible to any application.
- It has front/edge proxy support.
- It has best in class observability
- It has gRPC support.
- Has support for HTTP L7 routing
- It supports HTTP/2
- L3/L4 filter architecture. Envoy acts as a L3/L4 proxy
- It support use of API for configuration management
Installing Envoy proxy server on Ubuntu 20.04
1. Update system repositories.
The first thing is to update system repositories in order to make them up to date. This will avoid running into errors in the process of installation.
$ sudo apt update && apt upgrade -y
When both updates and upgrades are complete, we can now install envoy dependencies.
2. Install Envoy proxy dependencies
Envoy requires some set of programs to run effectively such as curl for running downloads, lsb-release, etc. Let’s install the following;
$ sudo apt install debian-keyring debian-archive-keyring apt-transport-https curl lsb-release
You will see the following output.
# output apt-transport-https is already the newest version (2.2.4). curl is already the newest version (7.74.0-1.3+deb11u1). debian-archive-keyring is already the newest version (2021.1.1). lsb-release is already the newest version (11.1.0). lsb-release set to manually installed. The following NEW packages will be installed: debian-keyring 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 31.1 MB of archives. After this operation, 32.6 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://deb.debian.org/debian bullseye/main amd64 debian-keyring all 2021.07.26 [31.1 MB] Fetched 31.1 MB in 0s (130 MB/s) Selecting previously unselected package debian-keyring. (Reading database ... 29865 files and directories currently installed.) Preparing to unpack .../debian-keyring_2021.07.26_all.deb ... Unpacking debian-keyring (2021.07.26) ... Setting up debian-keyring (2021.07.26) ...
3. Add GPG key to envoy repository
In order to sign the envoy program, we need to download the GPG key to self-sign it. Keys helps to prove the authenticity of the program’s downloads.
$ curl -sL 'https://deb.dl.getenvoy.io/public/gpg.8115BA8E629CC074.key' | sudo gpg --dearmor -o /usr/share/keyrings/getenvoy-keyring.gpg
If you want, you can verify the key with the echo command, if you get an ok as the output then its signed therefore move ahead and install the program.
$ echo a077cb587a1b622e03aa4bf2f3689de14658a9497a9af2c427bba5f4cc3c4723 /usr/share/keyrings/getenvoy-keyring.gpg | sha256sum --check # output /usr/share/keyrings/getenvoy-keyring.gpg: OK
Now we need to add the key to sources.list.d repository. To do so use the following command.
$ echo "deb [arch=amd64 \ signed-by=/usr/share/keyrings/getenvoy-keyring.gpg] \ https://deb.dl.getenvoy.io/public/deb/debian \ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/getenvoy.list
We need to update our repositories again by doing an update again.
$ sudo apt update
Whenever you update, you must see what you have added. Have look at the output below
# sample output Hit:5 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease Get:6 https://deb.dl.getenvoy.io/public/deb/debian bullseye InRelease [5085 B] Get:7 https://deb.dl.getenvoy.io/public/deb/debian bullseye/main amd64 Packages [4323 B]
4. Install Envoy Proxy on Debian 11
Now that we have completed all the prerequisites, we can now install Envoy proxy with the following command.
$ sudo apt install getenvoy-envoy
See the output below
The following NEW packages will be installed: getenvoy-envoy 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 16.5 MB of archives. After this operation, 0 B of additional disk space will be used. Get:1 https://deb.dl.getenvoy.io/public/deb/debian bullseye/main amd64 getenvoy-envoy amd64 1.18.2.p0.gd362e79-1p75.g76c310e [16.5 MB] Fetched 16.5 MB in 1s (14.6 MB/s) Selecting previously unselected package getenvoy-envoy. (Reading database ... 29875 files and directories currently installed.) Preparing to unpack .../getenvoy-envoy_1.18.2.p0.gd362e79-1p75.g76c310e_amd64.deb ... Unpacking getenvoy-envoy (1.18.2.p0.gd362e79-1p75.g76c310e) ... Setting up getenvoy-envoy (1.18.2.p0.gd362e79-1p75.g76c310e) ...
We can check the Envoy version installed with the following command;
$ envoy --version
5. Run Envoy
To check Envoy commands use the help command
$ envoy --help envoy version: d362e791eb9e4efa8d87f6d878740e72dc8330ac/1.18.2/clean-getenvoy-76c310e-envoy/RELEASE/BoringSSL
Let’s run Envoy with a demo configuration file
Create a demo.yaml file and run with the following command
$ envoy -c envoy-demo.yaml
-c tells envoy the path to its initial configuration
To know if Envoy is proxying, use the following
$ curl -v localhost:10000
We have learned how to install Envoy proxy on Debian 11. To learn more of these check out the Envoy documentation.