{"id":491819,"date":"2026-08-22T09:44:10","date_gmt":"2026-08-22T09:44:10","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=491819"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=491819","title":{"rendered":"\u0421\u0435\u0442\u044c kubernetes \u0431\u0435\u0437 \u043c\u0430\u0433\u0438\u0438: \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 \u043d\u0430 kind + Cilium"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b c\u00a0k8s, \u0437\u043d\u0430\u044e\u0442: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CNI, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u00a0\u0434\u0430\u0436\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0438\u0437\u00a0\u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u043d\u0430\u00a0\u00ab\u0440\u044b\u043d\u043a\u0435\u00bb \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u0435\u0439\u0441. \u041d\u043e\u00a0\u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u044b\u043c\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u00a0\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u00a0\u043f\u0430\u043a\u0435\u0442\u043e\u043c \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c. \u041f\u043e\u043a\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0435\u00a0\u043c\u0435\u0448\u0430\u0435\u0442. \u041e\u043d\u0430 \u0441\u0442\u0440\u0435\u043b\u044f\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0442\u0435\u0440\u0433\u0435\u0439\u0441\u0442: \u043f\u0430\u043a\u0435\u0442\u044b \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u043e\u0434\u0430\u043c\u0438, latency \u0441\u043a\u0430\u0447\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0437, NetworkPolicy \u00ab\u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c\u00bb, \u043d\u043e\u00a0\u043f\u043e\u00a0\u0432\u0441\u0435\u043c \u043a\u0430\u0436\u0443\u0449\u0438\u043c\u0441\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c \u0432\u0441\u0435 \u0437\u0435\u043b\u0435\u043d\u043e\u0435.<\/p>\n<p>\u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f\u00a0\u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u0443\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u0430 \u0440\u0443\u043a\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"#minimalnaya-teoriya-pered-startom\" rel=\"noopener noreferrer nofollow\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#kak-sobrat-klaster-za-paru-minut\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0437\u0430 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d\u0443\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#nastroyka-cilium-cni\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Cilium CNI<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#chto-takoe-bridzh-i-ebpf-programmy\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0431\u0440\u0438\u0434\u0436 \u0438 eBPF-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#mezhnodovyy-hop---vxlan\" rel=\"noopener noreferrer nofollow\">\u041c\u0435\u0436\u043d\u043e\u0434\u043e\u0432\u044b\u0439 \u0445\u043e\u043f \u2014 VXLAN<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#observability-poymat-svoy-paket-v-hubble\" rel=\"noopener noreferrer nofollow\">Observability: \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 Hubble<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#bonus-zagadka\" rel=\"noopener noreferrer nofollow\">\u0411\u043e\u043d\u0443\u0441-\u0437\u0430\u0433\u0430\u0434\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#zachem-eto-i-kuda-dalshe\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0438 \u043a\u0443\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u043d\u0430 WSL2. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 WSL \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u044f\u0434\u0440\u043e \u043e\u0442 Microsoft (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 6.6.87.2-microsoft-standard-WSL2). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0440\u044f\u0434 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043d\u0438\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044b \u043f\u043e \u0445\u043e\u0434\u0443 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"minimalnaya-teoriya-pered-startom\" id=\"minimalnaya-teoriya-pered-startom\"><\/a><\/p>\n<h3>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c<\/h3>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430, \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 linux \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u00a0\u0443\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u043c \u00ab\u0437\u0440\u0435\u043d\u0438\u0435\u043c\u00bb \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441\u044b: <code>mount namespace<\/code> \u043f\u0440\u044f\u0447\u0435\u0442 \u0447\u0443\u0436\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, <code>pid namespace<\/code> &#8212; \u0447\u0443\u0436\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438\u00a0\u0442\u0434\u00a0\u0438\u00a0\u0442\u043f. \u0414\u043b\u044f \u0442\u0435\u043c\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d <code>network namespace<\/code>.<\/p>\n<p>\u0418\u0437\u00a0\u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u043a\u0442, \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e k8s \u0441\u0435\u0442\u044c \u043d\u0435\u00a0\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u0434\u00a0\u2014 \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u044f\u0442 \u043e\u0434\u0438\u043d <code>network space<\/code> (\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0435\u0433\u043e \u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0439 pause-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0430\u00a0\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u00a0\u043d\u0435\u043c\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0430 \u0432\u0438\u0434\u044f\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0433\u0443\u0430 \u043f\u043e <code>localhost<\/code>, \u0430\u00a0\u0443\u00a0\u043f\u043e\u0434\u0430 \u043e\u0434\u0438\u043d\u00a0IP \u043d\u0430\u00a0\u0432\u0441\u0435\u0445).<\/p>\n<p>\u041d\u043e\u00a0nets \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a \u0438\u0437\u00a0\u043d\u0435\u0433\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c\u0441\u044f? \u0427\u0435\u0440\u0435\u0437 <code>veth-\u043f\u0430\u0440\u0443<\/code> (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0442\u0447\u043a\u043e\u0440\u0434 \u0441\u00a0\u0434\u0432\u0443\u043c\u044f \u043a\u043e\u043d\u0446\u0430\u043c\u0438). \u041e\u0434\u0438\u043d \u043a\u043e\u043d\u0435\u0446\u00a0\u2014 <code>eth0<\/code>, \u0432\u0442\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u00a0nets \u043f\u043e\u0434\u0430, \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u00a0nets \u043d\u043e\u0434\u044b. \u041a\u0442\u043e \u0438\u00a0\u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u043d\u0430\u00a0\u043d\u043e\u0434\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0446\u0435\u00a0\u2014 \u044d\u0442\u043e \u0438\u00a0\u0435\u0441\u0442\u044c \u0437\u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 CNI \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"kak-sobrat-klaster-za-paru-minut\" id=\"kak-sobrat-klaster-za-paru-minut\"><\/a><\/p>\n<h3>\u041a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0437\u0430 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d\u0443\u0442<\/h3>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c <em>\u043c\u0443\u043b\u044c\u0442\u0438\u043d\u043e\u0434\u043e\u0432\u044b\u0439<\/em> \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u0432\u0435\u0434\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u044f\u0441\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0435\u0436\u043d\u043e\u0434\u043e\u0432\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a. Kind \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"bash\">curl -Lo .\/kind https:\/\/github.com\/kubernetes-sigs\/kind\/releases\/latest\/download\/kind-linux-amd64chmod +x .\/kindsudo mv .\/kind \/usr\/local\/bin\/kindkind versioncurl -LO \"https:\/\/dl.k8s.io\/release\/$(curl -L -s https:\/\/dl.k8s.io\/release\/stable.txt)\/bin\/linux\/amd64\/kubectl\"chmod +x kubectlsudo mv kubectl \/usr\/local\/bin\/kubectlkubectl version --client<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0433\u0440\u0430\u0431\u043b\u0438 \u21161. \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u044f\u0434\u0440\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440<\/h4>\n<p>\u0411\u0438\u043d\u0430\u0440\u0438 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u043d\u043e \u043f\u0435\u0440\u0435\u0434 <code>kind create<\/code> \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c 10 \u0441\u0435\u043a \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u044f\u0434\u0440\u0430. Cilium \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 eBPF (\u0447\u0442\u043e \u044d\u0442\u043e \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043c \u0434\u0430\u043b\u0435\u0435), \u0430 eBPF \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u044f\u0434\u0440\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043b\u044f \u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438.<\/p>\n<pre><code class=\"bash\">uname -r<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435 4.x \u0441\u043c\u0435\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0434\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<pre><code class=\"bash\">ls -la \/sys\/kernel\/btf\/vmlinuxmount | grep bpf-r--r--r-- 1 root root 6050732 Jun  9 11:17 \/sys\/kernel\/btf\/vmlinux<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0430\u0439\u043b BPF \u043d\u0430 \u043c\u0435\u0441\u0442\u0435(\u044d\u0442\u043e \u0442\u0438\u043f\u043e\u0432\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u044f\u0434\u0440\u0430, \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f <a href=\"https:\/\/docs.ebpf.io\/concepts\/core\/\" rel=\"noopener noreferrer nofollow\">CO-RE<\/a>). \u0410 \u0432\u043e\u0442 <code>bpffs<\/code> \u0443 \u043c\u0435\u043d\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e, \u0442\u043a Cilium \u0441\u0430\u043c \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442 <code>bpffs<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 kind \u043d\u043e\u0434 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u043e \u0434\u043b\u044f \u0438\u0433\u0440 \u0441 <code>bpftool<\/code> \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432 fstab, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a WSL.<\/p>\n<pre><code class=\"bash\">sudo mount -t bpf bpf \/sys\/fs\/bpfecho 'bpf \/sys\/fs\/bpf bpf defaults 0 0' | sudo tee -a \/etc\/fstab<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0421\u0430\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440<\/h4>\n<p>\u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0441 \u0442\u0440\u0435\u043c\u044f \u043d\u043e\u0434\u0430\u043c\u0438 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c CNI:<\/p>\n<pre><code class=\"yaml\"># kind-cluster.yamlkind: ClusterapiVersion: kind.x-k8s.io\/v1alpha4nodes:  - role: control-plane  - role: worker  - role: workernetworking:  disableDefaultCNI: true<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code class=\"bash\">kind create cluster --name lab --config kind-cluster.yamlkubectl get nodes<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 <code>NotReady<\/code> &#8212; \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0442\u043a \u043f\u043e\u043a\u0430 CNI \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"nastroyka-cilium-cni\" id=\"nastroyka-cilium-cni\"><\/a><\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Cilium CNI<\/h3>\n<h4>\u0433\u0440\u0430\u0431\u043b\u0438 \u21162. zsh \u0441\u044a\u0435\u0434\u0430\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438\ud83d\ude44<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 zsh \u0441 oh-my-zsh, \u0442\u043e \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 <code>url-quote-magic<\/code> \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u00ab\u043e\u043f\u0430\u0441\u043d\u044b\u0435\u00bb \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 <code>\\{<\/code>. \u041d\u0430 \u0432\u0440\u0435\u043c\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b <code>DISABLE_MAGIC_FUNCTIONS=true<\/code> \u0432 <code>~\/.zshrc<\/code>, \u043c\u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u0435\u0435 \ud83e\udd37.<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Cilium<\/h4>\n<pre><code class=\"bash\">CILIUM_CLI_VERSION=$(curl -s https:\/\/raw.githubusercontent.com\/cilium\/cilium-cli\/main\/stable.txt)echo \"$CILIUM_CLI_VERSION\"   # \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u043e curl -L --fail -O https:\/\/github.com\/cilium\/cilium-cli\/releases\/download\/$CILIUM_CLI_VERSION\/cilium-linux-amd64.tar.gzcurl -L --fail -O https:\/\/github.com\/cilium\/cilium-cli\/releases\/download\/$CILIUM_CLI_VERSION\/cilium-linux-amd64.tar.gz.sha256sumsha256sum --check cilium-linux-amd64.tar.gz.sha256sumsudo tar xzvfC cilium-linux-amd64.tar.gz \/usr\/local\/binrm cilium-linux-amd64.tar.gz cilium-linux-amd64.tar.gz.sha256sum<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>CLI \u0441\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 kind \u0438 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u043f\u0446\u0438\u0438<\/p>\n<pre><code class=\"bash\">cilium installcilium status --waitcilium hubble enable<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0427\u0435\u0440\u0435\u0437 2-3 \u043c\u0438\u043d\u0443\u0442\u044b \u0432\u0438\u0434\u0438\u043c \u0437\u0430\u0432\u0435\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:<\/p>\n<pre><code>    \/\u00af\u00af\\ \/\u00af\u00af\\__\/\u00af\u00af\\    Cilium:             OK \\__\/\u00af\u00af\\__\/    Operator:           OK \/\u00af\u00af\\__\/\u00af\u00af\\    Envoy DaemonSet:    OK \\__\/\u00af\u00af\\__\/    Hubble Relay:       OK    \\__\/       ClusterMesh:        disabledDaemonSet              cilium                   Desired: 3, Ready: 3\/3, Available: 3\/3...Cluster Pods:          4\/4 managed by CiliumHelm chart version:    1.19.3<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u0441\u0435 \u043d\u043e\u0434\u044b \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 CNI \u043e\u043d\u0438 \u0432\u0441\u0435 <code>Ready<\/code>.<\/p>\n<pre><code class=\"bash\">kubectl get nodes -o wide<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code>NAME                STATUS   ROLES           AGE   VERSION   INTERNAL-IP   ...lab-control-plane   Ready    control-plane   13m   v1.36.1   172.21.0.3lab-worker          Ready    &lt;none&gt;          13m   v1.36.1   172.21.0.4lab-worker2         Ready    &lt;none&gt;          13m   v1.36.1   172.21.0.2<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 INTERNAL-IP \u0443\u0437\u043b\u043e\u0432 <code>172.21.0.x<\/code>. \u042d\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430 kind-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043c\u044b \u0435\u0449\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0445 \u0432 \u0440\u043e\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e! \u041c\u044b \u0431\u0435\u0440\u0435\u043c Cilium \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f kube-proxy. Cilium \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f CNI, NetworkPolicies \u0438 Observability, \u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 Service \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 kube-proxy \u0447\u0435\u0440\u0435\u0437 iptables. \u041f\u043e\u043b\u043d\u044b\u0439 \u0440\u0435\u043f\u043b\u0435\u0439\u0441\u043c\u0435\u043d\u0442 kube-proxy &#8212; \u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (\u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0435\u0441\u043b\u0438 \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e).<\/p>\n<h4>\u041f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0435<\/h4>\n<p>\u0421\u0442\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u043f\u043e\u0434\u0430 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 worker \u043d\u043e\u0434\u044b. \u0421\u0442\u0430\u0432\u0438\u043c image: netshoot \u2014 \u043d\u0430\u0448 \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0439 \u043d\u043e\u0436 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435.<\/p>\n<pre><code class=\"yaml\"># trace-pods.yamlapiVersion: v1kind: Podmetadata: { name: pod-a, labels: { app: trace } }spec:  nodeName: lab-worker  containers: [{ name: net, image: nicolaka\/netshoot, command: [\"sleep\",\"infinity\"] }]---apiVersion: v1kind: Podmetadata: { name: pod-b, labels: { app: trace } }spec:  nodeName: lab-worker2  containers: [{ name: net, image: nicolaka\/netshoot, command: [\"sleep\",\"infinity\"] }]<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code class=\"bash\">kubectl apply -f trace-pods.yamlkubectl get pods -o wide<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<hr\/>\n<p><a class=\"anchor\" name=\"chto-takoe-bridzh-i-ebpf-programmy\" id=\"chto-takoe-bridzh-i-ebpf-programmy\"><\/a><\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0431\u0440\u0438\u0434\u0436 \u0438 eBPF-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h3>\n<h4>\u0412\u0437\u0433\u043b\u044f\u0434 \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043f\u043e\u0434\u0430<\/h4>\n<pre><code class=\"bash\">kubectl exec pod-a -- ip -d addr show eth0kubectl exec pod-a -- cat \/sys\/class\/net\/eth0\/iflink<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c <code>eth0@if15<\/code> (\u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 15). \u042d\u0442\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u044f\u0434\u0440\u0430: \u044f veth, \u0430 \u043c\u043e\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0435\u0446 \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 15 \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u043c \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441\u0435. Iflink \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u0436\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0437\u0430 \u043a\u0430\u043a\u0443\u044e \u043d\u0438\u0442\u043a\u0443 \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<h4>\u0412\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0431\u0440\u0438\u0434\u0436<\/h4>\n<p>\u00ab\u0425\u043e\u0441\u0442\u00bb \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u0432\u0430\u0448 WSL-\u0448\u0435\u043b\u043b, \u0430\u00a0kind \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043d\u043e\u0434\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/p>\n<pre><code class=\"bash\">docker exec -it lab-worker bash# \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u043e\u0434\u044b (\u043f\u043e\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0439 ifindex):ip link | grep '^15:'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <code>15: lxc4f2a1b3c@if12<\/code>. \u042d\u0442\u043e \u0442\u0430\u043a Cilium \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0445\u043e\u0441\u0442\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u044b veth. \u0410\u00a0\u0442\u0435\u043f\u0435\u0440\u044c \u0441\u044e\u0440\u043f\u0440\u0438\u0437: \u0432\u00a0\u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 CNI (flannel, kindset \u0438\u00a0\u0442\u043f) \u0432\u0441\u0435 veth-\u043a\u043e\u043d\u0446\u044b \u00ab\u0432\u043e\u0442\u043a\u043d\u0443\u0442\u044b\u00bb \u0432\u00a0\u0431\u0440\u0438\u0434\u0436 <code>cni0<\/code> (\u044d\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 L2-\u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440 \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0437\u043b\u0430, \u043e\u043d\u00a0\u043a\u043e\u043c\u043c\u0443\u0442\u0438\u0440\u0443\u0435\u0442 \u043a\u0430\u0434\u0440\u044b \u043c\u0435\u0436\u0434\u0443 \u0445\u043e\u0441\u0442\u0430\u043c\u0438, \u0430\u00a0\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e \u0438\u00a0NAT \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 iptables). \u0422\u0430\u043a \u0432\u043e\u0442 \u0443\u00a0\u043d\u0430\u0441 \u0442\u043e\u00a0\u044d\u0442\u043e\u0433\u043e \u0431\u0440\u0438\u0434\u0436\u0430 \u043d\u0435\u0442 \u0438\u00a0iptables \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0442\u00a0\u0441\u043b\u043e\u0432\u0430 \u0441\u043e\u0432\u0441\u0435\u043c:<\/p>\n<pre><code class=\"bash\">ip link show type bridge# \u043f\u0443\u0441\u0442\u043e<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0431\u0440\u0438\u0434\u0436\u0430:<\/p>\n<pre><code class=\"bash\">ip -br link<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u2026 \u0443 \u043d\u0430\u0441 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 Cilium <code>cilium_host<\/code>\u0438 <code>cilium_net<\/code> (\u043d\u0430\u0448\u0430 veth-\u043f\u0430\u0440\u0430), <code>cilium-vxlan<\/code>(\u043e \u043d\u0435\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435), <code>lxc_health<\/code> \u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 <code>lxc*<\/code> \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434. \u0418 \u043a\u0442\u043e \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0433\u043e\u043d\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u044b? <strong>eBPF-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/strong> \u2014 \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u044f\u0434\u0440\u0435, \u0431\u0435\u0437 \u0431\u0440\u0438\u0434\u0436\u0430, \u0431\u0435\u0437 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u043e\u0431\u0445\u043e\u0434\u0430 \u0446\u0435\u043f\u043e\u0447\u0435\u043a iptables.<\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 eBPF, \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u044f\u0441\u044c \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 identity \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 egress-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443<\/strong> (\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c -&gt; \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c &#8212; allow\/deny)<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0435\u0434\u0435\u0442 conntrack<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a<\/strong><\/p>\n<\/li>\n<\/ul>\n<h4>\u0414\u0430\u0442\u0430\u043f\u043b\u0435\u0439\u043d &#8212; \u044d\u0442\u043e \u043c\u0430\u043f\u044b<\/h4>\n<p>\u0420\u0430\u0437 \u0444\u043e\u0440\u0432\u0430\u0440\u0434\u0438\u043d\u0433\u043e\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f eBPF, \u0433\u0434\u0435 \u0436\u0435 \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435? \u0412 eBPF-\u043c\u0430\u043f\u0430\u0445, \u0442\u0435 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0432 \u044f\u0434\u0440\u0435. Cilium-\u0430\u0433\u0435\u043d\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u0435 \u0443\u043c\u0435\u0435\u0442 \u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"bash\">CILIUM_POD=$(kubectl -n kube-system get pods -l k8s-app=cilium --field-selector spec.nodeName=lab-worker -o name | head -1) kubectl -n kube-system exec $CILIUM_POD -c cilium-agent -- cilium-dbg endpoint listkubectl -n kube-system exec $CILIUM_POD -c cilium-agent -- cilium-dbg bpf ipcache listkubectl -n kube-system exec $CILIUM_POD -c cilium-agent -- cilium-dbg bpf lb list<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<ul>\n<li>\n<p><code>exndpoint list<\/code> \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434 \u043a\u0430\u043a eBPF \u044d\u043d\u043f\u043e\u0438\u043d\u0442 \u0441\u043e \u0441\u0432\u043e\u0438\u043c identiry;<\/p>\n<\/li>\n<li>\n<p><code>bpf ipcache list<\/code> \u2014 \u043c\u0430\u043f\u0430 <code>IP-\u043f\u043e\u0434\u0432 -&gt; (IP-\u043d\u043e\u0434\u044b, identity)<\/code>. \u0422\u0443\u0442 eBPF \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u0435\u043c\u0443 \u0435\u0445\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043d\u043e\u0434\u0443 \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p><code>bpf lb list<\/code> \u2014 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 Services \u043a\u0430\u043a lookup \u043f\u043e \u0445\u0435\u0448-\u043c\u0430\u043f\u0435. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430 \u043f\u0443\u0441\u0442\u0430\u044f, \u0442\u043a \u044d\u0442\u0438\u043c \u043f\u043e\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f kube-proxy.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e \u043c\u044b \u0434\u043e\u043a\u0430\u0437\u0430\u043b\u0438: \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0442\u0438 \u0432 Cilium \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 iptables, \u0430 \u043c\u0430\u043f\u0438\u043d\u0433\u0438 \u044f\u0434\u0440\u0430. \u0421\u0430\u043c\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u043b\u044e\u0441 Cilium \u201c\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432\u201d \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"mezhnodovyy-hop---vxlan\" id=\"mezhnodovyy-hop---vxlan\"><\/a><\/p>\n<h3>\u041c\u0435\u0436\u043d\u043e\u0434\u043e\u0432\u044b\u0439 \u0445\u043e\u043f &#8212; VXLAN<\/h3>\n<p>\u041a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u0441 pod-IP (10.244.x.x) \u0435\u0434\u0435\u0442 \u043f\u043e \u0441\u0435\u0442\u0438 \u0434\u043e\u043a\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u043d\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 172.21.0.x? \u041e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"bash\">kubectl -n kube-system exec $CILIUM_POD -c cilium-agent -- cilium-dbg status | grep -i routing<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code>Routing:    Network: Tunnel [vxlan]   ...<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u0440\u0435\u0436\u0438\u043c VXLAN-\u043e\u0432\u0435\u0440\u043b\u0435\u0439. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 (<code>10.244.1.x -&gt; 10.244.2.x<\/code>) \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 UDP-\u0434\u0430\u0442\u0430\u0433\u0440\u0430\u043c\u0443, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0443\u0437\u043b\u043e\u0432 (<code>172.21.0.4 -&gt; 172.21.0.2<\/code>). \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 \u0432\u0435\u0437\u0435\u0442 \u00ab\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u00bb \u0438 \u043d\u0435 \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u044c. \u0422\u0443\u0434\u0430 \u0436\u0435 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f identity \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u043b \u0435\u0435 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437. \u041d\u0430 \u0442\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 <code>cilium_vxlan<\/code> \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 eBPF, \u0430 \u0442\u043e\u0442 \u0432 veth \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0430. \u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0443\u0442\u044c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>pod-a eth0  \u2192 lxc* (eBPF: identity, policy, routing)      lab-worker1  \u2192 cilium_vxlan (\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f)  \u2192 eth0 \u043d\u043e\u0434\u044b 172.21.0.4  \u2500\u2500\u2500\u2500\u2500\u2500 \u043f\u0440\u043e\u0432\u043e\u0434 (docker network) \u2500\u2500\u2500\u2500\u2500\u2500  \u2192 eth0 \u043d\u043e\u0434\u044b 172.21.0.2                        lab-worker2  \u2192 cilium_vxlan (\u0434\u0435\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f)  \u2192 lxc* (eBPF: ingress policy)  \u2192 pod-b eth0<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<hr\/>\n<p><a class=\"anchor\" name=\"observability-poymat-svoy-paket-v-hubble\" id=\"observability-poymat-svoy-paket-v-hubble\"><\/a><\/p>\n<h3>Observability: \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 Hubble<\/h3>\n<p>Hubble \u2014 \u044d\u0442\u043e observability \u0442\u0443\u043b\u0437\u0430, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432 \u0434\u0430\u0442\u0430\u043f\u043b\u0435\u0439\u043d. \u0414\u043e\u0441\u0442\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043e\u0431\u043e\u0433\u0430\u0449\u0430\u044f \u0435\u0433\u043e k8s \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<h4>\u0433\u0440\u0430\u0431\u043b\u0438 \u21163. port-forward \u043f\u043e\u0434 WSL2<\/h4>\n<p>\u041a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u043f\u0443\u0442\u044c <code>cilium hubble port-forward<\/code> \u0438 Hubble CLI \u0443 \u043c\u0435\u043d\u044f \u0443\u043c\u0438\u0440\u0430\u043b:<\/p>\n<pre><code>E0609 ... \"Unhandled Error\" err=\"an error occurred forwarding 4245 -&gt; 4245:... read: connection reset by peer\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u2026 \u0438 <code>hubble status<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u043b <code>rpc error: ... transport: Error while dialing<\/code>. \u0415\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u0438\u043b\u0438 \u0442\u0430\u043a\u0443\u044e\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u0435 \u0432\u043e\u044e\u0439\u0442\u0435 \u0441 \u043d\u0435\u0439. Hubble \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u0433\u0435\u043d\u0442 Cilium, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 unix-\u0441\u043e\u043a\u0435\u0442:<\/p>\n<pre><code class=\"bash\">kubectl -n kube-system exec $CILIUM_POD -c cilium-agent -- hubble observe --to-pod default\/pod-b --follow<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u041f\u0438\u043d\u0433 \u0438 \u0440\u0430\u0437\u0431\u043e\u0440 \u0441\u0442\u0440\u043e\u043a\u0438<\/h4>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">POD_B_IP=$(kubectl get pod pod-b -o jsonpath='{.status.podIP}')kubectl exec pod-a -- ping -c 3 $POD_B_IPPING 10.244.1.87 (10.244.1.87) 56(84) bytes of data.64 bytes from 10.244.1.87: icmp_seq=1 ttl=63 time=0.261 ms...3 packets transmitted, 3 received, 0% packet loss<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0441\u0430\u043c\u0430\u044f \u0434\u043e\u043b\u0433\u043e\u0436\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<pre><code>Jun  9 09:56:40.520: default\/pod-a (ID:5259) -&gt; default\/pod-b (ID:5259) to-overlay FORWARDED (ICMPv4 EchoRequest)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0435\u0435 \u0434\u043e\u0441\u043a\u043e\u043d\u0430\u043b\u044c\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0445\u0435\u043c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435:<\/p>\n<ul>\n<li>\n<p><code><strong>default\/pod-a -&gt; default\/pod-b<\/strong><\/code> \u2014 \u0438\u043c\u0435\u043d\u0430 \u043f\u043e\u0434\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u043e\u043b\u044b\u0445 IP. eBPF  \u043d\u0430 egress-veth \u0441\u043c\u043e\u0433 \u043e\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b;<\/p>\n<\/li>\n<li>\n<p><code><strong>to-overlay<\/strong><\/code> \u2014 \u0432\u0435\u0440\u0434\u0438\u043a\u0442: \u043f\u0430\u043a\u0435\u0442 \u0443\u0448\u0435\u043b \u0432 VXLAN \u0442\u043e\u043d\u043d\u0435\u043b\u044c. \u042d\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p><code><strong>FORWARDED<\/strong><\/code> \u2014 eBPF \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0430 \u043f\u0430\u043a\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p><code><strong>ID:5259<\/strong><\/code>  \u2014 security identity. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0443 \u043e\u0431\u043e\u0438\u0445 \u043e\u043d \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439, \u0442\u043a identity \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043f\u043e IP, \u0430 \u043f\u043e \u043b\u0435\u0439\u0431\u043b\u0430\u043c (\u0443 \u043d\u0430\u0441 \u043e\u0431\u0430 \u043f\u043e\u0434\u0430 \u043d\u0435\u0441\u0443\u0442 <code>app: trace<\/code>)<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a class=\"anchor\" name=\"bonus-zagadka\" id=\"bonus-zagadka\"><\/a><\/p>\n<h3>\u0411\u043e\u043d\u0443\u0441-\u0437\u0430\u0433\u0430\u0434\u043a\u0430<\/h3>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 ping: <code>ttl=63<\/code>. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e netshoot \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 \u0441 TTL=64. \u0414\u043e\u0448\u043b\u043e 63, \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u0434\u0435\u043a\u0440\u0435\u043c\u0435\u043d\u0442. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0430\u043a\u0435\u0442 \u043f\u0440\u043e\u0448\u0435\u043b 8 \u201c\u044d\u0442\u0430\u043f\u043e\u0432\u201d (\u043f\u043e \u0441\u0445\u0435\u043c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043f\u043e 4 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b) \u0437\u0430 \u043e\u0434\u0438\u043d \u0445\u043e\u043f.<\/p>\n<p>\u0420\u0430\u0437\u0433\u0430\u0434\u043a\u0430: VXLAN \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u0430 \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430, \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0435\u0433\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435\u00a0\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442, \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0437\u0443\u0442 \u043a\u0430\u043a \u0433\u0440\u0443\u0437. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 L3\u00a0\u043f\u0435\u0440\u0435\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0435\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u00a0\u2014 \u044d\u0442\u043e \u0448\u043b\u044e\u0437 \u043c\u0435\u0436\u0434\u0443 pod CIDR-\u0430\u043c\u0438. \u0425\u043e\u0440\u043e\u0448\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u043f\u043e\u0432 \u0432\u0438\u0434\u0438\u0442 \u043f\u0430\u043a\u0435\u0442 \u0438\u00a0\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0436\u0435\u043b\u0435\u0437\u0430 \u043e\u043d\u00a0\u043f\u0440\u043e\u0448\u0435\u043b. \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u043a\u0442: \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 TTL \u0432\u00a0\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435\u00a0\u2014 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0438\u0434\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a.<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"zachem-eto-i-kuda-dalshe\" id=\"zachem-eto-i-kuda-dalshe\"><\/a><\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0438 \u043a\u0443\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435<\/h3>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b CNI \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430 \u0432\u00a0\u043f\u0440\u043e\u0434\u0435. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u00ab\u0441\u0435\u0442\u044c \u0433\u043b\u044e\u0447\u0438\u0442\u00bb \u0438\u00a0\u0447\u0435\u0441\u0442\u043d\u044b\u043c \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0434\u0438\u0430\u0433\u043d\u043e\u0437\u043e\u043c \u0432\u00a0\u0442\u043e\u043c, \u0435\u0441\u0442\u044c\u00a0\u043b\u0438 \u0443\u00a0\u0432\u0430\u0441 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u0447\u0435\u0442\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0417\u043d\u0430\u044f CNI \u0432\u0430\u043c \u043d\u0435\u00a0\u043d\u0430\u0434\u043e \u0433\u0430\u0434\u0430\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043b\u0430\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c CNI \u0441\u0432\u0435\u0440\u0445\u0443-\u0432\u043d\u0438\u0437. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0439 \u043f\u043b\u0430\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u043e\u0442\u0441\u0435\u0447\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0434\u043e\u0433\u0430\u0434\u043e\u043a. \u041a\u0430\u043a \u0438\u00a0\u0444\u0438\u0448\u043a\u0430 \u0441\u00a0ttl, \u0434\u0435\u0448\u0435\u0432\u044b\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0440\u043a\u0435\u0440\u00a0\u2014 \u043c\u0438\u043d\u0443\u0441 \u0433\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043e\u0441\u0442\u0430\u043b\u0441\u044f, \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u0441\u043d\u043e\u0441\u0438\u0442\u044c, \u0435\u0449\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u0432\u0430 \u0441\u044e\u0436\u0435\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>kube-proxy replacement<\/p>\n<\/li>\n<li>\n<p>NetworkPolicy \u0441 \u0436\u0438\u0432\u044b\u043c\u0438 DROP<\/p>\n<\/li>\n<\/ul>\n<p><strong>Veth, eBPF, VXLAN \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043c\u043e\u0448\u0435\u043d\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u0430)<\/strong><\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1073254\/\">https:\/\/habr.com\/ru\/articles\/1073254\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0441\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b c\u00a0k8s, \u0437\u043d\u0430\u044e\u0442: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CNI, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u00a0\u0434\u0430\u0436\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0438\u0437\u00a0\u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u043d\u0430\u00a0\u00ab\u0440\u044b\u043d\u043a\u0435\u00bb \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u0435\u0439\u0441. \u041d\u043e\u00a0\u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u044b\u043c\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u00a0\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u00a0\u043f\u0430\u043a\u0435\u0442\u043e\u043c \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c. \u041f\u043e\u043a\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0435\u00a0\u043c\u0435\u0448\u0430\u0435\u0442. \u041e\u043d\u0430 \u0441\u0442\u0440\u0435\u043b\u044f\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0442\u0435\u0440\u0433\u0435\u0439\u0441\u0442: \u043f\u0430\u043a\u0435\u0442\u044b \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u043e\u0434\u0430\u043c\u0438, latency \u0441\u043a\u0430\u0447\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0437, NetworkPolicy \u00ab\u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c\u00bb, \u043d\u043e\u00a0\u043f\u043e\u00a0\u0432\u0441\u0435\u043c \u043a\u0430\u0436\u0443\u0449\u0438\u043c\u0441\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c \u0432\u0441\u0435 \u0437\u0435\u043b\u0435\u043d\u043e\u0435.\u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f\u00a0\u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u0443\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u0430 \u0440\u0443\u043a\u0430\u043c\u0438:\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c\u041a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0437\u0430 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d\u0443\u0442\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Cilium CNI\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0431\u0440\u0438\u0434\u0436 \u0438 eBPF-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\u041c\u0435\u0436\u043d\u043e\u0434\u043e\u0432\u044b\u0439 \u0445\u043e\u043f \u2014 VXLANObservability: \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 Hubble\u0411\u043e\u043d\u0443\u0441-\u0437\u0430\u0433\u0430\u0434\u043a\u0430\u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0438 \u043a\u0443\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435\u0412\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u043d\u0430 WSL2. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 WSL \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u044f\u0434\u0440\u043e \u043e\u0442 Microsoft (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 6.6.87.2-microsoft-standard-WSL2). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0440\u044f\u0434 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043d\u0438\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044b \u043f\u043e \u0445\u043e\u0434\u0443 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430, \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 linux \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u00a0\u0443\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u043c \u00ab\u0437\u0440\u0435\u043d\u0438\u0435\u043c\u00bb \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441\u044b: mount namespace \u043f\u0440\u044f\u0447\u0435\u0442 \u0447\u0443\u0436\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, pid namespace &#8212; \u0447\u0443\u0436\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438\u00a0\u0442\u0434\u00a0\u0438\u00a0\u0442\u043f. \u0414\u043b\u044f \u0442\u0435\u043c\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d network namespace.\u0418\u0437\u00a0\u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u043a\u0442, \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e k8s \u0441\u0435\u0442\u044c \u043d\u0435\u00a0\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u0434\u00a0\u2014 \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u044f\u0442 \u043e\u0434\u0438\u043d network space (\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0435\u0433\u043e \u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0439 pause-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0430\u00a0\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u00a0\u043d\u0435\u043c\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0430 \u0432\u0438\u0434\u044f\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0433\u0443\u0430 \u043f\u043e localhost, \u0430\u00a0\u0443\u00a0\u043f\u043e\u0434\u0430 \u043e\u0434\u0438\u043d\u00a0IP \u043d\u0430\u00a0\u0432\u0441\u0435\u0445).\u041d\u043e\u00a0nets \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a \u0438\u0437\u00a0\u043d\u0435\u0433\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c\u0441\u044f? \u0427\u0435\u0440\u0435\u0437 veth-\u043f\u0430\u0440\u0443 (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0442\u0447\u043a\u043e\u0440\u0434 \u0441\u00a0\u0434\u0432\u0443\u043c\u044f \u043a\u043e\u043d\u0446\u0430\u043c\u0438). \u041e\u0434\u0438\u043d \u043a\u043e\u043d\u0435\u0446\u00a0\u2014 eth0, \u0432\u0442\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u00a0nets \u043f\u043e\u0434\u0430, \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u00a0nets \u043d\u043e\u0434\u044b. \u041a\u0442\u043e \u0438\u00a0\u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u043d\u0430\u00a0\u043d\u043e\u0434\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0446\u0435\u00a0\u2014 \u044d\u0442\u043e \u0438\u00a0\u0435\u0441\u0442\u044c \u0437\u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 CNI \u043f\u043b\u0430\u0433\u0438\u043d\u0430.\u041a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0437\u0430 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d\u0443\u0442\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043c\u0443\u043b\u044c\u0442\u0438\u043d\u043e\u0434\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u0432\u0435\u0434\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u044f\u0441\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0435\u0436\u043d\u043e\u0434\u043e\u0432\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a. Kind \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.curl -Lo .\/kind https:\/\/github.com\/kubernetes-sigs\/kind\/releases\/latest\/download\/kind-linux-amd64chmod +x .\/kindsudo mv .\/kind \/usr\/local\/bin\/kindkind versioncurl -LO &#171;https:\/\/dl.k8s.io\/release\/$(curl -L -s https:\/\/dl.k8s.io\/release\/stable.txt)\/bin\/linux\/amd64\/kubectl&#187;chmod +x kubectlsudo mv kubectl \/usr\/local\/bin\/kubectlkubectl version &#8212;client\u0433\u0440\u0430\u0431\u043b\u0438 \u21161. \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u044f\u0434\u0440\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0411\u0438\u043d\u0430\u0440\u0438 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u043d\u043e \u043f\u0435\u0440\u0435\u0434 kind create \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c 10 \u0441\u0435\u043a \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u044f\u0434\u0440\u0430. Cilium \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 eBPF (\u0447\u0442\u043e \u044d\u0442\u043e \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043c \u0434\u0430\u043b\u0435\u0435), \u0430 eBPF \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u044f\u0434\u0440\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043b\u044f \u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438.uname -r\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435 4.x \u0441\u043c\u0435\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0434\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435.ls -la \/sys\/kernel\/btf\/vmlinuxmount | grep bpf-r&#8212;r&#8212;r&#8212; 1 root root 6050732 Jun  9 11:17 \/sys\/kernel\/btf\/vmlinux\u0424\u0430\u0439\u043b BPF \u043d\u0430 \u043c\u0435\u0441\u0442\u0435(\u044d\u0442\u043e \u0442\u0438\u043f\u043e\u0432\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u044f\u0434\u0440\u0430, \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f CO-RE). \u0410 \u0432\u043e\u0442 bpffs \u0443 \u043c\u0435\u043d\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e, \u0442\u043a Cilium \u0441\u0430\u043c \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442 bpffs \u0432\u043d\u0443\u0442\u0440\u0438 kind \u043d\u043e\u0434 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u043e \u0434\u043b\u044f \u0438\u0433\u0440 \u0441 bpftool \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432 fstab, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a WSL.sudo mount -t bpf bpf \/sys\/fs\/bpfecho &#8216;bpf \/sys\/fs\/bpf bpf defaults 0 0&#8217; | sudo tee -a \/etc\/fstab\u0421\u0430\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0441 \u0442\u0440\u0435\u043c\u044f \u043d\u043e\u0434\u0430\u043c\u0438 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c CNI:# kind-cluster.yamlkind: ClusterapiVersion: kind.x-k8s.io\/v1alpha4nodes:  &#8212; role: control-plane  &#8212; role: worker  &#8212; role: workernetworking:  disableDefaultCNI: truekind create cluster &#8212;name lab &#8212;config kind-cluster.yamlkubectl get nodes\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 NotReady &#8212; \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0442\u043a \u043f\u043e\u043a\u0430 CNI \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Cilium CNI\u0433\u0440\u0430\u0431\u043b\u0438 \u21162. zsh \u0441\u044a\u0435\u0434\u0430\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438\ud83d\ude44\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 zsh \u0441 oh-my-zsh, \u0442\u043e \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 url-quote-magic \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u00ab\u043e\u043f\u0430\u0441\u043d\u044b\u0435\u00bb \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \\{. \u041d\u0430 \u0432\u0440\u0435\u043c\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b DISABLE_MAGIC_FUNCTIONS=true \u0432 ~\/.zshrc, \u043c\u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u0435\u0435 \ud83e\udd37.\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 CiliumCILIUM_CLI_VERSION=$(curl -s https:\/\/raw.githubusercontent.com\/cilium\/cilium-cli\/main\/stable.txt)echo &#171;$CILIUM_CLI_VERSION&#187;   # \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u043e curl -L &#8212;fail -O https:\/\/github.com\/cilium\/cilium-cli\/releases\/download\/$CILIUM_CLI_VERSION\/cilium-linux-amd64.tar.gzcurl -L &#8212;fail -O https:\/\/github.com\/cilium\/cilium-cli\/releases\/download\/$CILIUM_CLI_VERSION\/cilium-linux-amd64.tar.gz.sha256sumsha256sum &#8212;check cilium-linux-amd64.tar.gz.sha256sumsudo tar xzvfC cilium-linux-amd64.tar.gz \/usr\/local\/binrm cilium-linux-amd64.tar.gz cilium-linux-amd64.tar.gz.sha256sumCLI \u0441\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 kind \u0438 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u043f\u0446\u0438\u0438cilium installcilium status &#8212;waitcilium hubble enable\u0427\u0435\u0440\u0435\u0437 2-3 \u043c\u0438\u043d\u0443\u0442\u044b \u0432\u0438\u0434\u0438\u043c \u0437\u0430\u0432\u0435\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:    \/\u00af\u00af\\ \/\u00af\u00af\\__\/\u00af\u00af\\    Cilium:             OK \\__\/\u00af\u00af\\__\/    Operator:           OK \/\u00af\u00af\\__\/\u00af\u00af\\    Envoy DaemonSet:    OK \\__\/\u00af\u00af\\__\/    Hubble Relay:       OK    \\__\/       ClusterMesh:        disabledDaemonSet              cilium                   Desired: 3, Ready: 3\/3, Available: 3\/3&#8230;Cluster Pods:          4\/4 managed by CiliumHelm chart version:    1.19.3\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u0441\u0435 \u043d\u043e\u0434\u044b \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 CNI \u043e\u043d\u0438 \u0432\u0441\u0435 Ready.kubectl get nodes -o wideNAME                STATUS   ROLES           AGE   VERSION   INTERNAL-IP   &#8230;lab-control-plane   Ready    control-plane   13m   v1.36.1   172.21.0.3lab-worker          Ready    &lt;none&gt;          13m   v1.36.1   172.21.0.4lab-worker2         Ready    &lt;none&gt;          13m   v1.36.1   172.21.0.2\u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 INTERNAL-IP \u0443\u0437\u043b\u043e\u0432 172.21.0.x. \u042d\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430 kind-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043c\u044b \u0435\u0449\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0445 \u0432 \u0440\u043e\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.\u0412\u0430\u0436\u043d\u043e! \u041c\u044b \u0431\u0435\u0440\u0435\u043c Cilium \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f kube-proxy. Cilium \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f CNI, NetworkPolicies \u0438 Observability, \u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 Service \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 kube-proxy \u0447\u0435\u0440\u0435\u0437 iptables. \u041f\u043e\u043b\u043d\u044b\u0439 \u0440\u0435\u043f\u043b\u0435\u0439\u0441\u043c\u0435\u043d\u0442 kube-proxy &#8212; \u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (\u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0435\u0441\u043b\u0438 \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e).\u041f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0435\u0421\u0442\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u043f\u043e\u0434\u0430 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 worker \u043d\u043e\u0434\u044b. \u0421\u0442\u0430\u0432\u0438\u043c image: netshoot \u2014 \u043d\u0430\u0448 \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0439 \u043d\u043e\u0436 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435.# trace-pods.yamlapiVersion: v1kind: Podmetadata: { name: pod-a, labels: { app: trace } }spec:  nodeName: lab-worker  containers: [{ name: net, image: nicolaka\/netshoot, command: [&#171;sleep&#187;,&#187;infinity&#187;] }]&#8212;apiVersion: v1kind: Podmetadata: { name: pod-b, labels: { app: trace } }spec:  nodeName: lab-worker2  containers: [{ name: net, image: nicolaka\/netshoot, command: [&#171;sleep&#187;,&#187;infinity&#187;] }]kubectl apply -f trace-pods.yamlkubectl get pods -o wide\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0431\u0440\u0438\u0434\u0436 \u0438 eBPF-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\u0412\u0437\u0433\u043b\u044f\u0434 \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043f\u043e\u0434\u0430kubectl exec pod-a &#8212; ip -d addr show eth0kubectl exec pod-a &#8212; cat \/sys\/class\/net\/eth0\/iflink\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c eth0@if15 (\u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 15). \u042d\u0442\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u044f\u0434\u0440\u0430: \u044f veth, \u0430 \u043c\u043e\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0435\u0446 \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 15 \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u043c \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441\u0435. Iflink \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u0436\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0437\u0430 \u043a\u0430\u043a\u0443\u044e \u043d\u0438\u0442\u043a\u0443 \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.\u0412\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0431\u0440\u0438\u0434\u0436\u00ab\u0425\u043e\u0441\u0442\u00bb \u0434\u043b\u044f \u043f\u043e\u0434\u0430\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u0432\u0430\u0448 WSL-\u0448\u0435\u043b\u043b, \u0430\u00a0kind \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043d\u043e\u0434\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443:docker exec -it lab-worker bash# \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u043e\u0434\u044b (\u043f\u043e\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0439 ifindex):ip link | grep &#8216;^15:&#8217;\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 15: lxc4f2a1b3c@if12. \u042d\u0442\u043e \u0442\u0430\u043a Cilium \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0445\u043e\u0441\u0442\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u044b veth. \u0410\u00a0\u0442\u0435\u043f\u0435\u0440\u044c \u0441\u044e\u0440\u043f\u0440\u0438\u0437: \u0432\u00a0\u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 CNI (flannel, kindset \u0438\u00a0\u0442\u043f) \u0432\u0441\u0435 veth-\u043a\u043e\u043d\u0446\u044b \u00ab\u0432\u043e\u0442\u043a\u043d\u0443\u0442\u044b\u00bb \u0432\u00a0\u0431\u0440\u0438\u0434\u0436 cni0 (\u044d\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 L2-\u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440 \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0437\u043b\u0430, \u043e\u043d\u00a0\u043a\u043e\u043c\u043c\u0443\u0442\u0438\u0440\u0443\u0435\u0442 \u043a\u0430\u0434\u0440\u044b \u043c\u0435\u0436\u0434\u0443 \u0445\u043e\u0441\u0442\u0430\u043c\u0438, \u0430\u00a0\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e \u0438\u00a0NAT \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 iptables). \u0422\u0430\u043a \u0432\u043e\u0442 \u0443\u00a0\u043d\u0430\u0441 \u0442\u043e\u00a0\u044d\u0442\u043e\u0433\u043e \u0431\u0440\u0438\u0434\u0436\u0430 \u043d\u0435\u0442 \u0438\u00a0iptables \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0442\u00a0\u0441\u043b\u043e\u0432\u0430 \u0441\u043e\u0432\u0441\u0435\u043c:ip link show type bridge# \u043f\u0443\u0441\u0442\u043e\u0412\u043c\u0435\u0441\u0442\u043e \u0431\u0440\u0438\u0434\u0436\u0430:ip -br link\u2026 \u0443 \u043d\u0430\u0441 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 Cilium cilium_host\u0438 cilium_net (\u043d\u0430\u0448\u0430 veth-\u043f\u0430\u0440\u0430), cilium-vxlan(\u043e \u043d\u0435\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435), lxc_health \u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 lxc* \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434. \u0418 \u043a\u0442\u043e \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0433\u043e\u043d\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u044b? eBPF-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u2014 \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u044f\u0434\u0440\u0435, \u0431\u0435\u0437 \u0431\u0440\u0438\u0434\u0436\u0430, \u0431\u0435\u0437 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u043e\u0431\u0445\u043e\u0434\u0430 \u0446\u0435\u043f\u043e\u0447\u0435\u043a iptables.\u041a\u0440\u0430\u0442\u043a\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 eBPF, \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u044f\u0441\u044c \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438:\u041f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 identity \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 egress-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 (\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c -&gt; \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c &#8212; allow\/deny)\u0412\u0435\u0434\u0435\u0442 conntrack\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a\u0414\u0430\u0442\u0430\u043f\u043b\u0435\u0439\u043d &#8212; \u044d\u0442\u043e \u043c\u0430\u043f\u044b\u0420\u0430\u0437 \u0444\u043e\u0440\u0432\u0430\u0440\u0434\u0438\u043d\u0433\u043e\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f eBPF, \u0433\u0434\u0435 \u0436\u0435 \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435? \u0412 eBPF-\u043c\u0430\u043f\u0430\u0445, \u0442\u0435 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0432 \u044f\u0434\u0440\u0435. Cilium-\u0430\u0433\u0435\u043d\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u0435 \u0443\u043c\u0435\u0435\u0442 \u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c:CILIUM_POD=$(kubectl -n kube-system get pods -l k8s-app=cilium &#8212;field-selector spec.nodeName=lab-worker -o name | head -1) kubectl -n kube-system exec $CILIUM_POD -c cilium-agent &#8212; cilium-dbg endpoint listkubectl -n kube-system exec $CILIUM_POD -c cilium-agent &#8212; cilium-dbg bpf ipcache listkubectl -n kube-system exec $CILIUM_POD -c cilium-agent &#8212; cilium-dbg bpf lb listexndpoint list \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434 \u043a\u0430\u043a eBPF \u044d\u043d\u043f\u043e\u0438\u043d\u0442 \u0441\u043e \u0441\u0432\u043e\u0438\u043c identiry;bpf ipcache list \u2014 \u043c\u0430\u043f\u0430 IP-\u043f\u043e\u0434\u0432 -&gt; (IP-\u043d\u043e\u0434\u044b, identity). \u0422\u0443\u0442 eBPF \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u0435\u043c\u0443 \u0435\u0445\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043d\u043e\u0434\u0443 \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e;bpf lb list \u2014 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 Services \u043a\u0430\u043a lookup \u043f\u043e \u0445\u0435\u0448-\u043c\u0430\u043f\u0435. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430 \u043f\u0443\u0441\u0442\u0430\u044f, \u0442\u043a \u044d\u0442\u0438\u043c \u043f\u043e\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f kube-proxy.\u0427\u0442\u043e \u043c\u044b \u0434\u043e\u043a\u0430\u0437\u0430\u043b\u0438: \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0442\u0438 \u0432 Cilium \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 iptables, \u0430 \u043c\u0430\u043f\u0438\u043d\u0433\u0438 \u044f\u0434\u0440\u0430. \u0421\u0430\u043c\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u043b\u044e\u0441 Cilium \u201c\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432\u201d \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.\u041c\u0435\u0436\u043d\u043e\u0434\u043e\u0432\u044b\u0439 \u0445\u043e\u043f &#8212; VXLAN\u041a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u0441 pod-IP (10.244.x.x) \u0435\u0434\u0435\u0442 \u043f\u043e \u0441\u0435\u0442\u0438 \u0434\u043e\u043a\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u043d\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 172.21.0.x? \u041e\u0442\u0432\u0435\u0442:kubectl -n kube-system exec $CILIUM_POD -c cilium-agent &#8212; cilium-dbg status | grep -i routingRouting:    Network: Tunnel [vxlan]   &#8230;\u042d\u0442\u043e \u0440\u0435\u0436\u0438\u043c VXLAN-\u043e\u0432\u0435\u0440\u043b\u0435\u0439. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 (10.244.1.x -&gt; 10.244.2.x) \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 UDP-\u0434\u0430\u0442\u0430\u0433\u0440\u0430\u043c\u0443, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0443\u0437\u043b\u043e\u0432 (172.21.0.4 -&gt; 172.21.0.2). \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 \u0432\u0435\u0437\u0435\u0442 \u00ab\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u00bb \u0438 \u043d\u0435 \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u044c. \u0422\u0443\u0434\u0430 \u0436\u0435 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f identity \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u043b \u0435\u0435 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437. \u041d\u0430 \u0442\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 cilium_vxlan \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 eBPF, \u0430 \u0442\u043e\u0442 \u0432 veth \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0430. \u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0443\u0442\u044c \u043d\u0438\u0436\u0435:pod-a eth0  \u2192 lxc* (eBPF: identity, policy, routing)      lab-worker1  \u2192 cilium_vxlan (\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f)  \u2192 eth0 \u043d\u043e\u0434\u044b 172.21.0.4  \u2500\u2500\u2500\u2500\u2500\u2500 \u043f\u0440\u043e\u0432\u043e\u0434 (docker network) \u2500\u2500\u2500\u2500\u2500\u2500  \u2192 eth0 \u043d\u043e\u0434\u044b 172.21.0.2&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-491819","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/491819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=491819"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/491819\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=491819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=491819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=491819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}