[Cilium] #5์ฃผ์ฐจ (2) Cilium Geneve encapsulation + DSR(Direct Server Return)

25๋…„๋„ Cilium Study 1๊ธฐ ์ •๋ฆฌ ๊ธ€์ž…๋‹ˆ๋‹ค.

 

Geneve + DSR

(โŽˆ|HomeLab:N/A) root@k8s-ctr:~# helm upgrade cilium cilium/cilium --version 1.18.0 --namespace kube-system --reuse-values \
  --set tunnelProtocol=geneve --set loadBalancer.mode=dsr --set loadBalancer.dsrDispatch=geneve \
  --set loadBalancer.algorithm=maglev
Release "cilium" has been upgraded. Happy Helming!
NAME: cilium
LAST DEPLOYED: Sat Aug 16 20:03:24 2025
NAMESPACE: kube-system
STATUS: deployed
REVISION: 3
TEST SUITE: None
NOTES:
You have successfully installed Cilium with Hubble Relay and Hubble UI.

Your release version is 1.18.0.

For any further help, visit https://docs.cilium.io/en/v1.18/gettinghelp



(โŽˆ|HomeLab:N/A) root@k8s-ctr:~# kubectl -n kube-system rollout restart ds/cilium
daemonset.apps/cilium restarted


(โŽˆ|HomeLab:N/A) root@k8s-ctr:~# kubectl exec -it -n kube-system ds/cilium -- cilium status --verbose
...
  Mode:                  DSR
    DSR Dispatch Mode:   Geneve
  Backend Selection:     Maglev (Table Size: 16381)
  Session Affinity:      Enabled

 

์„ค์ • ์ „์—๋Š” ์„œ๋น„์Šค IP๊ฐ€ ๋ชจ๋“  ๋…ธ๋“œ์— ๊ท ๋“ฑํ•˜๊ฒŒ ๊ด‘๊ณ ๋˜์–ด์„œ ํŒŒ๋“œ๊ฐ€ ์—†๋Š” ๋…ธ๋“œ๋กœ๋„ ํŠธ๋ž˜ํ”ฝ์ด ํ˜๋Ÿฌ๋“ค์–ด๊ฐ€๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋‹ค.

ํ•˜์ง€๋งŒ externalTrafficPolicy=Local๊ณผ ํ•จ๊ป˜ ์œ„ ์„ค์ •์„ ์ ์šฉํ•˜์—ฌ BGP ๋ผ์šฐํŒ… ํ…Œ์ด๋ธ”์—๋Š” ์‹ค์ œ๋กœ Pod๊ฐ€ ์กด์žฌํ•˜๋Š” ๋…ธ๋“œ๋งŒ nexthop์œผ๋กœ ์žกํžŒ๋‹ค.

์™ธ๋ถ€์—์„œ ๋“ค์–ด์˜จ ์š”์ฒญ์€ Geneve ์บก์А๋ง์„ ํ†ตํ•ด ์ ์ ˆํ•œ ํŒŒ๋“œ๋กœ ๋„๋‹ฌํ•˜์—ฌ ์‘๋‹ต์€ Pod → ํด๋ผ์ด์–ธํŠธ๋กœ ์ง์ ‘ ๋‚˜๊ฐ€๋ฏ€๋กœ ๋ถˆํ•„์š”ํ•œ ํ™‰์ด ์‚ฌ๋ผ์ง€๊ฒŒ ๋œ๋‹ค.

 

์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ, ์›Œ์ปค๋…ธ๋“œ0,1์—์„œ curl ํ…Œ์ŠคํŠธ

tcpdump -i eth1 -w /tmp/dsr.pcap


root@router:~# curl -s $LBIP
Hostname: webpod-697b545f57-fnz6w
IP: 127.0.0.1
IP: ::1
IP: 172.20.0.205
IP: fe80::c8f4:b0ff:fe01:9d74
RemoteAddr: 192.168.10.200:43122
GET / HTTP/1.1
Host: 172.16.1.1
User-Agent: curl/8.5.0
Accept: */*

loopy ๎‚ฐ ~/cilium-lab๎‚ฐ
๎‚ฐ vagrant plugin install vagrant-scp
Installing the 'vagrant-scp' plugin. This can take a few minutes...
Fetching hashdiff-1.2.0.gem
Fetching crack-1.0.0.gem
Fetching public_suffix-6.0.2.gem
Fetching addressable-2.8.7.gem
Fetching webmock-3.25.1.gem
Fetching rspec-support-3.13.4.gem
Fetching diff-lcs-1.6.2.gem
Fetching rspec-expectations-3.13.5.gem
Fetching rspec-core-3.13.5.gem
Fetching rspec-its-2.0.0.gem
Fetching rspec-mocks-3.13.5.gem
Fetching rspec-3.13.1.gem
Fetching rake-13.3.0.gem
Thank you for installing the Vagrant VMware Desktop
plugin. This plugin requires the Vagrant VMware
Utility to be installed. To learn more about the
Vagrant VMware Utility, please visit:

  https://www.vagrantup.com/docs/providers/vmware/vagrant-vmware-utility

To install the Vagrant VMware Utility, please
download the appropriate installer for your
system from:

  https://www.vagrantup.com/downloads/vmware
Fetching vagrant-scp-0.5.9.gem
Successfully uninstalled addressable-2.8.7
Successfully uninstalled crack-1.0.0
Removing htmldiff
Removing ldiff
Successfully uninstalled diff-lcs-1.6.2
Successfully uninstalled hashdiff-1.2.0
Successfully uninstalled public_suffix-6.0.2
Removing rake
Successfully uninstalled rake-13.3.0
Successfully uninstalled rspec-3.13.1
Removing rspec
Successfully uninstalled rspec-core-3.13.5
Successfully uninstalled rspec-expectations-3.13.5
Successfully uninstalled rspec-its-2.0.0
Successfully uninstalled rspec-mocks-3.13.5
Successfully uninstalled rspec-support-3.13.4
Successfully uninstalled webmock-3.25.1
Installed the plugin 'vagrant-scp (0.5.9)'!



 loopy ๎‚ฐ ~/cilium-lab๎‚ฐ
๎‚ฐ vagrant scp k8s-ctr:/tmp/dsr.pcap .

Warning: Permanently added '[127.0.0.1]:60000' (ED25519) to the list of known hosts.
dsr.pcap    100%   48KB  44.0MB/s   00:00

 

 

  • Outer ํ—ค๋” (Geneve Encapsulation)
    • Src: 192.168.10.100 (์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ)
    • Dst: 192.168.10.101 (์›Œ์ปค1)
    • Protocol: UDP/6081 (์ œ๋„ค๋ธŒ)
  • Inner ํ—ค๋” (์›๋ž˜ ์š”์ฒญ ํŒจํ‚ท)
    • Src: 192.168.10.200 (๋ผ์šฐํ„ฐ)
    • Dst: 172.20.1.135 (Pod IP)
    • Protocol: TCP 43124 → 80, HTTP GET

 

ํŒŒ๋“œ(172.20.1.135)๋Š” Geneve ํ„ฐ๋„์„ ๊ฑฐ์น˜์ง€ ์•Š๊ณ  ์ง์ ‘ ๋ผ์šฐํ„ฐ(192.168.10.200)๋กœ ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•˜๋Š”๋ฐ,

์ด๋Š” Cilium DSR(Direct Server Return) ๋ชจ๋“œ์˜ ํŠน์ง•์œผ๋กœ ์‘๋‹ต ํŠธ๋ž˜ํ”ฝ์€ ์„œ๋น„์Šค ๋…ธ๋“œ๋ฅผ ๊ฑฐ์น˜์ง€ ์•Š๊ณ  ๋ฐ”๋กœ ํด๋ผ์ด์–ธํŠธ๋กœ ํ–ฅํ•˜๋Š” ๊ฒƒ์„ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ์ด๋‹ค.