{"id":288666,"date":"2018-08-29T11:35:02","date_gmt":"2018-08-29T07:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=288666"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=288666","title":{"rendered":"\u0417\u0430 \u043a\u0443\u043b\u0438\u0441\u0430\u043c\u0438 \u0441\u0435\u0442\u0438 \u0432 Kubernetes"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/flant\/blog\/420813\/\" class=\"post__text post__text-html js-mediator-article\"><i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u0410\u0432\u0442\u043e\u0440 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 Nicolas Leiva \u2014 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 Cisco, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438, \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c\u0438, \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u0435\u0442\u044c Kubernetes \u0438\u0437\u043d\u0443\u0442\u0440\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u0435\u0451 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0437\u0434\u0440\u0430\u0432\u044b\u0439 \u0441\u043c\u044b\u0441\u043b, \u0441\u0432\u043e\u0438 \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0441\u0435\u0442\u044f\u0445 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b Linux\/Kubernetes. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0431\u044a\u0451\u043c\u043d\u043e, \u0437\u0430\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gr\/qw\/d4\/grqwd4putslwaijltw9yojfzjes.png\"><\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430, \u0447\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\">Kubernetes The Hard Way<\/a> \u043e\u0442 Kelsey Hightower \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (<a href=\"https:\/\/github.com\/nleiva\/kubernetes-the-hard-way\">\u0434\u0430\u0436\u0435 \u043d\u0430 AWS!<\/a>), \u043c\u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0435\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0447\u0438\u0441\u0442\u043e\u0442\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435; \u0438 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0432\u0430 \u0440\u043e\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Container Network Interface (<a href=\"https:\/\/github.com\/containernetworking\/cni\/blob\/master\/SPEC.md\">CNI<\/a>). \u0421\u043a\u0430\u0437\u0430\u0432 \u044d\u0442\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044e, \u0447\u0442\u043e \u0441\u0435\u0442\u044c Kubernetes \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c-\u0442\u043e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432\u2026 \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u00ab\u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u0449\u0438, \u043a\u0430\u043a \u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, <a href=\"https:\/\/www.youtube.com\/watch?v=t98CX8Tberc\">\u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442<\/a>\u00bb.<a name=\"habracut\"><\/a><\/p>\n<p>  \u0425\u043e\u0442\u044f \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 (\u0441\u043c. \u0441\u0441\u044b\u043b\u043a\u0438 <a href=\"https:\/\/github.com\/nleiva\/kubernetes-networking-links\">\u0437\u0434\u0435\u0441\u044c<\/a>), \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b \u0431\u044b \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0441 \u0432\u044b\u0432\u043e\u0434\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a \u043b\u044e\u0431\u044f\u0442 \u0438 \u043d\u0435\u043d\u0430\u0432\u0438\u0434\u044f\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044f, \u0447\u0442\u043e \u0436\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043a\u0443\u043b\u0438\u0441\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438 \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u2014 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438 \u0432\u0430\u043c \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0432\u0441\u0451 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u042d\u0442\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u0432\u0430\u0436\u043d\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0435\u0431\u044f, \u043d\u043e \u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0432 \u0441\u0432\u043e\u0451\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0438\u0437 <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\">Kubernetes The Hard Way<\/a>: \u0432\u0441\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0437\u044f\u0442\u044b \u043e\u0442\u0442\u0443\u0434\u0430 (\u043f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u043d\u0430 \u043c\u0430\u0439 2018 \u0433\u043e\u0434\u0430, \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/nabla-containers.github.io\/\">\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 Nabla<\/a>).<\/p>\n<p>  \u0410 \u043d\u0430\u0447\u043d\u0451\u043c \u043c\u044b \u0441 \u043a\u043e\u043d\u0446\u0430, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0442\u0440\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0443\u0437\u043b\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/am\/vs\/6j\/amvs6jnhsuxzwhyoyod6vjk8cby.png\"><\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0438 \u0447\u0430\u0441\u0442\u043d\u044b\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0438! \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0440\u043f\u0435\u043d\u0438\u044f, \u0438 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e, \u0445\u043e\u0442\u044c \u043c\u044b \u0438 \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 IP-\u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b, \u043e\u043d\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u0432\u0437\u044f\u0442\u044b \u0438\u0437 <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\">Kubernetes The Hard Way<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u043c\u0435\u044e\u0442 \u043b\u0438\u0448\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c, \u0430 \u0432\u044b \u0432\u043e\u043b\u044c\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u043b\u043e\u043a \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 <a href=\"https:\/\/tools.ietf.org\/html\/rfc1918\">RFC 1918<\/a>. \u0414\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f \u0441 IPv6 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0432 \u0431\u043b\u043e\u0433\u0435.<\/p>\n<h2>\u0421\u0435\u0442\u044c \u0443\u0437\u043b\u0430 (10.240.0.0\/24)<\/h2>\n<p>  \u042d\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0441\u0435\u0442\u044c, \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0443\u0437\u043b\u044b. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433\u043e\u043c <code>--private-network-ip<\/code> \u0432 <a href=\"https:\/\/cloud.google.com\/sdk\/gcloud\/reference\/compute\/instances\/create\">GCP<\/a> \u0438\u043b\u0438 \u043e\u043f\u0446\u0438\u0435\u0439 <code>--private-ip-address<\/code> \u0432 <a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/ec2\/run-instances.html\">AWS<\/a> \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<h3>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u0437\u043b\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 GCP<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">for i in 0 1 2; do   gcloud compute instances create controller-${i} \\     # ...     --private-network-ip 10.240.0.1${i} \\     # ... done<\/code><\/pre>\n<p>  (<a href=\"https:\/\/gist.github.com\/nleiva\/6fa403a643b665c0bb36f4dc9744ba1e#file-controllers_gcp-sh\"><code>controllers_gcp.sh<\/code><\/a>)<\/p>\n<h3>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u0437\u043b\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 AWS<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">for i in 0 1 2; do   declare controller_id${i}=`aws ec2 run-instances \\     # ...     --private-ip-address 10.240.0.1${i} \\     # ... done<\/code><\/pre>\n<p>  (<a href=\"https:\/\/gist.github.com\/nleiva\/4a57c206899659c10348fdf14e84e07d#file-controllers_aws-sh\"><code>controllers_aws.sh<\/code><\/a>)<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gt\/cj\/p6\/gtcjp6fgkqbv1nvs2ea9d9hhueo.png\"><\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u0432\u0430 IP-\u0430\u0434\u0440\u0435\u0441\u0430: \u0447\u0430\u0441\u0442\u043d\u044b\u0439 \u043e\u0442 \u0441\u0435\u0442\u0438 \u0443\u0437\u043b\u0430 (\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u2014 <code>10.240.0.1${i}\/24<\/code>, \u0432\u043e\u0440\u043a\u0435\u0440\u044b \u2014 <code>10.240.0.2${i}\/24<\/code>) \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439, \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u043c, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u043f\u043e\u0437\u0436\u0435, \u043a\u0430\u043a \u0434\u043e\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0434\u043e <code>NodePorts<\/code>.<\/p>\n<h3>GCP<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">$ gcloud compute instances list  NAME          ZONE        MACHINE_TYPE   PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP     STATUS controller-0  us-west1-c  n1-standard-1               10.240.0.10  35.231.XXX.XXX  RUNNING worker-1      us-west1-c  n1-standard-1               10.240.0.21  35.231.XX.XXX   RUNNING ...<\/code><\/pre>\n<h3>AWS<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">$ aws ec2 describe-instances --query 'Reservations[].Instances[].[Tags[?Key==`Name`].Value[],PrivateIpAddress,PublicIpAddress]' --output text | sed '$!N;s\/\\n\/ \/' 10.240.0.10    34.228.XX.XXX controller-0 10.240.0.21    34.173.XXX.XX worker-1 ...<\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0443\u0437\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u0438\u043d\u0433\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430, \u0435\u0441\u043b\u0438 <a href=\"https:\/\/github.com\/nleiva\/kubernetes-the-hard-way\/blob\/master\/docs\/03-compute-resources.md#firewall-rules\">\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u043d\u044b<\/a> (\u0438 \u0435\u0441\u043b\u0438 <code>ping<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u0445\u043e\u0441\u0442).<\/p>\n<h2>\u0421\u0435\u0442\u044c \u043f\u043e\u0434\u043e\u0432 (10.200.0.0\/16)<\/h2>\n<p>  \u042d\u0442\u043e \u0441\u0435\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0436\u0438\u0432\u0443\u0442 \u043f\u043e\u0434\u044b. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0443\u0437\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u044d\u0442\u043e\u0439 \u0441\u0435\u0442\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 <code>POD_CIDR=10.200.${i}.0\/24<\/code> \u0434\u043b\u044f <code>worker-${i}<\/code>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6i\/yz\/ih\/6iyzihbxbzwugs4amvhfa9ysp5s.png\"><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0432\u0441\u0451 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0448\u0430\u0433 \u043d\u0430\u0437\u0430\u0434 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/cluster-administration\/networking\/#kubernetes-model\">\u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c Kubernetes<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e:<\/p>\n<ul>\n<li> \u0412\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f NAT.<\/li>\n<li> \u0412\u0441\u0435 \u0443\u0437\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 (\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442) \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f NAT.<\/li>\n<li> IP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0434\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0435\u0433\u043e \u0432\u0438\u0434\u044f\u0442 \u0434\u0440\u0443\u0433\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u0438 Kubernetes \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 <a href=\"https:\/\/github.com\/containernetworking\/cni\/blob\/master\/SPEC.md#overview-1\">\u043f\u043b\u0430\u0433\u0438\u043d\u0443 CNI<\/a>. <\/p>\n<blockquote><p>\u00ab\u041f\u043b\u0430\u0433\u0438\u043d CNI \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432 <b>\u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d<\/b> \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0435\u0446 <b>veth-\u043f\u0430\u0440\u044b<\/b>) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0446\u0430 veth \u043a \u043c\u043e\u0441\u0442\u0443). \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c IP \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u00abIP Address Management\u00bb \u043f\u0443\u0442\u0451\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 IPAM\u00bb. <i>(\u0438\u0437 <a href=\"https:\/\/github.com\/containernetworking\/cni\/blob\/master\/SPEC.md#cni-plugin\">Container Network Interface Specification<\/a>)<\/i><\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5q\/fs\/vw\/5qfsvwg2iuduy0q3doco11hbf-g.png\"><\/p>\n<h3>\u0421\u0435\u0442\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d<\/h3>\n<p>  <\/p>\n<blockquote><p>\u00ab\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0438\u0434\u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0435 \u0432\u0438\u0434\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0432 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d, \u043d\u043e \u043d\u0435 \u0432\u0438\u0434\u043d\u044b \u0438\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u00bb. <i>(<a href=\"http:\/\/man7.org\/linux\/man-pages\/man7\/namespaces.7.html\">\u0438\u0437 man-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b namespaces<\/a>)<\/i><\/p><\/blockquote>\n<p>  Linux \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u043c\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0451\u043d (<code>Cgroup<\/code>, <code>IPC<\/code>, <code>Network<\/code>, <code>Mount<\/code>, <code>PID<\/code>, <code>User<\/code>, <code>UTS<\/code>). \u0421\u0435\u0442\u0435\u0432\u044b\u0435 (<code>Network<\/code>) \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d (<code>CLONE_NEWNET<\/code>) \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443: \u00ab\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, IP-\u0430\u0434\u0440\u0435\u0441\u0430, \u0442\u0430\u0431\u043b\u0438\u0446\u044b IP-\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <code>\/proc\/net<\/code>, \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e\u0440\u0442\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435\u00bb <i>(\u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u00ab<a href=\"https:\/\/lwn.net\/Articles\/531114\/\">Namespaces in operation<\/a>\u00bb)<\/i>.<\/p>\n<h3>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 Ethernet-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 (Veth)<\/h3>\n<p>  <\/p>\n<blockquote><p>\u00ab\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043f\u0430\u0440\u0430 (veth) \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0432 \u0432\u0438\u0434\u0435 \u201e\u0442\u0440\u0443\u0431\u044b\u201c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u043c\u0438 \u0438\u043c\u0451\u043d \u0438\u043b\u0438 \u0436\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0441\u0442\u0430 \u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0441\u0435\u0442\u0435\u0432\u043e\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 \u0432 \u0438\u043d\u043e\u043c \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043d\u0451\u043c veth-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u044e\u0442\u0441\u044f\u00bb. <i>(\u0438\u0437 <a href=\"http:\/\/man7.org\/linux\/man-pages\/man7\/network_namespaces.7.html\">man-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b network namespaces<\/a>)<\/i><\/p><\/blockquote>\n<p>  \u0421\u043f\u0443\u0441\u0442\u0438\u043c\u0441\u044f \u043d\u0430 \u0437\u0435\u043c\u043b\u044e \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u0441\u0451 \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/extend-kubernetes\/compute-storage-net\/network-plugins\/\">\u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b<\/a> \u0432 Kubernetes \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b, \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b CNI \u2014 \u043e\u0434\u043d\u0438 \u0438\u0437 \u043d\u0438\u0445 (<a href=\"https:\/\/kubernetes.io\/blog\/2016\/01\/why-kubernetes-doesnt-use-libnetwork\/\">\u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 CNM?<\/a>). <a href=\"https:\/\/kubernetes.io\/docs\/reference\/command-line-tools-reference\/kubelet\/#kubelet\">Kubelet<\/a> \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u043a\u0430\u043a\u043e\u0439 <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/extend-kubernetes\/compute-storage-net\/network-plugins\/\">\u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. Container Network Interface (<a href=\"https:\/\/github.com\/containernetworking\/cni\/blob\/master\/SPEC.md\">CNI<\/a>) \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0410 \u0443\u0436\u0435 \u043f\u043b\u0430\u0433\u0438\u043d CNI \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0441\u0435\u0442\u044c.<\/p>\n<blockquote><p>\u00ab\u041f\u043b\u0430\u0433\u0438\u043d CNI \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u043e\u043f\u0446\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <code>--network-plugin=cni<\/code> \u0432 Kubelet. Kubelet \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0438\u0437 <code>--cni-conf-dir<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e <code>\/etc\/cni\/net.d<\/code>) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e CNI \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0434\u0430\u00bb. <i>(\u0438\u0437 <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/extend-kubernetes\/compute-storage-net\/network-plugins\/#network-plugin-requirements\">Network Plugin Requirements<\/a>)<\/i><\/p><\/blockquote>\n<p>  \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 CNI \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 <code>--\u200acni-bin-dir<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e <code>\/opt\/cni\/bin<\/code>).<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u0430 <a href=\"https:\/\/github.com\/nleiva\/kubernetes-the-hard-way\/blob\/master\/docs\/09-bootstrapping-kubernetes-workers.md#configure-the-kubelet\"><code>kubelet.service<\/code><\/a> \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u044f <code>--network-plugin=cni<\/code>:<\/p>\n<pre><code>[Service] ExecStart=\/usr\/local\/bin\/kubelet \\\\   --config=\/var\/lib\/kubelet\/kubelet-config.yaml \\\\   --network-plugin=cni \\\\   ...<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c Kubernetes \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0430, \u0435\u0449\u0451 \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u042d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>pause<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u00ab\u0441\u043b\u0443\u0436\u0438\u0442 \u201e\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c\u201c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043f\u043e\u0434\u0430\u00bb <i>(\u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u00ab<a href=\"https:\/\/www.ianlewis.org\/en\/almighty-pause-container\">The Almighty Pause Container<\/a>\u00bb)<\/i>. \u0417\u0430\u0442\u0435\u043c Kubernetes \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d CNI \u0434\u043b\u044f \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>pause<\/code> \u043a \u0441\u0435\u0442\u0438. \u0412\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d (<code>netns<\/code>) \u044d\u0442\u043e\u0433\u043e <code>pause<\/code>-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<pre><code>{     \"cniVersion\": \"0.3.1\",     \"name\": \"bridge\",     \"type\": \"bridge\",     \"bridge\": \"cnio0\",     \"isGateway\": true,     \"ipMasq\": true,     \"ipam\": {         \"type\": \"host-local\",         \"ranges\": [           [{\"subnet\": \"${POD_CIDR}\"}]         ],         \"routes\": [{\"dst\": \"0.0.0.0\/0\"}]     } }<\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 <a href=\"https:\/\/github.com\/nleiva\/kubernetes-the-hard-way\/blob\/master\/docs\/09-bootstrapping-kubernetes-workers.md#configure-cni-networking\">\u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f CNI<\/a> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 <code>bridge<\/code> \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0441\u0442\u0430 Linux (L2) \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>cnio0<\/code> (<a href=\"https:\/\/github.com\/containernetworking\/plugins\/blob\/v0.6.0\/plugins\/main\/bridge\/bridge.go#L38\">\u0438\u043c\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/a> \u2014 <code>cni0<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0440\u043e\u043b\u0438 \u0448\u043b\u044e\u0437\u0430 (<code>\"isGateway\": true<\/code>).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bo\/to\/jp\/botojpqu0f7fascfrbk-gen27a8.png\"><\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 veth-\u043f\u0430\u0440\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0430 \u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u0441\u0442\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-6\/tt\/e7\/-6tte7essirvuraiuypuln_syvm.png\"><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f L3-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a IP-\u0430\u0434\u0440\u0435\u0441\u0430, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/containernetworking\/plugins\/tree\/master\/plugins\/ipam\">\u043f\u043b\u0430\u0433\u0438\u043d IPAM<\/a> (<code>ipam<\/code>). \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0438\u043f <code>host-local<\/code>, \u00ab\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0445\u043e\u0441\u0442\u0430, \u0447\u0435\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435\u00bb <i>(\u0438\u0437 <a href=\"https:\/\/github.com\/containernetworking\/plugins\/tree\/master\/plugins\/ipam\/host-local#overview\"><code>\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f host-local<\/code><\/a>)<\/i>. \u041f\u043b\u0430\u0433\u0438\u043d IPAM \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0443 (<code>bridge<\/code>), \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0447\u0435\u043c\u0443 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432\u0441\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b (<code>\"routes\": [{\"dst\": \"0.0.0.0\/0\"}]<\/code>). \u0415\u0441\u043b\u0438 <code>gw<\/code> \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d, \u043e\u043d <a href=\"https:\/\/github.com\/containernetworking\/plugins\/blob\/v0.6.0\/pkg\/ipam\/ipam.go#L83-L89\">\u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438<\/a>. \u041c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u043e\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d \u043f\u043e\u0434\u043e\u0432, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u0430 \u043c\u043e\u0441\u0442 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0435\u0440\u0432\u044b\u0439 IP \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u043f\u043e\u0434\u0430).<\/p>\n<p>  \u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0430\u0436\u043d\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c: \u043c\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043c\u0430\u0441\u043a\u0430\u0440\u0430\u0434\u0438\u043d\u0433 (<code>\"ipMasq\": true<\/code>) \u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0438\u0437 \u0441\u0435\u0442\u0438 \u043f\u043e\u0434\u043e\u0432. \u0412 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043c \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d NAT, \u043d\u043e \u0442\u0430\u043a\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\">Kubernetes The Hard Way<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 <code>iptables<\/code> \u043f\u043b\u0430\u0433\u0438\u043d\u0430 <code>bridge<\/code> \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0412\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438\u0437 \u043f\u043e\u0434\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d <code>224.0.0.0\/4<\/code>, <a href=\"https:\/\/github.com\/containernetworking\/plugins\/blob\/v0.6.0\/pkg\/ip\/ipmasq.go#L26-L74\">\u0431\u0443\u0434\u0435\u0442 \u0437\u0430 NAT&#8217;\u043e\u043c<\/a>, \u0447\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e \u00ab\u0432\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f NAT\u00bb. \u0427\u0442\u043e \u0436, \u043c\u044b \u0435\u0449\u0451 \u0434\u043e\u043a\u0430\u0436\u0435\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 NAT \u043d\u0435 \u043d\u0443\u0436\u0435\u043d\u2026<\/p>\n<p>  <a href=\"https:\/\/twitter.com\/miekg\/status\/1011585886654550016\/photo\/1\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/s_\/tc\/yt\/s_tcytvzxt0om8lmzr7zq4ishna.png\"><\/a><\/p>\n<h3>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u0430<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u044b. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u0441\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f deployment&#8217;\u0430 <code>nginx<\/code> <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\/blob\/master\/docs\/13-smoke-test.md#deployments\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>lsns<\/code> \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 <code>-t<\/code> \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d (\u0442.\u0435. <code>net<\/code>):<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo lsns -t net         NS TYPE NPROCS   PID USER COMMAND 4026532089 net     113     1 root \/sbin\/init 4026532280 net       2  8046 root \/pause 4026532352 net       4 16455 root \/pause 4026532426 net       3 27255 root \/pause<\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0446\u0438\u0438 <code>-i<\/code> \u043a <code>ls<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 \u043d\u043e\u043c\u0435\u0440\u0430 inode:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ ls -1i \/var\/run\/netns 4026532352 cni-1d85bb0c-7c61-fd9f-2adc-f6e98f7a58af 4026532280 cni-7cec0838-f50c-416a-3b45-628a4237c55c 4026532426 cni-912bcc63-712d-1c84-89a7-9e10510808a0<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0451\u043d \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ip netns<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ ip netns cni-912bcc63-712d-1c84-89a7-9e10510808a0 (id: 2) cni-1d85bb0c-7c61-fd9f-2adc-f6e98f7a58af (id: 1) cni-7cec0838-f50c-416a-3b45-628a4237c55c (id: 0)<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 <code>cni-912bcc63\u2013712d-1c84\u201389a7\u20139e10510808a0<\/code> (<code>4026532426<\/code>), \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ls -l \/proc\/[1-9]*\/ns\/net | grep 4026532426  | cut -f3 -d\"\/\" | xargs ps -p   PID TTY      STAT   TIME COMMAND 27255 ?        Ss     0:00 \/pause 27331 ?        Ss     0:00 nginx: master process nginx -g daemon off; 27355 ?        S      0:00 nginx: worker process<\/code><\/pre>\n<p>  \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e <code>pause<\/code> \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0435 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 <code>nginx<\/code>. \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <code>pause<\/code> \u0434\u0435\u043b\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d <code>net<\/code> \u0438 <code>ipc<\/code> \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u043f\u043e\u0434\u0430. \u0417\u0430\u043f\u043e\u043c\u043d\u0438\u043c PID \u043e\u0442 <code>pause<\/code> \u2014 27255; \u043c\u044b \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0435\u043c\u0443.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0435 <code>kubectl<\/code>:<\/p>\n<pre><code class=\"bash\">$ kubectl get pods -o wide | grep nginx nginx-65899c769f-wxdx6   1\/1       Running   0          5d        10.200.0.4   worker-0<\/code><\/pre>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"bash\">$ kubectl describe pods nginx-65899c769f-wxdx6<\/code><\/pre>\n<p>  <\/p>\n<pre><code>Name:           nginx-65899c769f-wxdx6 Namespace:      default Node:           worker-0\/10.240.0.20 Start Time:     Thu, 05 Jul 2018 14:20:06 -0400 Labels:         pod-template-hash=2145573259                 run=nginx Annotations:    &lt;none&gt; Status:         Running IP:             10.200.0.4 Controlled By:  ReplicaSet\/nginx-65899c769f Containers:   nginx:     Container ID:   containerd:\/\/4c0bd2e2e5c0b17c637af83376879c38f2fb11852921b12413c54ba49d6983c7     Image:          nginx ...<\/code><\/pre>\n<p>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u0430 \u2014 <code>nginx-65899c769f-wxdx6<\/code> \u2014 \u0438 ID \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 (<code>nginx<\/code>), \u043d\u043e \u043f\u0440\u043e <code>pause<\/code> \u2014 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0438 \u0441\u043b\u043e\u0432\u0430. \u041a\u043e\u043f\u043d\u0451\u043c \u0433\u043b\u0443\u0431\u0436\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0443\u0437\u0435\u043b, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0432 <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\">Kubernetes The Hard Way<\/a> \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/www.docker.com\/\">Docker<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/containerd\/containerd\">containerd<\/a> \u2014 ctr <i>(\u0441\u043c. \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/414875\/\">\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f containerd \u0441 Kubernetes, \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0449\u0430\u044f Docker, \u0433\u043e\u0442\u043e\u0432\u0430 \u043a production<\/a>\u00bb \u2014 <b>\u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>)<\/i>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ctr namespaces ls NAME   LABELS k8s.io<\/code><\/pre>\n<p>  \u0417\u043d\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d containerd (<code>k8s.io<\/code>), \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c ID \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>nginx<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ctr -n k8s.io containers ls | grep nginx 4c0bd2e2e5c0b17c637af83376879c38f2fb11852921b12413c54ba49d6983c7    docker.io\/library\/nginx:latest                                 io.containerd.runtime.v1.linux<\/code><\/pre>\n<p>  \u2026 \u0438 <code>pause<\/code> \u0442\u043e\u0436\u0435:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ctr -n k8s.io containers ls | grep pause 0866803b612f2f55e7b6b83836bde09bd6530246239b7bde1e49c04c7038e43a    k8s.gcr.io\/pause:3.1                                           io.containerd.runtime.v1.linux 21640aea0210b320fd637c22ff93b7e21473178de0073b05de83f3b116fc8834    k8s.gcr.io\/pause:3.1                                           io.containerd.runtime.v1.linux d19b1b1c92f7cc90764d4f385e8935d121bca66ba8982bae65baff1bc2841da6    k8s.gcr.io\/pause:3.1                                           io.containerd.runtime.v1.linux<\/code><\/pre>\n<p>  ID \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>nginx<\/code>, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 <code>\u2026983c7<\/code>, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442 <code>kubectl<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043b\u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 <code>pause<\/code>-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u043e\u0434\u0443 <code>nginx<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ctr -n k8s.io task ls TASK                                                                PID      STATUS ... d19b1b1c92f7cc90764d4f385e8935d121bca66ba8982bae65baff1bc2841da6    27255    RUNNING 4c0bd2e2e5c0b17c637af83376879c38f2fb11852921b12413c54ba49d6983c7    27331    RUNNING<\/code><\/pre>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0441 PID 27331 \u0438 27355 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0432 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d <code>cni-912bcc63\u2013712d-1c84\u201389a7\u20139e10510808a0<\/code>?<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ctr -n k8s.io containers info d19b1b1c92f7cc90764d4f385e8935d121bca66ba8982bae65baff1bc2841da6 {     \"ID\": \"d19b1b1c92f7cc90764d4f385e8935d121bca66ba8982bae65baff1bc2841da6\",     \"Labels\": {         \"io.cri-containerd.kind\": \"sandbox\",         \"io.kubernetes.pod.name\": \"nginx-65899c769f-wxdx6\",         \"io.kubernetes.pod.namespace\": \"default\",         \"io.kubernetes.pod.uid\": \"0b35e956-8080-11e8-8aa9-0a12b8818382\",         \"pod-template-hash\": \"2145573259\",         \"run\": \"nginx\"     },     \"Image\": \"k8s.gcr.io\/pause:3.1\", ...<\/code><\/pre>\n<p>  \u2026 \u0438:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ctr -n k8s.io containers info 4c0bd2e2e5c0b17c637af83376879c38f2fb11852921b12413c54ba49d6983c7 {     \"ID\": \"4c0bd2e2e5c0b17c637af83376879c38f2fb11852921b12413c54ba49d6983c7\",     \"Labels\": {         \"io.cri-containerd.kind\": \"container\",         \"io.kubernetes.container.name\": \"nginx\",         \"io.kubernetes.pod.name\": \"nginx-65899c769f-wxdx6\",         \"io.kubernetes.pod.namespace\": \"default\",         \"io.kubernetes.pod.uid\": \"0b35e956-8080-11e8-8aa9-0a12b8818382\"     },     \"Image\": \"docker.io\/library\/nginx:latest\", ...<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0435 (<code>nginx-65899c769f-wxdx6<\/code>) \u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d (<code>cni-912bcc63\u2013712d-1c84\u201389a7\u20139e10510808a0<\/code>):<\/p>\n<ul>\n<li> nginx (ID: <code>4c0bd2e2e5c0b17c637af83376879c38f2fb11852921b12413c54ba49d6983c7<\/code>);<\/li>\n<li> pause (ID: <code>d19b1b1c92f7cc90764d4f385e8935d121bca66ba8982bae65baff1bc2841da6<\/code>).<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3h\/cx\/qq\/3hcxqqv-mwlrm8ax9lu9jl0fixy.png\"><\/p>\n<p>  \u041a\u0430\u043a \u0436\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434 (<code>nginx-65899c769f-wxdx6<\/code>) \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043a \u0441\u0435\u0442\u0438? \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435 PID 27255 \u043e\u0442 <code>pause<\/code> \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u0435\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d (<code>cni-912bcc63\u2013712d-1c84\u201389a7\u20139e10510808a0<\/code>):<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ip netns identify 27255 cni-912bcc63-712d-1c84-89a7-9e10510808a0<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>nsenter<\/code> \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 <code>-t<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 PID, \u0438 <code>-n<\/code> \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 (27255). \u0412\u043e\u0442 \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442 <code>ip link show<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo nsenter -t 27255 -n ip link show 1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000     link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 3: eth0@if7: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP mode DEFAULT group default     link\/ether 0a:58:0a:c8:00:04 brd ff:ff:ff:ff:ff:ff link-netnsid 0<\/code><\/pre>\n<p>  \u2026 \u0438 <code>ifconfig eth0<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo nsenter -t 27255 -n ifconfig eth0 eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500         inet 10.200.0.4  netmask 255.255.255.0  broadcast 0.0.0.0         inet6 fe80::2097:51ff:fe39:ec21  prefixlen 64  scopeid 0x20&lt;link&gt;         ether 0a:58:0a:c8:00:04  txqueuelen 0  (Ethernet)         RX packets 540  bytes 42247 (42.2 KB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 177  bytes 16530 (16.5 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e IP-\u0430\u0434\u0440\u0435\u0441, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0447\u0435\u0440\u0435\u0437 <code>kubectl get pod<\/code>, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 <code>eth0<\/code> \u043f\u043e\u0434\u0430. \u042d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2014 \u0447\u0430\u0441\u0442\u044c <b>veth-\u043f\u0430\u0440\u044b<\/b>, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u043d\u0446\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u043f\u043e\u0434\u0435, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d. \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0446\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>ethtool<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ip netns exec cni-912bcc63-712d-1c84-89a7-9e10510808a0 ethtool -S eth0 NIC statistics:      peer_ifindex: 7<\/code><\/pre>\n<p>  \u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e <code>ifindex<\/code> \u043f\u0438\u0440\u0430 \u2014 7. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ip link<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ ip link | grep '^7:' 7: veth71f7d238@if3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue master cnio0 state UP mode DEFAULT group default<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo cat \/sys\/class\/net\/veth71f7d238\/ifindex 7<\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043b\u0438\u043d\u043a\u043e\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>brctl<\/code> \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0442\u043e \u0435\u0449\u0451 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043a Linux-\u043c\u043e\u0441\u0442\u0443:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ brctl show cnio0 bridge name    bridge id        STP enabled    interfaces cnio0        8000.0a580ac80001    no        veth71f7d238                                             veth73f35410                                             vethf273b35f<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yu\/gc\/t6\/yugct6efi7ztep277en4msjuzv4.png\"><\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p>  \u041a\u0430\u043a \u043c\u044b \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u043c \u0442\u0440\u0430\u0444\u0438\u043a? \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d \u043f\u043e\u0434\u0430:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo ip netns exec cni-912bcc63-712d-1c84-89a7-9e10510808a0 ip route show default via 10.200.0.1 dev eth0 10.200.0.0\/24 dev eth0 proto kernel scope link src 10.200.0.4<\/code><\/pre>\n<p>  \u041f\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u043c\u0435\u0440\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043a\u0430\u043a \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d (<code>default via 10.200.0.1<\/code>). \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0445\u043e\u0441\u0442\u0430:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ ip route list default via 10.240.0.1 dev eth0 proto dhcp src 10.240.0.20 metric 100 10.200.0.0\/24 dev cnio0 proto kernel scope link src 10.200.0.1 10.240.0.0\/24 dev eth0 proto kernel scope link src 10.240.0.20 10.240.0.1 dev eth0 proto dhcp scope link src 10.240.0.20 metric 100<\/code><\/pre>\n<p>  \u041c\u044b \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430 VPC Router (\u0443 VPC <a href=\"https:\/\/docs.aws.amazon.com\/AmazonVPC\/latest\/UserGuide\/VPC_Route_Tables.html#RouteTables\">\u0435\u0441\u0442\u044c<\/a> \u00ab\u0441\u043a\u0440\u044b\u0442\u044b\u0439\u00bb <i>[implicit]<\/i> \u0440\u043e\u0443\u0442\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <a href=\"https:\/\/cloud.google.com\/vpc\/docs\/vpc#reserved_ip_addresses_in_every_subnet\">\u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0434\u0440\u0435\u0441<\/a> \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043f\u043e\u0434\u0441\u0435\u0442\u0438). \u0422\u0435\u043f\u0435\u0440\u044c: \u0437\u043d\u0430\u0435\u0442 \u043b\u0438 VPC Router, \u043a\u0430\u043a \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0441\u0435\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0434\u0430? \u041d\u0435\u0442, \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c CNI \u0438\u043b\u0438 \u0436\u0435 <a href=\"https:\/\/github.com\/nleiva\/kubernetes-the-hard-way\/blob\/master\/docs\/11-pod-network-routes.md#routes\">\u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/a> (\u043a\u0430\u043a \u0432 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435). \u041f\u043e \u0432\u0441\u0435\u0439 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, <a href=\"https:\/\/github.com\/aws\/amazon-vpc-cni-k8s\">AWS CNI-plugin<\/a> \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441 \u0432 AWS. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0435\u0441\u0442\u044c <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/cluster-administration\/networking\/#how-to-implement-the-kubernetes-networking-model\">\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 CNI<\/a>, \u0430 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 <b>\u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/b>:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cn\/v7\/v_\/cnv7v_qjfkidbtuljkbgkuzuaag.png\"><\/p>\n<h3>\u0413\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 NAT<\/h3>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl create -f busybox.yaml<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <code>busybox<\/code> \u0441 Replication Controller:<\/p>\n<pre><code>apiVersion: v1 kind: ReplicationController metadata:   name: busybox0   labels:     app: busybox0 spec:   replicas: 2   selector:     app: busybox0   template:     metadata:       name: busybox0       labels:         app: busybox0     spec:       containers:       - image: busybox         command:           - sleep           - \"3600\"         imagePullPolicy: IfNotPresent         name: busybox restartPolicy: Always<\/code><\/pre>\n<p>  (<a href=\"https:\/\/gist.github.com\/nleiva\/ed5be3164df3429652566f26717ce22f#file-busybox-yaml\"><code>busybox.yaml<\/code><\/a>)<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code class=\"bash\">$ kubectl get pods -o wide NAME                     READY     STATUS        RESTARTS   AGE       IP            NODE busybox0-g6pww           1\/1       Running       0          4s        10.200.1.15   worker-1 busybox0-rw89s           1\/1       Running       0          4s        10.200.0.21   worker-0 ...<\/code><\/pre>\n<p>  \u041f\u0438\u043d\u0433\u0438 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c\u0438:<\/p>\n<pre><code class=\"bash\">$ kubectl exec -it busybox0-rw89s -- ping -c 2 10.200.1.15 PING 10.200.1.15 (10.200.1.15): 56 data bytes 64 bytes from 10.200.1.15: seq=0 ttl=62 time=0.528 ms 64 bytes from 10.200.1.15: seq=1 ttl=62 time=0.440 ms  --- 10.200.1.15 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min\/avg\/max = 0.440\/0.484\/0.528 ms<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>tcpdump<\/code> \u0438\u043b\u0438 <code>conntrack<\/code>:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo conntrack -L | grep 10.200.1.15 icmp     1 29 src=10.200.0.21 dst=10.200.1.15 type=8 code=0 id=1280 src=10.200.1.15 dst=10.240.0.20 type=0 code=0 id=1280 mark=0 use=1<\/code><\/pre>\n<p>  IP \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0441 \u043f\u043e\u0434\u0430 10.200.0.21 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 IP-\u0430\u0434\u0440\u0435\u0441 \u0443\u0437\u043b\u0430 10.240.0.20.<\/p>\n<pre><code class=\"bash\">ubuntu@worker-1:~$ sudo conntrack -L | grep 10.200.1.15 icmp     1 28 src=10.240.0.20 dst=10.200.1.15 type=8 code=0 id=1280 src=10.200.1.15 dst=10.240.0.20 type=0 code=0 id=1280 mark=0 use=1<\/code><\/pre>\n<p>  \u0412 iptables \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo iptables -t nat -Z POSTROUTING -L -v Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)  pkts bytes target     prot opt in     out     source               destination ...     5   324 CNI-be726a77f15ea47ff32947a3  all  --  any    any     10.200.0.0\/24        anywhere             \/* name: \"bridge\" id: \"631cab5de5565cc432a3beca0e2aece0cef9285482b11f3eb0b46c134e457854\" *\/ Zeroing chain `POSTROUTING'<\/code><\/pre>\n<p>  \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0435\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c <code>\"ipMasq\": true<\/code> \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 CNI, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 (\u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u2014 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435!):<\/p>\n<pre><code class=\"bash\">$ kubectl get pods -o wide NAME                     READY     STATUS        RESTARTS   AGE       IP            NODE busybox0-2btxn           1\/1       Running       0          16s       10.200.0.15   worker-0 busybox0-dhpx8           1\/1       Running       0          16s       10.200.1.13   worker-1 ...<\/code><\/pre>\n<p>  \u041f\u0438\u043d\u0433 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c:<\/p>\n<pre><code class=\"bash\">$  kubectl exec -it busybox0-2btxn -- ping -c 2 10.200.1.13 PING 10.200.1.6 (10.200.1.6): 56 data bytes 64 bytes from 10.200.1.6: seq=0 ttl=62 time=0.515 ms 64 bytes from 10.200.1.6: seq=1 ttl=62 time=0.427 ms  --- 10.200.1.6 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min\/avg\/max = 0.427\/0.471\/0.515 ms<\/code><\/pre>\n<p>  \u0418 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f NAT:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo conntrack -L | grep 10.200.1.13 icmp     1 29 src=10.200.0.15 dst=10.200.1.13 type=8 code=0 id=1792 src=10.200.1.13 dst=10.200.0.15 type=0 code=0 id=1792 mark=0 use=1<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438, \u0447\u0442\u043e \u00ab\u0432\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f NAT\u00bb.<\/p>\n<pre><code class=\"bash\">ubuntu@worker-1:~$ sudo conntrack -L | grep 10.200.1.13 icmp     1 27 src=10.200.0.15 dst=10.200.1.13 type=8 code=0 id=1792 src=10.200.1.13 dst=10.200.0.15 type=0 code=0 id=1792 mark=0 use=1<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0421\u0435\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 (10.32.0.0\/24)<\/h2>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 <code>busybox<\/code>, \u0447\u0442\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0430, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0430 <code>busybox<\/code>, \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0432? \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u0437\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u0434\u0430, \u043d\u043e \u043e\u043d\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 <code>Service<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443 \u043d\u0435\u0434\u043e\u043b\u0433\u043e\u0432\u0435\u0447\u043d\u044b\u0445 \u043f\u043e\u0434\u043e\u0432.<\/p>\n<blockquote><p>\u00abService \u0432 Kubernetes \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043e\u0432 \u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a \u043d\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f\u00bb. <i>(\u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/kubernetes.io\/docs\/tutorials\/kubernetes-basics\/expose\/expose-intro\/\">Kubernetes Services<\/a>)<\/i><\/p><\/blockquote>\n<p>  \u0415\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430; \u0442\u0438\u043f\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>ClusterIP<\/code>, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0449\u0438\u0439 IP-\u0430\u0434\u0440\u0435\u0441 \u0438\u0437 CIDR-\u0431\u043b\u043e\u043a\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 (\u0442.\u0435. \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430). \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f DNS Cluster Add-on, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 Kubernetes The Hard Way.<\/p>\n<pre><code># ... apiVersion: v1 kind: Service metadata:   name: kube-dns   namespace: kube-system   labels:     k8s-app: kube-dns     kubernetes.io\/cluster-service: \"true\"     addonmanager.kubernetes.io\/mode: Reconcile     kubernetes.io\/name: \"KubeDNS\" spec:   selector:     k8s-app: kube-dns   clusterIP: 10.32.0.10   ports:   - name: dns     port: 53     protocol: UDP   - name: dns-tcp     port: 53     protocol: TCP # ...<\/code><\/pre>\n<p>  (<a href=\"https:\/\/gist.github.com\/nleiva\/632e88a7639868dc6975624b95986821#file-kube-dns-yaml\"><code>kube-dns.yaml<\/code><\/a>)<\/p>\n<p>  <code>kubectl<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e <code>Service<\/code> \u043f\u043e\u043c\u043d\u0438\u0442 \u043e\u0431 endpoint&#8217;\u0430\u0445 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044e:<\/p>\n<pre><code class=\"bash\">$ kubectl -n kube-system describe services ... Selector:          k8s-app=kube-dns Type:              ClusterIP IP:                10.32.0.10 Port:              dns  53\/UDP TargetPort:        53\/UDP Endpoints:         10.200.0.27:53 Port:              dns-tcp  53\/TCP TargetPort:        53\/TCP Endpoints:         10.200.0.27:53 ...<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e?.. \u0421\u043d\u043e\u0432\u0430 <code>iptables<\/code>. \u041f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0418\u0445 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>iptables-save<\/code>.<\/p>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043a\u0435\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c (<code>OUTPUT<\/code>) \u0438\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 (<code>PREROUTING<\/code>), \u043e\u043d\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 <code>iptables<\/code>:<\/p>\n<pre><code class=\"bash\">-A PREROUTING -m comment --comment \"kubernetes service portals\" -j KUBE-SERVICES -A OUTPUT -m comment --comment \"kubernetes service portals\" -j KUBE-SERVICES<\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0446\u0435\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 TCP-\u043f\u0430\u043a\u0435\u0442\u0430\u043c, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430 53-\u0439 \u043f\u043e\u0440\u0442 \u0443 10.32.0.10, \u0438 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044e 10.200.0.27 \u0441 53-\u043c \u043f\u043e\u0440\u0442\u043e\u043c:<\/p>\n<pre><code class=\"bash\">-A KUBE-SERVICES -d 10.32.0.10\/32 -p tcp -m comment --comment \"kube-system\/kube-dns:dns-tcp cluster IP\" -m tcp --dport 53 -j KUBE-SVC-ERIFXISQEP7F7OF4 -A KUBE-SVC-ERIFXISQEP7F7OF4 -m comment --comment \"kube-system\/kube-dns:dns-tcp\" -j KUBE-SEP-32LPCMGYG6ODGN3H -A KUBE-SEP-32LPCMGYG6ODGN3H -p tcp -m comment --comment \"kube-system\/kube-dns:dns-tcp\" -m tcp -j DNAT --to-destination 10.200.0.27:53<\/code><\/pre>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f UDP-\u043f\u0430\u043a\u0435\u0442\u043e\u0432 (\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c 10.32.0.10:53 \u2192 10.200.0.27:53):<\/p>\n<pre><code class=\"bash\">-A KUBE-SERVICES -d 10.32.0.10\/32 -p udp -m comment --comment \"kube-system\/kube-dns:dns cluster IP\" -m udp --dport 53 -j KUBE-SVC-TCOU7JCQXEZGVUNU -A KUBE-SVC-TCOU7JCQXEZGVUNU -m comment --comment \"kube-system\/kube-dns:dns\" -j KUBE-SEP-LRUTK6XRXU43VLIG -A KUBE-SEP-LRUTK6XRXU43VLIG -p udp -m comment --comment \"kube-system\/kube-dns:dns\" -m udp -j DNAT --to-destination 10.200.0.27:53<\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b <code>Services<\/code> \u0432 Kubernetes. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432 Kubernetes The Hard Way \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u0440\u043e <code>NodePort<\/code> \u2014 \u0441\u043c. <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\/blob\/master\/docs\/13-smoke-test.md#services\">Smoke Test: Services<\/a>.<\/p>\n<pre><code class=\"bash\">kubectl expose deployment nginx --port 80 --type NodePort<\/code><\/pre>\n<p>  <code>NodePort<\/code> \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 IP-\u0430\u0434\u0440\u0435\u0441\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044f \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0440\u0442 (\u043e\u043d \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>NodePort<\/code>). \u041a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 <code>NodePort<\/code> \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0438 \u0438\u0437\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 31088) \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>kubectl<\/code>:<\/p>\n<pre><code class=\"bash\">$ kubectl describe services nginx ... Type:                     NodePort IP:                       10.32.0.53 Port:                     &lt;unset&gt;  80\/TCP TargetPort:               80\/TCP NodePort:                 &lt;unset&gt;  31088\/TCP Endpoints:                10.200.1.18:80 ...<\/code><\/pre>\n<p>  \u041f\u043e\u0434 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043a\u0430\u043a <code>http:\/\/${EXTERNAL_IP}:31088\/<\/code>. \u0417\u0434\u0435\u0441\u044c <code>EXTERNAL_IP<\/code> \u2014 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441 <b>\u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430<\/b>. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441 <b>worker-0<\/b>. \u0417\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0443\u0437\u043b\u043e\u043c \u0441 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c IP-\u0430\u0434\u0440\u0435\u0441\u043e\u043c 10.240.0.20 (\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c NAT&#8217;\u043e\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440), \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0437\u043b\u0435 (<b>worker-1<\/b>, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0443 endpoint&#8217;\u0430 \u2014 10.200.1.18):<\/p>\n<pre><code class=\"bash\">ubuntu@worker-0:~$ sudo conntrack -L | grep 31088 tcp      6 86397 ESTABLISHED src=173.38.XXX.XXX dst=10.240.0.20 sport=30303 dport=31088 src=10.200.1.18 dst=10.240.0.20 sport=80 dport=30303 [ASSURED] mark=0 use=1<\/code><\/pre>\n<p>  \u041f\u0430\u043a\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043e\u0442 <b>worker-0<\/b> \u043a <b>worker-1<\/b>, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code class=\"bash\">ubuntu@worker-1:~$ sudo conntrack -L | grep 80 tcp      6 86392 ESTABLISHED src=10.240.0.20 dst=10.200.1.18 sport=14802 dport=80 src=10.200.1.18 dst=10.240.0.20 sport=80 dport=14802 [ASSURED] mark=0 use=1<\/code><\/pre>\n<p>  \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u0430 \u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435\u0442, \u043d\u043e \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 <code>iptables<\/code> \u0442\u0430\u043a\u043e\u0432\u044b:<\/p>\n<pre><code class=\"bash\">-A KUBE-NODEPORTS -p tcp -m comment --comment \"default\/nginx:\" -m tcp --dport 31088 -j KUBE-SVC-4N57TFCL4MD7ZTDA -A KUBE-SVC-4N57TFCL4MD7ZTDA -m comment --comment \"default\/nginx:\" -j KUBE-SEP-UGTFMET44DQG7H7H -A KUBE-SEP-UGTFMET44DQG7H7H -p tcp -m comment --comment \"default\/nginx:\" -m tcp -j DNAT --to-destination 10.200.1.18:80<\/code><\/pre>\n<p>  \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441 \u043f\u043e\u0440\u0442\u043e\u043c 31088 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 10.200.1.18. \u041f\u043e\u0440\u0442 \u0442\u043e\u0436\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0441 31088 \u043d\u0430 80.<\/p>\n<p>  \u041c\u044b \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0438\u043f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u2014 <code>LoadBalancer<\/code>, \u2014 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, \u043d\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0443\u0436\u0435 \u0438 \u0431\u0435\u0437 \u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041c\u043e\u0433\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u043b\u0438\u0448\u044c \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0438 \u0432\u0435\u0440\u0445\u0443\u0448\u043a\u0443 \u0430\u0439\u0441\u0431\u0435\u0440\u0433\u0430. \u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e IPv6, IPVS, eBPF \u0438 \u043f\u0430\u0440\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 CNI.<\/p>\n<h2>P.S. \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/h2>\n<p>  \u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435:<\/p>\n<ul>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/346304\/\">\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 \u0441\u0435\u0442\u0438 \u0432 Kubernetes<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/359120\/\">\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0441 kube-proxy \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0437\u043b\u0430 \u0432 Kubernetes<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/326062\/\">\u0423\u043b\u0443\u0447\u0448\u0430\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c Kubernetes: \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u043e\u0434\u0430 \u0443\u043f\u0430\u043b\u0430<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/415381\/\">Play with Kubernetes \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 K8s<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/331188\/\">\u041d\u0430\u0448 \u043e\u043f\u044b\u0442 \u0441 Kubernetes \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445<\/a>\u00bb <i>(\u0432\u0438\u0434\u0435\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0432 \u0441\u0435\u0431\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c Kubernetes)<\/i>;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/329830\/\">Container Networking Interface (CNI) \u2014 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u043b\u044f Linux-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/a>\u00bb.<\/li>\n<\/ul>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \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\/post\/420813\/\"> https:\/\/habr.com\/post\/420813\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/flant\/blog\/420813\/\" class=\"post__text post__text-html js-mediator-article\"><i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u0410\u0432\u0442\u043e\u0440 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 Nicolas Leiva \u2014 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 Cisco, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438, \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c\u0438, \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u0435\u0442\u044c Kubernetes \u0438\u0437\u043d\u0443\u0442\u0440\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u0435\u0451 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0437\u0434\u0440\u0430\u0432\u044b\u0439 \u0441\u043c\u044b\u0441\u043b, \u0441\u0432\u043e\u0438 \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0441\u0435\u0442\u044f\u0445 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b Linux\/Kubernetes. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0431\u044a\u0451\u043c\u043d\u043e, \u0437\u0430\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gr\/qw\/d4\/grqwd4putslwaijltw9yojfzjes.png\"><\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430, \u0447\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e <a href=\"https:\/\/github.com\/kelseyhightower\/kubernetes-the-hard-way\">Kubernetes The Hard Way<\/a> \u043e\u0442 Kelsey Hightower \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (<a href=\"https:\/\/github.com\/nleiva\/kubernetes-the-hard-way\">\u0434\u0430\u0436\u0435 \u043d\u0430 AWS!<\/a>), \u043c\u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0435\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0447\u0438\u0441\u0442\u043e\u0442\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435; \u0438 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0432\u0430 \u0440\u043e\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Container Network Interface (<a href=\"https:\/\/github.com\/containernetworking\/cni\/blob\/master\/SPEC.md\">CNI<\/a>). \u0421\u043a\u0430\u0437\u0430\u0432 \u044d\u0442\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044e, \u0447\u0442\u043e \u0441\u0435\u0442\u044c Kubernetes \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c-\u0442\u043e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432\u2026 \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u00ab\u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u0449\u0438, \u043a\u0430\u043a \u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, <a href=\"https:\/\/www.youtube.com\/watch?v=t98CX8Tberc\">\u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442<\/a>\u00bb.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-288666","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288666","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=288666"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288666\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}