{"id":287882,"date":"2018-08-16T14:18:30","date_gmt":"2018-08-16T10:18:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287882"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287882","title":{"rendered":"Rancher: Kubernetes \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0433\u043e\u043b\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/418691\/\" class=\"post__text post__text-html js-mediator-article\">\u041d\u0430 \u043f\u0435\u0440\u0435\u043f\u0440\u0430\u0432\u0435 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0442\u043e\u0440 <s>\u043d\u0435<\/s> \u043c\u0435\u043d\u044f\u044e\u0442.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u043d\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0434\u043e\u0435\u043b Docker Swarm \u0438\u0437-\u0437\u0430 \u0441\u0432\u043e\u0435\u0439 \u043f\u0441\u0435\u0432\u0434\u043e\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u043d\u0438\u044f, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u044b\u0440\u043e\u0432\u0430\u0442\u044b\u043c web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0438 \u0443\u0437\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb GitLab \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0432\u043e\u0439 Kubernetes cluster \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u043f\u0443\u0442\u0435\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Rancher Management Server 2.0.<\/p>\n<p>  \u041e\u043f\u044b\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0441\u0445\u0435\u043c\u0430 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 haProxy \u0438 \u0434\u0432\u0430 dashboard \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c:<br \/>  <a name=\"habracut\"><\/a><br \/>  <strong>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/strong><\/p>\n<p>  Host Server HP Proliant DL320e Gen8 \u2014 2 \u0448\u0442.<br \/>  VM Ubuntu Server 16.04, 2Gb RAM, 2vCPU, 20Gb HDD \u2014 1 \u0448\u0442. on each Host (VM-haProxy).<br \/>  VM Ubuntu Server 16.04, 4Gb RAM, 4vCPU, 40Gb HDD, 20 Gb SSD \u2014 3 \u0448\u0442. on each Host (VM-*-Cluster). <br \/>  VM Ubuntu Server 16.04, 4Gb RAM, 4vCPU, 100Gb HDD \u2014 1 \u0448\u0442. on anyone Host (VM-NFS).<\/p>\n<p>  \u0421\u0445\u0435\u043c\u0430 \u0441\u0435\u0442\u0438:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0438\u0441.1<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ua\/wg\/ec\/uawgecpkngtalxstr0i1fam-ok4.jpeg\"\/>  <\/div>\n<\/div>\n<p>  <strong>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c:<\/strong><\/p>\n<p>  <em>VM-haProxy<\/em> \u0438\u043c\u0435\u0435\u0442 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443 haProxy, fail2ban, \u043f\u0440\u0430\u0432\u0438\u043b\u0430 iptables. \u0418\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u043e\u043b\u044c \u0448\u043b\u044e\u0437\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u0430\u0448\u0438\u043d \u0437\u0430 \u043d\u0438\u043c. \u0423 \u043d\u0430\u0441 \u0434\u0432\u0430 \u0448\u043b\u044e\u0437\u0430 \u0438 \u0432\u0441\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0442\u0435\u0440\u0438 \u0441\u0432\u044f\u0437\u0438 \u0448\u043b\u044e\u0437\u0430 \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0445\u043e\u0441\u0442\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439. <\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u044d\u0442\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 (VM-haProxy) \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a backend, \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u044b, \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443. <\/p>\n<p>  \u041c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 haProxy, \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0443\u0437\u043a\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 health checking. \u041f\u0440\u0438 \u0432\u0441\u0435\u043c \u044d\u0442\u043e\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0435\u043b\u044b\u043c\u0438 \u0438 \u0447\u0435\u0440\u043d\u044b\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 IP, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0443\u043b\u044c\u0442\u0438\u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c SSL \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f haProxy:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">haproxy.conf \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">########################################################## #Global                                                     # ##########################################################      global     log 127.0.0.1 local0 notice     maxconn 2000     user haproxy     group haproxy     tune.ssl.default-dh-param 2048  defaults     log     global     mode    http     option  httplog     option  dontlognull     retries 3     option redispatch     timeout connect  5000     timeout client  10000     timeout server  10000     option forwardfor     option http-server-close  ########################################################## #TCP                                                     # ########################################################## #\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0440\u0442 API \u0421\u0435\u0440\u0432\u0435\u0440\u0430 Kubernetes listen kube-api-tls         bind *:6443         mode tcp         option tcplog         server VM-Master-Cluster Master:6443  ########################################################## #HTTP\/HTTPS - Frontend and backend                       # ########################################################## #\u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0431\u043b\u043e\u043a\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c &quot;\u0431\u0435\u043b\u043a\u0438 \u043e\u0442 \u0436\u0435\u043b\u0442\u043a\u043e\u0432&quot;, frontend \u043e\u0442 backend. frontend http-in     bind *:80       acl network_allowed src -f \/path\/allowed-ip # \u041f\u0443\u0442\u044c \u043a \u0431\u0435\u043b\u043e\u043c\u0443 \u0441\u043f\u0438\u0441\u043a\u0443 IP. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b.     http-request deny if !network_allowed # \u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f IP \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.      reqadd X-Forwarded-Proto:\\ http      mode http     option httpclose      acl is_haproxy hdr_end(host) -i haproxy.domain.ru     acl is_rancher hdr_end(host) -i rancher.domain.ru     acl is_kubernetes hdr_end(host) -i kubernetes.domain.ru      use_backend kubernetes if is_kubernetes     use_backend rancher if is_rancher     use_backend haproxy if is_haproxy  frontend https-in     bind *:443 ssl crt-list \/path\/crt-list # \u041f\u0443\u0442\u044c \u043a \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432. \u041e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432.      acl network_allowed src -f \/path\/allowed-ip     http-request deny if !network_allowed     reqadd X-Forwarded-Proto:\\ https     acl is_rancher hdr_end(host) -i rancher.etraction.ru    acl is_kubernetes hdr_end(host) -i kubernetes.etraction.ru     use_backend kubernetes if is_kubernetes { ssl_fc_sni kubernetes.domain.ru }    use_backend rancher if is_rancher { ssl_fc_sni rancher.domain.ru }  # Backend \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 haProxy. \u041d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430. backend haproxy     stats enable     stats uri \/haproxy?stats     stats realm Strictly\\ Private     stats auth login:passwd     cookie SERVERID insert nocache indirect  # \u041d\u0443 \u0438, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, backend \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 dashboard rancher \u0438 kubernetes. backend rancher     acl network_allowed src -f \/path\/allowed-ip     http-request deny if !network_allowed     mode http     redirect scheme https if !{ ssl_fc }     server master master:443 check ssl verify none  backend kubernetes     acl network_allowed src -f \/path\/allowed-ip     http-request deny if !network_allowed     mode http     balance leastconn     redirect scheme https if !{ ssl_fc }     server master master:9090 check ssl verify none <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <strong>\u0412\u0430\u0436\u043d\u043e:<\/strong> \u0412\u0441\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u00ab\u0437\u043d\u0430\u0442\u044c\u00bb \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">add-host-entry.pp puppet \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u043e\u0432 \u0432 \/etc\/hosts<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">class host_entries {    host { 'proxy01':     ip =&gt; '10.10.10.11',   }   host { 'proxy02':     ip =&gt; '10.10.10.12',   }   host { 'master':     ip =&gt; '10.10.10.100',   }   host { 'node01':     ip =&gt; '10.10.10.101',   }   host { 'node02':     ip =&gt; '10.10.10.102',   }   host { 'node03':     ip =&gt; '10.10.10.103',   }   host { 'node04':     ip =&gt; '10.10.10.104',   }   host { 'node05':     ip =&gt; '10.10.10.105',   }   host { 'nfs':     ip =&gt; '10.10.10.200',   }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <em>VM-Master-Cluster<\/em> \u2014 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443 Puppet Master, GlusterFS Server, Rancher Server (container), etcd (container), control manager (container). \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430, production \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<br \/>  <em>VM-Node-Cluster<\/em> \u2014 \u041d\u043e\u0434\u044b, \u0432\u043e\u0440\u043a\u0435\u0440\u044b. \u0420\u0430\u0431\u043e\u0447\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0432 \u043e\u0434\u043d\u0443 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0443\u044e \u0441\u0440\u0435\u0434\u0443. \u041d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e.<\/p>\n<p>  <em>VM-NFS<\/em> \u2014 NFS \u0441\u0435\u0440\u0432\u0435\u0440 (nfs-kernel-server). \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u0425\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0432\u0441\u044f\u043a\u043e\u0435. \u041d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0432\u0430\u0436\u043d\u043e\u0433\u043e. \u0415\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435 \u0441\u043f\u0435\u0448\u0430, \u043f\u043e\u043f\u0438\u0432\u0430\u044f \u043a\u043e\u0444\u0435.<\/p>\n<p>  <strong>\u0412\u0430\u0436\u043d\u043e:<\/strong> \u0412\u0441\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u043d\u0430 \u0431\u043e\u0440\u0442\u0443: docker.io, nfs-common, gluster-server.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">must-have-packages.pp puppet \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u041f\u041e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">class musthave {    package { 'docker.io':     ensure =&gt; 'installed',   }    package { 'nfs-common':     ensure =&gt; 'installed',   }    package { 'gluster-server':     ensure =&gt; 'installed',   }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 nfs-volume \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 GlusterFS \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0449\u0435\u0434\u0440\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0435\u0441\u0442\u044c SSD \u0434\u0438\u0441\u043a\u0438, \u043e\u043d\u0438 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Gluster. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b, \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u043d\u044b\u0445 \u0434\u0438\u0441\u043a\u0430\u0445.<\/p>\n<p>  <em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em> \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Rancher \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b. \u0412\u0441\u0435 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u2014 \u044d\u0442\u043e \u043c\u043e\u0435 \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u043a \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0441\u044c \u044f. <\/p>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Rancher \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e <strong>\u043e\u0434\u043d\u043e\u0439<\/strong> \u043c\u0430\u0448\u0438\u043d\u044b, \u0441 4CPU, 4Gb RAM, 10Gb HDD.<\/p>\n<p>  5 \u043c\u0438\u043d\u0443\u0442 \u0434\u043e Rancher.<\/p>\n<p>  \u041d\u0430 VM-Master-Cluster \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c:<\/p>\n<pre><code class=\"bash\">sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher\/rancher<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"bash\">curl -k https:\/\/localhost<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 API \u2014 \u044f \u0412\u0430\u0441 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e \u0440\u043e\u0432\u043d\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043f\u0443\u0442\u0438 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430.<\/p>\n<p>  \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u0441\u0445\u0435\u043c\u0443 \u0441\u0435\u0442\u0438 \u0441\u043d\u043e\u0432\u0430, \u043c\u044b \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437\u0432\u043d\u0435, \u0447\u0435\u0440\u0435\u0437 haProxy, \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0430 <a href=\"https:\/\/rancher.domain.ru\">rancher.domain.ru<\/a>, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u2014 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0438\u0441.2<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1w\/ke\/xn\/1wkexnv2z_lgd_epga3vx3foyv4.png\"\/>  <\/div>\n<\/div>\n<p>  \u0412 \u043c\u0435\u043d\u044e Cluster Options, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Flannel. \u0421 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438 \u0441\u0435\u0442\u0435\u0439 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u0421\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443.<\/p>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u044b etcd \u0438 Control Plane, \u0447\u0435\u043a\u0431\u043e\u043a\u0441 worker \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0432\u043e\u0440\u043a\u0435\u0440\u0430.<br \/>  \u041c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043d\u0430 NIC, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u043e\u043b\u044f\u0445 Public \u0438 Internal Address \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 IP.<\/p>\n<p>  \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u0432\u044b\u0448\u0435, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<p>  \u0421\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 web \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0434\u044b. \u0410 \u0435\u0449\u0435 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0443 \u0432\u0430\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440 Kubernetes.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0438\u0441.3<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lj\/sn\/kk\/ljsnkkwx3eh2w0eg5vysblt8wpm.png\"\/>  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0440\u043a\u0435\u0440, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0432 web \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Rancher, \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0442\u043e \u0436\u0435 \u043c\u0435\u043d\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0447\u0435\u043a\u0431\u043e\u043a\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 worker, \u0443\u043a\u0430\u0436\u0438\u0442\u0435 IP \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u043e\u0440\u043a\u0435\u0440\u0430, \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0435\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0430\u043c \u043d\u043e\u0434\u044b.<\/p>\n<p>  \u0427\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u0441\u044f, \u0440\u043e\u0432\u043d\u043e \u043a\u0430\u043a \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0434.<\/p>\n<p>  <strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Kubernetes Dashboard:<\/strong><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043c\u0435\u043d\u044e Projects\/Namespaces.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e namespaces, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a Kubernetes, \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u043c\u0438 \u0438\u043c\u0435\u043d \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044e. \u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u0435 namespaces (cattle-system, ingress-nginx, kube-public, kube-system) \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u00abMove\u00bb. \u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0438\u0441.4<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dz\/qv\/el\/dzqvelzycrlwyj3bkwllq-pndqm.png\"\/>  <\/div>\n<\/div>\n<p>  \u0429\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u043f\u0440\u044f\u043c\u043e \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u044b \u043f\u043e\u043f\u0430\u0434\u0435\u0442\u0435 \u0432 \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f workload. \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0438\u0441.5<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/q6\/lp\/5z\/q6lp5znqlnhzkudjafjnr172n-g.png\"\/>  <\/div>\n<\/div>\n<p>  \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abImport YAML\u00bb \u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0433\u043b\u0443. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <a href=\"https:\/\/raw.githubusercontent.com\/kubernetes\/dashboard\/master\/src\/deploy\/recommended\/kubernetes-dashboard.yaml\">\u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/a> \u0432 \u0442\u0435\u043a\u0441\u0442\u0431\u043e\u043a\u0441 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043e\u043a\u043d\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 namespace \u00abkube-system\u00bb, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abImport\u00bb.<\/p>\n<p>  \u0427\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f pod kubernetes-dashboard.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 pod, \u0440\u0430\u0441\u043a\u0440\u043e\u0439\u0442\u0435 \u043c\u0435\u043d\u044e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u0440\u0442\u043e\u0432, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0438\u0441.6<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_p\/2b\/wk\/_p2bwkxifynrhipap0imqddogfi.png\"\/>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0430 \u043d\u043e\u0434\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0443\u0449\u0435\u043d pod.<\/p>\n<pre><code class=\"bash\">curl -k https:\/\/master:9090 <\/code><\/pre>\n<p>  \u0423\u0432\u0438\u0434\u0435\u043b\u0438 \u043e\u0442\u0432\u0435\u0442? \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u041d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0432 Rancher, \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a, kubectl \u2014 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0438 Kubeconfig File \u2014 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 API, ca.crt \u0438 \u0442.\u0434.<\/p>\n<p>  \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 kubectl \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c:<\/p>\n<pre><code class=\"bash\">kubectl create serviceaccount cluster-admin-dashboard-sa kubectl create clusterrolebinding cluster-admin-dashboard-sa --clusterrole=cluster-admin --serviceaccount=default:cluster-admin-dashboard-sa <\/code><\/pre>\n<p>  \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0441 \u0432\u044b\u0441\u0448\u0438\u043c\u0438 \u043f\u0440\u0438\u0432\u0435\u043b\u0435\u0433\u0438\u044f\u043c\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 Dashboard.<\/p>\n<p>  \u041d\u0430\u0439\u0434\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430:<\/p>\n<pre><code class=\"bash\">kubectl get secret | grep cluster-admin-dashboard-sa <\/code><\/pre>\n<p>  \u0423\u0432\u0438\u0434\u0438\u043c \u0438\u043c\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0441 \u043d\u0435\u043a\u0438\u043c \u0445\u044d\u0448\u0435\u043c \u0432 \u043a\u043e\u043d\u0446\u0435, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c:<\/p>\n<pre><code class=\"bash\">kubectl describe secret cluster-admin-dashboard-sa-$(\u043d\u0435\u043a\u0438\u0439 \u0445\u044d\u0448) <\/code><\/pre>\n<p>  \u0421\u043d\u043e\u0432\u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u0431\u043b\u0430\u0433\u043e\u043f\u043e\u043b\u0443\u0447\u043d\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e \u0447\u0435\u0440\u0435\u0437 haProxy.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/kubernetes.domain.ru\">kubernetes.domain.ru<\/a>. \u0412\u0432\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  \u0420\u0430\u0434\u0443\u0435\u043c\u0441\u044f:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0438\u0441.7<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ps\/1q\/iw\/ps1qiwgxivruyotas0fcb2slwfy.png\"\/>  <\/div>\n<\/div>\n<p>  <em>P.S.<\/em><br \/>  \u041e\u0431\u0449\u0438\u043c \u0438\u0442\u043e\u0433\u043e\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c Rancher \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441, \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u0430 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0440\u0435\u0437\u043a\u043e \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0441\u0442\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e Swarm \u043d\u0430\u0434\u043e\u0435\u043b, \u0441\u043a\u043e\u0440\u0435\u0439 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0442\u0440\u0435\u043d\u0434\u044b \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f, \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438 \u0437\u0430\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0438 \u043d\u0435 \u0434\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043a\u0443\u0447\u043d\u044b\u0435 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u0434\u0435\u043b\u0430 \u0434\u043e \u043a\u043e\u043d\u0446\u0430. Docker \u0441\u043e\u0437\u0434\u0430\u043b \u044d\u043f\u043e\u0445\u0443 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f. \u0418 \u0441\u0443\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043c\u043d\u0435.<\/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\/418691\/\"> https:\/\/habr.com\/post\/418691\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/418691\/\" class=\"post__text post__text-html js-mediator-article\">\u041d\u0430 \u043f\u0435\u0440\u0435\u043f\u0440\u0430\u0432\u0435 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0442\u043e\u0440 <s>\u043d\u0435<\/s> \u043c\u0435\u043d\u044f\u044e\u0442.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u043d\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0434\u043e\u0435\u043b Docker Swarm \u0438\u0437-\u0437\u0430 \u0441\u0432\u043e\u0435\u0439 \u043f\u0441\u0435\u0432\u0434\u043e\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u043d\u0438\u044f, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u044b\u0440\u043e\u0432\u0430\u0442\u044b\u043c web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0438 \u0443\u0437\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb GitLab \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0432\u043e\u0439 Kubernetes cluster \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u043f\u0443\u0442\u0435\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Rancher Management Server 2.0.<\/p>\n<p>  \u041e\u043f\u044b\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0441\u0445\u0435\u043c\u0430 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 haProxy \u0438 \u0434\u0432\u0430 dashboard \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c:  <\/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-287882","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287882","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=287882"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287882\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}