์ด ์์์ ๋ฒ๊ทธ ์ ๊ณ ๋ฐ ๊ธฐ๋ฅ ์์ฒญ ์ ์ฉ์ ๋๋ค! ๋์์ด ํ์ํ ๊ฒฝ์ฐ [Stack Overflow] (https://stackoverflow.com/questions/tagged/kubernetes) ๋ฐ [๋ฌธ์ ํด๊ฒฐ ๊ฐ์ด๋] (https://kubernetes.io/docs/tasks/debug-application- ํด๋ฌ์คํฐ / ๋ฌธ์ ํด๊ฒฐ /).
๋ฒ๊ทธ ๋ณด๊ณ ์ ๋๋ ๊ธฐ๋ฅ ์์ฒญ์ ๋๊น? :
/ ์ข ๋ฅ์ ๋ฒ๊ทธ
๋ฌด์จ ์ผ์ด ์ผ์ด ๋ฌ์ต๋๊น?
IPVS ํ๋ก์๋ ๋ค์ ๋ฉ์์ง๋ฅผ ๊ณ์ ๊ธฐ๋กํฉ๋๋ค. ์ฆ, IPVS ํ๋ก์๋ ์๋น์ค๊ฐ ๋ณ๊ฒฝ๋์ง ์๋๋ผ๋ ๊ฐ์ ์๋ฒ๋ฅผ ๊ณ์ ์ ๋ฐ์ดํธํฉ๋๋ค.
I0912 17:08:13.555614 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
I0912 17:08:13.555659 18274 proxier.go:1291] IPVS service default/kubernetes:https was changed
I0912 17:08:13.556787 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:08:13.556818 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns was changed
I0912 17:08:13.557872 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:08:13.557902 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns-tcp was changed
I0912 17:08:13.558940 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
....
I0912 17:09:13.455862 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
I0912 17:09:13.455894 18274 proxier.go:1291] IPVS service default/kubernetes:https was changed
I0912 17:09:13.457139 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:09:13.457169 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns was changed
I0912 17:09:13.458292 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:09:13.458322 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns-tcp was changed
I0912 17:09:13.459468 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
...
์ถ์ . IPVS ๊ฐ์ ์๋ฒ ์ ๋ณด๋ฅผ ์ธ์ํ๊ธฐ ์ํด ์ผ๋ถ ๋ก๊ทธ๋ฅผ ์ถ๊ฐํ์ต๋๋ค.
์์ ํ ์ผ :
IPVS ํ๋ก์๋ ์๋น์ค ๋ณ๊ฒฝ์ด ์์ ๋ ๊ฐ์ ์๋ฒ๋ฅผ ์ ๋ฐ์ดํธํ์ง ์์์ผํฉ๋๋ค.
์ฌํ ๋ฐฉ๋ฒ (๊ฐ๋ฅํ ํ ์ต์ํ์ผ๋ก ์ ํํ๊ฒ) :
๋ก๊ทธ ๋ฉ์์ง๋ฅผ ํ์ธํ๋ฉด ์ฐพ์ ์ ์์ต๋๋ค.
์ฐ๋ฆฌ๊ฐ ์์์ผ ํ ๋ค๋ฅธ ๊ฒ์ด ์์ต๋๊น? :
IPVS ์๋น์ค ํ๋๊ทธ๊ฐ ๋ค๋ฅด๊ธฐ ๋๋ฌธ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค. ์๋ฅผ ๋ค์ด, Flags = 0์ผ๋ก IPVS ์๋น์ค๋ฅผ ์์ฑํ๋ฉด ์์ฑ ๋ ์๋น์ค์ ํ๋๊ทธ๊ฐ (0 + 2 = 2)๋ก ๋ณ๊ฒฝ๋ฉ๋๋ค. ๋ํ Flags = 1๋ก IPVS ์๋น์ค๋ฅผ ์์ฑํ๋ฉด ์์ฑ ๋ ์๋น์ค์ Flags๊ฐ (1 + 2 = 3)์ผ๋ก ๋ณ๊ฒฝ๋ฉ๋๋ค.
๊ด๋ จ ๋ฌธ์ ์ฐธ์กฐ : https://github.com/docker/libnetwork/issues/1921
ํ๊ฒฝ :
kubectl version
) :uname -a
) :/ sig ๋คํธ์ํฌ
/ ํ ๋น @ m1093782566
/ cc @choury @ Lion-Wei
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
/ cc @choury @ Lion-Wei