{"id":295970,"date":"2019-12-18T09:00:21","date_gmt":"2019-12-18T09:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295970"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295970","title":{"rendered":"\u041a\u0430\u043a \u0441 tcpserver \u0438 netcat \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0432 Kubernetes pod \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/479910\/\"><i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u042d\u0442\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f LayerCI \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 tips &amp; tricks \u0434\u043b\u044f Kubernetes. \u0412 \u043d\u0435\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (\u043f\u043e \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435) \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0442\u0438\u043b\u0438\u0442. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442 \u0441\u0430\u043c \u0430\u0432\u0442\u043e\u0440\u2026<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dy\/zh\/d_\/dyzhd_gl_n-bvwls1g70vrz_0vm.jpeg\"><\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0440\u0442 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0442\u0440\u0430\u0444\u0438\u043a \u0432 pod\/\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (\u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442).<a name=\"habracut\"><\/a><\/p>\n<h2>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<ol>\n<li> \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 HTTP endpoint <code>\/healthz<\/code> pod&#8217;\u0430 \u0432 production-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435.<\/li>\n<li> \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c TCP-\u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u043a pod&#8217;\u0443 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.<\/li>\n<li> \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a production-\u0431\u0430\u0437\u0435 \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 (\u043e\u0431\u044b\u0447\u043d\u043e \u0443 localhost&#8217;\u0430 \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0430 root&#8217;\u0430).<\/li>\n<li> \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 staging-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/li>\n<li> \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u044e VNC \u043a pod&#8217;\u0443 \u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0441\u0442\u043e\u043b\u043e\u043c (\u0441\u043c. XVFB).<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445<\/h2>\n<p>  <a href=\"https:\/\/cr.yp.to\/ucspi-tcp.html\">Tcpserver<\/a> \u2014 Open Source-\u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 Linux. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 stdin\/stdout \u043e\u0442 \u043b\u044e\u0431\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">colin@colin-work:~$ tcpserver 127.0.0.1 8080 echo -e 'HTTP\/1.0 200 OK\\r\\nContent-Length: 19\\r\\n\\r\\n&lt;body&gt;hello!&lt;\/body&gt;'&amp; [1] 17377 colin@colin-work:~$ curl localhost:8080 &lt;body&gt;hello!&lt;\/body&gt;colin@colin-work:~$<\/code><\/pre>\n<p>  <i>(<a href=\"https:\/\/asciinema.org\/a\/278469\/\">asciinema.org<\/a>)<\/i><\/p>\n<p>  Netcat \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c\u0443 \u043f\u043e\u0440\u0442\u0443 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u043d\u0435\u0433\u043e \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434 \u043d\u0430 stdin\/stdout:<\/p>\n<pre><code class=\"bash\">colin@colin-work:~$ nc -C httpstat.us 80 GET \/200 HTTP\/1.0 Host: httpstat.us HTTP\/1.1 200 OK Cache-Control: private Server: Microsoft-IIS\/10.0 X-AspNetMvc-Version: 5.1 Access-Control-Allow-Origin: * X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Set-Cookie: ARRAffinity=93fdbab9d364704de8ef77182b4d13811344b7dd1ec45d3a9682bbd6fa154ead;Path=\/;HttpOnly;Domain=httpstat.us Date: Fri, 01 Nov 2019 17:53:04 GMT Connection: close Content-Length: 0  ^C colin@colin-work:~$<\/code><\/pre>\n<p>  <i>(<a href=\"https:\/\/asciinema.org\/a\/278474\/\">asciinema.org<\/a>)<\/i><\/p>\n<p>  \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 netcat \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u043e HTTP. \u0424\u043b\u0430\u0433 <code>-C<\/code> \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c CRLF \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<h2>\u0421\u0432\u044f\u0437\u043a\u0430 \u0441 kubectl: \u0441\u043b\u0443\u0448\u0430\u0439\u0442\u0435 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435\u0441\u044c \u043a pod&#8217;\u0443<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441 kubectl, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0439:<\/p>\n<pre><code class=\"bash\">tcpserver 127.0.0.1 8000 kubectl exec -i web-pod nc 127.0.0.1 8080<\/code><\/pre>\n<p>  \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438, \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u0440\u0442\u0443 80 \u0432\u043d\u0443\u0442\u0440\u0438 pod&#8217;\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>curl \"127.0.0.1:80\"<\/code>:<\/p>\n<pre><code class=\"bash\">colin@colin-work:~$ sanic kubectl exec -it web-54dfb667b6-28n85 bash root@web-54dfb667b6-28n85:\/web# apt-get -y install netcat-openbsd Reading package lists... Done Building dependency tree Reading state information... Done netcat-openbsd is already the newest version (1.195-2). 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded. root@web-54dfb667b6-28n85:\/web# exit colin@colin-work:~$ tcpserver 127.0.0.1 8000 sanic kubectl exec -i web-54dfb667b6-28n85 nc 127.0.0.1 8080&amp; [1] 3232 colin@colin-work:~$ curl localhost:8000\/healthz {\"status\":\"ok\"}colin@colin-work:~$ exit<\/code><\/pre>\n<p>  <i>(<a href=\"https:\/\/asciinema.org\/a\/278477\/\">asciinema.org<\/a>)<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/li\/yd\/vj\/liydvjijcmaqrhbplduu8tsb-y8.png\"><br \/>  <i>\u0421\u0445\u0435\u043c\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442<\/i><\/p>\n<h2>\u0412 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443: \u0441\u043b\u0443\u0448\u0430\u0439\u0442\u0435 \u0432 pod&#8217;\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435\u0441\u044c \u043a \u0445\u043e\u0441\u0442\u0443<\/h2>\n<p>  <\/p>\n<pre><code class=\"bash\">nc 127.0.0.1 8000 | kubectl exec -i web-pod tcpserver 127.0.0.1 8080 cat<\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 pod&#8217;\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0440\u0442\u0443 8000 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.<\/p>\n<h2>\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f Bash<\/h2>\n<p>  \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f Bash, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c production-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c Kubernetes <a href=\"https:\/\/layerci.com\/\">LayerCI<\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"bash\">kubetunnel() {     POD=\"$1\"     DESTPORT=\"$2\"     if [ -z \"$POD\" -o -z \"$DESTPORT\" ]; then         echo \"Usage: kubetunnel [pod name] [destination port]\"         return 1     fi     pkill -f 'tcpserver 127.0.0.1 6666'     tcpserver 127.0.0.1 6666 kubectl exec -i \"$POD\" nc 127.0.0.1 \"$DESTPORT\"&amp;     echo \"Connect to 127.0.0.1:6666 to access $POD:$DESTPORT\" }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 <code>~\/.bashrc<\/code>, \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0432 pod \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubetunnel web-pod 8080<\/code> \u0438 \u0434\u0435\u043b\u0430\u0442\u044c <code>curl localhost:6666<\/code>.<\/p>\n<ul>\n<li> \u0414\u043b\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0432 <b>Docker<\/b> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430:\n<pre><code class=\"bash\">tcpserver 127.0.0.1 6666 docker exec -i \"$CONTAINER\" nc 127.0.0.1 \"$DESTPORT\"<\/code><\/pre>\n<\/li>\n<li> \u0434\u043b\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0432 <b>K3s<\/b> \u2014 \u043f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0435\u0451 \u043d\u0430:\n<pre><code class=\"bash\">tcpserver 127.0.0.1 6666 k3s kubectl exec \u2026<\/code><\/pre>\n<\/li>\n<li>\u0438 \u0442.\u0434.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0414\u0440\u0443\u0433\u0438\u0435 \u0438\u0434\u0435\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li> \u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c UDP-\u0442\u0440\u0430\u0444\u0438\u043a \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 <code>netcat -l -u -c<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>tcpserver<\/code> \u0438 <code>netcat -u<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>netcat<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/li>\n<li> \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 pipe viewer: <code>nc 127.0.0.1 8000 | pv --progress | kubectl exec -i web-pod tcpserver 127.0.0.1 8080 cat<\/code>.<\/li>\n<li> \u041c\u043e\u0436\u043d\u043e \u0441\u0436\u0438\u043c\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043a\u043e\u043d\u0446\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>gzip<\/code>.<\/li>\n<li> \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u043e SSH \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c <code>kubeconfig<\/code>: <code>cpserver ssh workcomputer \"kubectl exec -i my-pod nc 127.0.0.1 80\"<\/code>.<\/li>\n<li> \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0434\u0432\u0430 pod&#8217;\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>mkfifo<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u0432\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>kubectl<\/code>.<\/li>\n<\/ul>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0435\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b!<\/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\/ru\/company\/flant\/blog\/462707\/\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u0432 Kubernetes<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/446788\/\">Kubernetes tips &amp; tricks: \u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438 Telepresence<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/436112\/\">\u041f\u043b\u0430\u0433\u0438\u043d kubectl-debug \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0432 pod&#8217;\u0430\u0445 Kubernetes<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/330198\/\">\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Kubernetes<\/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\/ru\/company\/flant\/blog\/479910\/\"> https:\/\/habr.com\/ru\/company\/flant\/blog\/479910\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/479910\/\"><i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u042d\u0442\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f LayerCI \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 tips &amp; tricks \u0434\u043b\u044f Kubernetes. \u0412 \u043d\u0435\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (\u043f\u043e \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435) \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0442\u0438\u043b\u0438\u0442. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442 \u0441\u0430\u043c \u0430\u0432\u0442\u043e\u0440\u2026<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dy\/zh\/d_\/dyzhd_gl_n-bvwls1g70vrz_0vm.jpeg\"><\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0440\u0442 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0442\u0440\u0430\u0444\u0438\u043a \u0432 pod\/\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (\u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442).<\/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-295970","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295970","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=295970"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295970\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}