λ°λ‘ μ₯ μ°Ύμ보λ, envoyλ Micro Service Architecture λ± κ΅¬νλ λ¨μ κΈ°λ₯κ°μ ν΅μ μ μν L7 Proxy λΌκ³ ν©λλ€.
Docker Compose μ λλ μΌλ° μλΉμ€μμλ κ΅³μ΄ νμνμ§λ μμ κ² κ°μ§λ§, Service Mesh νκ²½μμλ μμλλ©΄ μ’μ κ² κ°μ νμ΄λ΄ λλ€.
CloudNet@μμ μ§ννκ³ μλ K8s Advanced Network Study(μ΄ν, KANS)λ₯Ό ν΅ν΄ νμ΅ν λ΄μ©μ μ 리ν©λλ€.
1. Envoy Installation
- Docs: Installing Envoy
wget -O- https://apt.envoyproxy.io/signing.key | sudo gpg --dearmor -o /etc/apt/keyrings/envoy-keyring.gpg
echo "deb [signed-by=/etc/apt/keyrings/envoy-keyring.gpg] https://apt.envoyproxy.io jammy main" | sudo tee /etc/apt/sources.list.d/envoy.list
sudo apt-get update
sudo apt-get install envoy
envoy --version
νμ΅νκ²½μ rootλ‘ μ μλμ΄ μκΈ°μ sudoλ μ°μ§ μμμ΅λλ€.
wget -O- https://apt.envoyproxy.io/signing.key | sudo gpg --dearmor -o /etc/apt/keyrings/envoy-keyring.gpg
--2024-10-15 09:46:22-- https://apt.envoyproxy.io/signing.key
Resolving apt.envoyproxy.io (apt.envoyproxy.io)... 13.215.144.61, 13.251.96.10, 2406:da18:880:3802::c8, ...
Connecting to apt.envoyproxy.io (apt.envoyproxy.io)|13.215.144.61|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3158 (3.1K) [application/vnd.apple.keynote]
Saving to: βSTDOUTβ
- 100%[===================>] 3.08K --.-KB/s in 0s
2024-10-15 09:46:23 (86.8 MB/s) - written to stdout [3158/3158]
echo "deb [signed-by=/etc/apt/keyrings/envoy-keyring.gpg] https://apt.envoyproxy.io jammy main" | sudo tee /etc/apt/sources.list.d/envoy.list
deb [signed-by=/etc/apt/keyrings/envoy-keyring.gpg] https://apt.envoyproxy.io jammy main
apt-get update && apt-get install envoy -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
envoy
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 73.2 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://apt.envoyproxy.io jammy/main amd64 envoy amd64 1.31.2 [73.2 MB]
Fetched 73.2 MB in 6s (12.2 MB/s)
Selecting previously unselected package envoy.
(Reading database ... 66661 files and directories currently installed.)
Preparing to unpack .../envoy_1.31.2_amd64.deb ...
Unpacking envoy (1.31.2) ...
Setting up envoy (1.31.2) ...
You have installed the Envoy proxy server.
You can check your Envoy version by running the following in a terminal:
$ envoy --version
Documentation for your version is available at:
https://www.envoyproxy.io/docs
The Envoy project can be found at:
https://github.com/envoyproxy/envoy
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
envoy --version
envoy version: cc4a75482810de4b84c301d13deb551bd3147339/1.31.2/Clean/RELEASE/BoringSSL
- μ΅μ νμΈ
envoy μ΅μ
μ envoy -h λ‘ νμΈκ°λ₯ν©λλ€.
man pageλ λ°λ‘ μ€μΉλμ§ μλ κ² κ°μ΅λλ€.
man envoy
# No manual entry for envoy
2. Envoy Quick start
- μ λͺ¨λ₯΄κ² μΌλ κ·Έλ₯ λ°λΌν©λλ€.
- Envoy Docs
(a) Config λ°λͺ¨ μ μ©
ν μͺ½μλ Envoyλ₯Ό μΌκ³ , ν μͺ½μμλ μ μ ν
μ€νΈλ₯Ό ν΄λ³Ό κ²λλ€.
μ€ν°λμμ κ°μ μλΈλ· ꡬμ±μ΄ λ νκ²½μ μ 곡ν΄μ£Όμ
¨κΈ°μ, μ΄ μ μ μν΄λ°λλλ€.
- Terminal 0) Turn On Envoy
- foreground μνλΌ, μΌλμ μνμμ λ€λ₯Έ ν°λ―Έλμ μ½λλ€.
curl -O https://www.envoyproxy.io/docs/envoy/latest/_downloads/92dcb9714fb6bc288d042029b34c0de4/envoy-demo.yaml
envoy -c envoy-demo.yaml
- Terminal 1) ν μ€νΈ
ss -tnlp
# State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
# LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=347,fd=14))
# LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=703,fd=3))
# LISTEN 0 4096 0.0.0.0:10000 0.0.0.0:* users:(("envoy",pid=10390,fd=25))
# LISTEN 0 4096 0.0.0.0:10000 0.0.0.0:* users:(("envoy",pid=10390,fd=24))
# LISTEN 0 511 *:80 *:* users:(("apache2",pid=2376,fd=4),("apache2",pid=2375,fd=4),("apache2",pid=2373,fd=4))
# LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=703,fd=4))
curl -s http://127.0.0.1:10000 | grep -o "<title>.*</title>"
# <title>Envoy proxy - home</title>
echo -e "http://$(curl -s ipinfo.io/ip):10000"
# http://54.180.163.59:10000

- Terminal2) Test in k3s master node
192.168.10.200: Where envoy is running
curl -s http://192.168.10.200:10000 | grep -o "<title>.*</title>"
# <title>Envoy proxy - home</title>
(b) Config μ€μ λ³κ²½
μμ ꡬλν envoyλ₯Ό μ’
λ£νκ³ , λ€μ μ€νν©λλ€.
-c λ --config-path μ΅μ
μ λμΌν©λλ€.
λ€λ§, μ΅μ
overrideλ₯Ό ν λ, μΆκ°λ‘ merging λλ νκ²½λ³μλ
--config-path μ΅μ
μ μ¬μ©νλλ‘ κΆνλ κ² κ°μ΅λλ€.
cat <<EOT> envoy-override.yaml
admin:
address:
socket_address:
address: 0.0.0.0
port_value: 9902
EOT
envoy -c envoy-demo.yaml --config-path "$(cat envoy-override.yaml)"
μ΄ κ²½μ°, 10000 Port μΈμ μΆκ°λ‘ 9902 ν¬νΈλ₯Ό ν΅ν΄ Admin νμ΄μ§μ μ κ·Ό ν μ μμμ΅λλ€.

(c) Config μ ν¨μ± κ²μ¬
--mode validate μ΅μ
μ ν΅ν΄, μ€μ νμΌμ μ ν¨μ±μ κ²μ¬ν μ μμ΅λλ€.
envoy --mode validate -c envoy-demo.yaml
# [2024-10-19 15:45:46.382][10661][info][main] [source/server/server.cc:879] runtime: {}
# [2024-10-19 15:45:46.383][10661][info][config] [source/server/configuration_impl.cc:168] loading tracing configuration
# [2024-10-19 15:45:46.383][10661][info][config] [source/server/configuration_impl.cc:124] loading 0 static secret(s)
# [2024-10-19 15:45:46.383][10661][info][config] [source/server/configuration_impl.cc:130] loading 1 cluster(s)
# [2024-10-19 15:45:46.384][10661][info][config] [source/server/configuration_impl.cc:138] loading 1 listener(s)
# [2024-10-19 15:45:46.386][10661][warning][misc] [source/extensions/filters/network/http_connection_manager/config.cc:88] internal_address_config is not configured. The existing default behaviour will trust RFC1918 IP addresses, but this will be changed in next release. Please explictily config internal address config as the migration step or config the envoy.reloadable_features.explicit_internal_address_config to true to untrust all ips by default
# [2024-10-19 15:45:46.389][10661][info][config] [source/server/configuration_impl.cc:154] loading stats configuration
# configuration 'envoy-demo.yaml' OK
(d) Envoy logging μ€μ
κΈ°λ³Έμ μΌλ‘ /dev/stderrμ λ‘κΉ
μ νλ€κ³ ν©λλ€.
character special file(λ¬Έμ νΉμ νμΌ)μ΄λ€μ.
λκΉ, container νκ²½μμλ stderr/stdoutμ ν΅ν΄ μΌλ°μ μΌλ‘ λ‘κΉ νλ κ² κ°κΈ΄ ν©λλ€.
readlink -e /dev/stderr
# /dev/pts/3
readlink /dev/stderr
# /proc/self/fd/2
readlink /proc/self/fd/2
# /dev/pts/3
ls -l /dev/pts/3
# crw------- 1 root tty 136, 3 Oct 19 16:00 /dev/pts/3
[ν1] μ€νμ νλΌλ―Έν° μ€μ
--log-level μ΅μ
μ ν΅ν΄, λ‘κΉ
ν κ²½λ‘λ₯Ό μ§μ ν μ μμ΅λλ€.
# ls /var/log/envoy
# ls: cannot access '/var/log/envoy': No such file or directory
# mkdir -p /var/log/envoy
mkdir -p /tmp/envoy-logs
envoy -c envoy-demo.yaml --log-path /tmp/envoy-logs/custom.log
[ν2] Admin μΈν°νμ΄μ€μμ μ€μ

cat envoy-demo.yaml | grep -A 3 -B 3 access_log:
# typed_config:
# "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
# stat_prefix: ingress_http
# access_log:
# - name: envoy.access_loggers.stdout
# typed_config:
# "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
[μ΄μΈ] Log extension
- Log extensionμ ν΅ν΄, λ€μν λ‘κΉ μ€μ μ ν μ μμ΅λλ€.
(e) Envoy networking
κΈ°λ³Έκ°μ IPv6μ IPv4λ₯Ό λͺ¨λ νμ±ννλ IPv6λ₯Ό λΉνμ±ννμ¬μΌνλ μν©μ΄ μλ€λ©΄,
λ°λͺ¨ μ€μ νμΌκ°μ΄ dns_lookup_familyλ₯Ό V4_ONLYλ‘ μ€μ νλ©΄ λκ² μ΅λλ€.
linux νΈμ€νΈκ° μλ νκ²½μμλ ν΄λΉ μΌμ΄μ€κ° μμ μ μλ€κ³ ν©λλ€. (Docker Docs)
cat envoy-demo.yaml | grep -A 7 -B 4 dns_lookup_family
clusters:
- name: service_envoyproxy_io
type: LOGICAL_DNS
# Comment out the following line to test on v6 networks
dns_lookup_family: V4_ONLY
load_assignment:
cluster_name: service_envoyproxy_io
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
(f) Envoy debugging
[ν1] basic
-l νΉμ --log-level μ΅μ
μ ν΅ν΄, λ‘κΉ
λ 벨μ μ€μ ν μ μμ΅λλ€.
- Default:
info - List:
trace,debug,info,warning/warn,error,critical,off
[ν2] component
--component-log-level μ΅μ
μ ν΅ν΄, μ»΄ν¬λνΈλ³λ‘ λ‘κΉ
μ μ§μ ν μ μμ΅λλ€.
μ μ λ‘κΉ
λ 벨μ offλ‘ μ€μ νκ³ , νΉμ μ»΄ν¬λνΈλ§ λ‘κΉ
νκ³ μΆμ λ μ¬μ©ν μ μμ΅λλ€.
ALL_LOGGER_IDS: GitHub
envoy -c envoy-demo.yaml -l off --component-log-level upstream:debug,connection:trace
kkumtree
Source code on GitHub
Β© 2025 kkumtree and contributors All rights reserved.
Licensed under
CC BY-NC-ND 4.0