{"id":346051,"date":"2023-02-28T09:06:58","date_gmt":"2023-02-28T09:06:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=346051"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=346051","title":{"rendered":"<span>\u0412\u0441\u0435 \u0447\u0442\u043e \u0442\u044b \u0445\u043e\u0442\u0435\u043b \u0437\u043d\u0430\u0442\u044c \u043e AWS Spot Instances, \u043d\u043e \u0431\u043e\u044f\u043b\u0441\u044f \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/dx\/jk\/et\/dxjketytre0tyd4v0qpdbtkvyiu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/dx\/jk\/et\/dxjketytre0tyd4v0qpdbtkvyiu.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u043d\u043e\u0434\u0430\u043c\u0438 AWS, \u043a\u0430\u043a, \u0447\u0442\u043e, \u0438 \u043f\u043e\u0447\u0435\u043c\u0443? \u0410 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0436\u0438\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0441\u043f\u043e\u0442\u0430\u0445, \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u044d\u0442\u043e \u043a\u043e\u043b-\u0432\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u043d\u0435\u0433 $. \u0417\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0440\u043e\u0448\u0443 \u043a\u043e\u0434 \u043a\u0430\u0442.<a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<h3 id=\"soderzhimoe\">\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/h3>\n<p>  <\/p>\n<ol>\n<li>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043f\u043e\u0442\u044b, \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b<\/li>\n<li>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u043f\u043e\u0442\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439<\/li>\n<li>\u0414\u0435\u043f\u043b\u043e\u0439 CF \u0441\u0442\u0435\u043a\u0430 \u0441\u043e \u0441\u043f\u043e\u0442\u0430\u043c\u0438 + \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/li>\n<li>\u0414\u0435\u043f\u043b\u043e\u0439 Aws Node Termination Handler + \u0434\u0430\u0448\u0431\u043e\u0440\u0434 + \u044d\u0432\u0435\u043d\u0442\u044b<\/li>\n<li>\u041a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0436\u0430\u044e\u0442 \u043f\u043e\u0434\u044b <\/li>\n<li>Cluster Autoscaler + Batch ETL \u0436\u0438\u0432\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/li>\n<li>\u0412\u0438\u043d\u0434\u043e\u0432\u044b\u0435 \u0441\u043f\u043e\u0442\u044b \u0438 IIS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/li>\n<li>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043d\u0430 \u0436\u0438\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/li>\n<\/ol>\n<p>  <\/p>\n<h3 id=\"1-chto-takoe-spoty-kratkiy-princip-raboty\">1. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u043f\u043e\u0442\u044b, \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0442\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0435 \u043d\u043e\u0434\u044b \u044d\u0442\u043e \u0442\u0435 \u0436\u0435 ec2 \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0438 \u0441\u0442\u043e\u044f\u0442 \u043d\u0430 50-70% \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 ec2, \u043d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441 \u2014 \u0410\u043c\u0430\u0437\u043e\u043d \u043c\u043e\u0436\u0435\u0442 &#171;\u0437\u0430\u0431\u0440\u0430\u0442\u044c&#187; \u0443 \u0442\u0435\u0431\u044f \u044d\u0442\u0438 \u043d\u043e\u0434\u044b \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0430\u0432 \u0442\u0435\u0431\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0437\u0430 2 \u043c\u0438\u043d\u0443\u0442\u044b \u0434\u043e \u0435\u0433\u043e termination. \u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0442\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u043d\u043e\u0434\u0435 \u0438 \u0436\u0438\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u0431\u043b\u0430\u0433\u043e \u043d\u0430 \u0432\u0441\u0435 \u044d\u0442\u043e \u0435\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043e AWS Spot Fleet \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043d\u043e\u0434 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0433\u0443\u0442 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0435 \u0442\u0430\u043a \u0438 on-demand \u043d\u043e\u0434\u044b, \u0430 \u0432\u043e\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438 \u043a\u0430\u043a\u0438\u0445 \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u044d\u0442\u043e\u0433\u043e Spot Fleet.<\/p>\n<p>  <\/p>\n<p>\u0421 \u044d\u0442\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u0435\u0440\u0435\u0433\u0443, \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0437\u0430\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043f\u043e\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u0443 \u0432\u0430\u0441 \u0438 \u0446\u0435\u043d\u0430 \u043d\u0435 \u0443\u0448\u043b\u0430 \u0432\u044b\u0448\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439, \u0438 \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u0431\u0435\u0437 \u043d\u043e\u0434 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432 \u0441\u0430\u043c\u044b\u0439 \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  <\/p>\n<h3 id=\"2-chto-nuzhno-dlya-spotov-opredelitsya-so-strategiey\">2. \u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u043f\u043e\u0442\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439<\/h3>\n<p>  <\/p>\n<p><strong>Spot Fleet \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p><strong>SpotInstancePools<\/strong>: 6<br \/>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0443\u043b\u044b \u0434\u043b\u044f \u0441\u043f\u043e\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432? \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430, \u0437\u043e\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0445 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043f\u0443\u043b. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<br \/>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0441\u0435 3 \u0437\u043e\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u043d\u043e\u0434, + \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 2 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 Spot Fleet \u044d\u0442\u043e t3.medium, t3a.medium \u0418\u0442\u043e\u0433\u043e: 2 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 * 3 \u0437\u043e\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 = 6 \u043f\u0443\u043b\u043e\u0432 \u0434\u043b\u044f \u0441\u043f\u043e\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<h4 id=\"vazhnyy-moment\">\u0412\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442!<\/h4>\n<p>  <\/p>\n<p>\u041a\u043e\u043b-\u0432\u043e \u043f\u0443\u043b\u043e\u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 4 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0441\u0445\u043e\u0436\u0438\u0445 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0438 \u0446\u0435\u043d\u0435, \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u0439 \u0434\u0435\u0448\u0435\u0432\u044b\u0439 \u0430 \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442 \u0442\u043e \u043f\u043e\u0439\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e \u0446\u0435\u043d\u0435, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0447\u0435\u043c on-demand \u043d\u043e\u0434\u044b. \u0415\u0441\u043b\u0438 \u043f\u0443\u043b\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0432\u044b\u0431\u0435\u0440\u0435\u0442\u0435 \u043c\u0430\u043b\u043e \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u0433\u0434\u0430 \u0443 \u0430\u043c\u0430\u0437\u043e\u043d\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u0434, \u043f\u043e\u0434 \u0432\u0430\u0448\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0442\u0430\u0440\u044b\u0435 \u0443\u0439\u0434\u0443\u0442 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0435\u0439\u0442, \u043d\u043e\u0432\u044b\u0435 \u043d\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0443\u0442\u0441\u044f.<\/p>\n<p>  <\/li>\n<li>\n<p><strong>SpotAllocationStrategy<\/strong>: lowest-price<br \/>  \u0418 \u0442\u0430\u043a \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u044d\u0442\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u0438\u0445 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<p>priceCapacityOptimized \u2014 \u0430\u043c\u0430\u0437\u043e\u043d \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0443\u043b \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u043d\u043e\u0434 \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0445\u043e\u0434 \u044d\u0432\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 terminate \u0438 \u0441\u043b\u0435\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0443\u0436\u0435 \u043f\u0443\u043b\u043e\u0432 \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u0442\u0435 \u0433\u0434\u0435 \u0446\u0435\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0430\u044f, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u0442\u0435 \u044f\u043a\u043e\u0431\u044b \u043c\u0435\u0436\u0434\u0443 capacity \u0438 \u043d\u0438\u0437\u043a\u043e\u0439 \u0446\u0435\u043d\u043e\u0439, \u0422\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0435\u0440\u0432\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f, \u044f\u0432\u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u043d\u0430\u0441) \u043d\u0430\u0434\u043e \u0432\u044b\u0436\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0441\u043a\u0440\u0443\u0434\u0436 \u043c\u0430\u043a\u0434\u0430\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435)<\/p>\n<p>  <\/p>\n<p>capacityOptimized- \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u043a \u0447\u0430\u0441\u0442\u043e\u0442\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u043d\u043e\u0434, \u0435\u0433\u043e \u0442\u0430\u043a \u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0445 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u043a \u0442\u0438\u043f\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0438\u0434\u0435\u043e, \u0438\u043b\u0438 deep learning, \u0432 \u043e\u0431\u0449\u0435\u043c \u0442\u0430\u043c \u0433\u0434\u0435 \u0447\u0430\u0441\u0442\u043e\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u043e\u0434\u044b \u0441\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0445\u0443\u0436\u0435 \u0447\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u043e \u043f\u0440\u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0446\u0435\u043d\u0435 \u0437\u0430 \u0441\u043f\u043e\u0442\u043e\u0432\u0443\u044e \u043d\u043e\u0434\u0443.<\/p>\n<p>  <\/p>\n<p>diversified \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u0434\u0438\u0432\u0435\u0440\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u044d\u0442\u043e \u043a\u0430\u043a \u0432 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u044f\u0445, \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e &#171;\u043f\u043e\u0440\u0442\u0444\u0435\u043b\u044f&#187;, \u0432\u0430\u0448\u0438 \u043d\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u044b \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u0443\u043b\u0430\u043c \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e, \u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0443\u043b\u0435 \u0446\u0435\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0442\u0441\u044f, \u0440\u0435\u0447\u044c \u043e \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u0448\u0435\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u0438\u0434\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>lowestPrice \u2014 \u043d\u0443 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0430\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0438 \u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u044d\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u043d\u0438\u0437\u043a\u0430\u044f \u0446\u0435\u043d\u0430, \u0440\u0430\u0437 \u0443\u0436 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438\u0441\u044c \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0441\u043f\u043e\u0442\u044b, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0436\u0430\u0442\u044c \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443 \u0441 \u043d\u0438\u0445, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0448\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u044d\u0442\u043e\u043c\u0443. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u043c\u0430\u0437\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0430\u043c \u0441\u0430\u043c\u044b\u0435 \u0434\u0435\u0448\u0435\u0432\u044b\u0435 \u043f\u0443\u043b\u044b \u0434\u043b\u044f \u043d\u043e\u0434, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043a\u0438\u0434\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439, \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043e\u043d\u0430 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e 90%.<\/p>\n<p>  <\/p>\n<p>InstancePoolsToUseCount \u2014 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0441 lowestPrice, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043a\u0430\u043a \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u043f\u0443\u043b\u043e\u0432 \u0447\u0442\u043e\u0431\u044b \u0446\u0435\u043d\u0430 \u0442\u043e\u0447\u043d\u043e \u0431\u044b\u043b\u0430 \u043d\u0438\u0437\u043a\u043e\u0439 \u0432\u0441\u0435\u0433\u0434\u0430, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441 \u0447\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043d\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u043a\u0430\u0437\u0430, \u043b\u0438\u0431\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u043f\u0443\u043b\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0448\u0438\u0445 \u0437\u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u0431\u0435\u0437 \u043d\u043e\u0434 \u0438 \u0432\u044b\u0431\u043e\u0440 \u0431\u044b\u043b \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<p>  <\/li>\n<li>\n<p><strong>SpotMaxPrice<\/strong>: 0,5<br \/>  \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443 \u043d\u0430 \u043d\u043e\u0434\u0443 \u0432 \u0447\u0430\u0441, \u0435\u0441\u043b\u0438 \u043c\u044b \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u043c \u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0446\u0435\u043d\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f = \u0446\u0435\u043d\u0430 on-demand \u043d\u043e\u0434\u044b, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0435 \u043d\u043e\u0434\u044b \u0432\u044b\u0448\u0435 \u044d\u0442\u043e\u0433\u043e \u043b\u0438\u043c\u0438\u0442\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0435\u043d\u044b. \u0422\u0443\u0442 \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0432 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0430\u0448\u0430 autoscale \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 Spot Fleet \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0438\u0437 \u0437\u0430 \u044d\u0442\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/li>\n<li>\n<p><strong>OnDemandAllocationStrategy<\/strong>: prioritized<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 on-demand \u043d\u043e\u0434\u044b \u0432 \u043d\u0430\u0448\u0435\u0439 Spot Fleet \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.<br \/>  \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u043e\u0434 \u0434\u043b\u044f on-demand, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c prioritized \u0438 \u043c\u044b \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443\u043a\u0430\u0436\u0435\u043c 3 \u0442\u0438\u043f\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432:<br \/>  m5.large \u2013 priority 1<br \/>  m4.large \u2013 priority 2<br \/>  m5a.large \u2013 priority 3<br \/>  \u0422\u043e \u043d\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 prioritized, \u0442\u043e \u0430\u043c\u0430\u0437\u043e\u043d \u0432\u043e\u0437\u044c\u043c\u0435\u0442 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u044b\u0448\u0435 \u0441\u0430\u043c\u0443\u044e \u0434\u0435\u0448\u0435\u0432\u0443\u044e, \u044d\u0442\u043e, m4.large \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443.<\/p>\n<p>  <\/li>\n<li>\n<p><strong>OnDemandBaseCapacity<\/strong>: 2<br \/>  \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043a\u043e\u043b-\u0432\u043e \u043d\u043e\u0434 on-demand \u0432 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 Spot Fleet. \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u043f\u043b\u043e\u0435\u0442\u0435 \u0430\u0432\u0442\u043e\u0441\u043a\u0435\u0439\u043b \u0433\u0440\u0443\u043f\u043f\u0443 \u0441 desired capacity 4, \u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u044d\u0442\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043e\u043d \u0432\u0430\u043c \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442 2 \u043d\u043e\u0434\u044b on-demand \u0438 2 \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445.<\/p>\n<p>  <\/li>\n<li>\n<p><strong>OnDemandPercentageAboveBaseCapacity<\/strong>: 0-100<br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b\u0448\u0435, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0442\u043e \u043a\u043e\u043b-\u0432\u043e \u043d\u043e\u0434 on-demand \u0432 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432 % \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"3-deploy-cf-steka-so-spotami--opisanie-parametrov\">3. \u0414\u0435\u043f\u043b\u043e\u0439 CF \u0441\u0442\u0435\u043a\u0430 \u0441\u043e \u0441\u043f\u043e\u0442\u0430\u043c\u0438 + \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438\u0441\u044c \u043f\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0441\u043a\u0435\u0439\u043b \u0433\u0440\u0443\u043f\u043f\u0443 \u0441 \u0442\u0435\u043c\u0438 \u0441\u0430\u043c\u044b\u043c\u0438 Spot Fleet, \u043d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0434 CloudFormation \u0441\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0438\u0442 \u0433\u0440\u0443\u043f\u043f\u0443 \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u043d\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a AWS EKS \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">CloudFormation stack EKS node group linux<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">--- AWSTemplateFormatVersion: 2010-09-09 Description: Amazon EKS - Linux Node Group  Parameters:    KeyName:     Description: The EC2 Key Pair to allow SSH access to the instances     Type: AWS::EC2::KeyPair::KeyName    NodeImageId:     Type: \"AWS::SSM::Parameter::Value&lt;AWS::EC2::Image::Id>\"     Default: \/aws\/service\/eks\/optimized-ami\/1.24\/amazon-linux-2\/recommended\/image_id     Description: AWS Systems Manager Parameter Store parameter of the AMI ID for the worker node instances.    NodeInstanceType:     Description: EC2 instance type for the node instances     Type: String     ConstraintDescription: Must be a valid EC2 instance type    NodeAutoScalingGroupMinSize:     Description: Minimum size of Node Group ASG.     Type: Number    NodeAutoScalingGroupMaxSize:     Description: Maximum size of Node Group ASG. Set to at least 1 greater than NodeAutoScalingGroupDesiredCapacity.     Type: Number    NodeAutoScalingGroupDesiredCapacity:     Description: Desired capacity of Node Group ASG.     Type: Number    NodeVolumeSize:     Description: Node volume size     Type: Number     Default: 30    ClusterName:     Description: The cluster name provided when the cluster was created. If it is incorrect, nodes will not be able to join the cluster.     Type: String    OnDemandBaseCapacity:     Type: Number     Description: \"on-demand base capacity\"     Default: 0    OnDemandPercentageAboveBaseCapacity:     Type: Number     Description: \"on-demand percentage above base capacity(0-100)\"     Default: 0    SpotInstancePools:     Type: Number     Description: \"spot instance pools(1-20)\"     Default: 12    InstanceTypesOverride:     Type: String     Description: \"multiple spot instances to override(seperated by comma, 4 counts) t3.medium,t2.medium,t3a.medium,t3.large\"    BootstrapArgumentsForOnDemand:     Description: Arguments to pass to the bootstrap script. See files\/bootstrap.sh in https:\/\/github.com\/awslabs\/amazon-eks-ami     Default: \"--kubelet-extra-args --node-labels=lifecycle=OnDemand\"      Type: String    BootstrapArgumentsForSpotFleet:     Description: Arguments to pass to the bootstrap script. See files\/bootstrap.sh in https:\/\/github.com\/awslabs\/amazon-eks-ami     Default: \"--kubelet-extra-args --node-labels=lifecycle=Ec2Spot\"     Type: String    NodeGroupName:     Description: Unique identifier for the Node Group.     Type: String    ClusterControlPlaneSecurityGroup:     Description: The security group of the cluster control plane.     Type: AWS::EC2::SecurityGroup::Id    SharedNodeSecurityGroup:     Description: The security group for communication between all nodes in the cluster.     Type: AWS::EC2::SecurityGroup::Id    VpcId:     Description: The VPC of the worker instances     Type: AWS::EC2::VPC::Id    Subnets:     Description: The subnets where workers can be created.     Type: List&lt;AWS::EC2::Subnet::Id>    UnlimitedCredits:     Type: String     Description: \"Select yes if instance type t3,t2 family\"     AllowedValues: [yes, no]     Default: yes    PauseTime:     Type: String     Description: \"Select yes if you want pause node update\"     AllowedValues: [yes, no]     Default: yes    SetPauseTime:     Type: String     Description: \"Set delay for node update\"     Default: PT15M  Metadata:    AWS::CloudFormation::Interface:     ParameterGroups:       - Label:           default: EKS Cluster         Parameters:           - ClusterName           - ClusterControlPlaneSecurityGroup       - Label:           default: Worker Node Configuration         Parameters:           - NodeGroupName           - NodeAutoScalingGroupMinSize           - NodeAutoScalingGroupDesiredCapacity           - NodeAutoScalingGroupMaxSize           - NodeInstanceType           - NodeImageId           - NodeVolumeSize           - KeyName       - Label:           default: Worker Network Configuration         Parameters:           - VpcId           - Subnets  Conditions:   UsePauseTime: !Equals [!Ref PauseTime, yes]   UseUnlimitedCredits: !Equals [!Ref UnlimitedCredits, yes]  Resources:    NodeInstanceProfile:     Type: AWS::IAM::InstanceProfile     Properties:       Path: \"\/\"       Roles:         - !Ref NodeInstanceRole    NodeInstanceRole:     Type: AWS::IAM::Role     Properties:       AssumeRolePolicyDocument:         Version: 2012-10-17         Statement:           - Effect: Allow             Principal:               Service: ec2.amazonaws.com             Action: sts:AssumeRole       Path: \"\/\"       ManagedPolicyArns:         - arn:aws:iam::aws:policy\/AmazonEKSWorkerNodePolicy         - arn:aws:iam::aws:policy\/AmazonEKS_CNI_Policy         - arn:aws:iam::aws:policy\/AmazonEC2ContainerRegistryReadOnly         - !Sub 'arn:aws:iam::${AWS::AccountId}:policy\/ALB_Ingress_Controller'    NodeSecurityGroup:     Type: AWS::EC2::SecurityGroup     Properties:       GroupDescription: Security group for all nodes in the cluster       VpcId: !Ref VpcId       Tags:         - Key: !Sub kubernetes.io\/cluster\/${ClusterName}           Value: owned    NodeSecurityGroupIngress:     Type: AWS::EC2::SecurityGroupIngress     DependsOn: NodeSecurityGroup     Properties:       Description: Allow node to communicate with each other       GroupId: !Ref NodeSecurityGroup       SourceSecurityGroupId: !Ref NodeSecurityGroup       IpProtocol: -1       FromPort: 0       ToPort: 65535    NodeSecurityGroupFromControlPlaneIngress:     Type: AWS::EC2::SecurityGroupIngress     DependsOn: NodeSecurityGroup     Properties:       Description: Allow worker Kubelets and pods to receive communication from the cluster control plane       GroupId: !Ref NodeSecurityGroup       SourceSecurityGroupId: !Ref ClusterControlPlaneSecurityGroup       IpProtocol: tcp       FromPort: 1025       ToPort: 65535    ControlPlaneEgressToNodeSecurityGroup:     Type: AWS::EC2::SecurityGroupEgress     DependsOn: NodeSecurityGroup     Properties:       Description: Allow the cluster control plane to communicate with worker Kubelet and pods       GroupId: !Ref ClusterControlPlaneSecurityGroup       DestinationSecurityGroupId: !Ref NodeSecurityGroup       IpProtocol: tcp       FromPort: 1025       ToPort: 65535    NodeSecurityGroupFromControlPlaneOn443Ingress:     Type: AWS::EC2::SecurityGroupIngress     DependsOn: NodeSecurityGroup     Properties:       Description: Allow pods running extension API servers on port 443 to receive communication from cluster control plane       GroupId: !Ref NodeSecurityGroup       SourceSecurityGroupId: !Ref ClusterControlPlaneSecurityGroup       IpProtocol: tcp       FromPort: 443       ToPort: 443    ControlPlaneEgressToNodeSecurityGroupOn443:     Type: AWS::EC2::SecurityGroupEgress     DependsOn: NodeSecurityGroup     Properties:       Description: Allow the cluster control plane to communicate with pods running extension API servers on port 443       GroupId: !Ref ClusterControlPlaneSecurityGroup       DestinationSecurityGroupId: !Ref NodeSecurityGroup       IpProtocol: tcp       FromPort: 443       ToPort: 443    ClusterControlPlaneSecurityGroupIngress:     Type: AWS::EC2::SecurityGroupIngress     DependsOn: NodeSecurityGroup     Properties:       Description: Allow pods to communicate with the cluster API Server       GroupId: !Ref ClusterControlPlaneSecurityGroup       SourceSecurityGroupId: !Ref NodeSecurityGroup       IpProtocol: tcp       ToPort: 443       FromPort: 443    NodeGroup:     Type: AWS::AutoScaling::AutoScalingGroup     Properties:       DesiredCapacity: !Ref NodeAutoScalingGroupDesiredCapacity       MixedInstancesPolicy:         InstancesDistribution:           OnDemandAllocationStrategy: prioritized           OnDemandBaseCapacity: !Ref OnDemandBaseCapacity           OnDemandPercentageAboveBaseCapacity: !Ref OnDemandPercentageAboveBaseCapacity           SpotAllocationStrategy: lowest-price           SpotInstancePools: !Ref SpotInstancePools           # SpotMaxPrice: String         LaunchTemplate:           LaunchTemplateSpecification:             LaunchTemplateId: !Ref MyLaunchTemplate             # LaunchTemplateName: String             Version: !GetAtt MyLaunchTemplate.LatestVersionNumber           Overrides:             - InstanceType: !Select [0, !Split [ \",\", !Ref InstanceTypesOverride ] ]             - InstanceType: !Select [1, !Split [ \",\", !Ref InstanceTypesOverride ] ]             - InstanceType: !Select [2, !Split [ \",\", !Ref InstanceTypesOverride ] ]             - InstanceType: !Select [3, !Split [ \",\", !Ref InstanceTypesOverride ] ]       MinSize: !Ref NodeAutoScalingGroupMinSize       MaxSize: !Ref NodeAutoScalingGroupMaxSize       VPCZoneIdentifier:         !Ref Subnets       Tags:       - Key: Name         Value: !Sub \"${ClusterName}-${NodeGroupName}-Node\"         PropagateAtLaunch: 'true'       - Key: !Sub 'kubernetes.io\/cluster\/${ClusterName}'         Value: 'owned'         PropagateAtLaunch: 'true'     UpdatePolicy:       AutoScalingRollingUpdate:         MinInstancesInService: '1'         MaxBatchSize: '1'         PauseTime: !If [UsePauseTime, !Ref SetPauseTime, !Ref \"AWS::NoValue\"]    MyLaunchTemplate:     Type: AWS::EC2::LaunchTemplate     Properties:       LaunchTemplateName: !Sub \"eksLaunchTemplate-${AWS::StackName}\"       LaunchTemplateData:         CreditSpecification:            CpuCredits: !If [UseUnlimitedCredits, unlimited, !Ref \"AWS::NoValue\"]         TagSpecifications:           -             ResourceType: instance             Tags:               - Key: Name                 Value: !Sub \"${ClusterName}-${NodeGroupName}-ASG-Node\"               - Key: KubernetesCluster                 Value: !Ref ClusterName               - Key: !Sub 'kubernetes.io\/cluster\/${ClusterName}'                 Value: 'owned'         BlockDeviceMappings:         - DeviceName: \/dev\/xvda           Ebs:             VolumeSize: !Ref NodeVolumeSize             VolumeType: gp3             DeleteOnTermination: true         UserData: !Base64           \"Fn::Sub\": |             #!\/bin\/bash             set -o xtrace             iid=$(curl -s http:\/\/169.254.169.254\/latest\/meta-data\/instance-id)             export AWS_DEFAULT_REGION=${AWS::Region}             ilc=`aws ec2 describe-instances --instance-ids  $iid  --query 'Reservations[0].Instances[0].InstanceLifecycle' --output text`             if [ \"$ilc\" == \"spot\" ]; then               \/etc\/eks\/bootstrap.sh ${ClusterName} ${BootstrapArgumentsForSpotFleet}             else               \/etc\/eks\/bootstrap.sh ${ClusterName} ${BootstrapArgumentsForOnDemand}             fi             # \/etc\/eks\/bootstrap.sh ${ClusterName} $BootstrapArgumentsForOnDemand             \/opt\/aws\/bin\/cfn-signal --exit-code $? \\                      --stack  ${AWS::StackName} \\                      --resource NodeGroup  \\                      --region ${AWS::Region}         IamInstanceProfile:           Arn: !GetAtt NodeInstanceProfile.Arn         KeyName: !Ref KeyName         NetworkInterfaces:           -             DeviceIndex: 0             AssociatePublicIpAddress: 'false'             SubnetId: !Select [0, !Ref Subnets]             Groups:               - !Ref NodeSecurityGroup               - !Ref SharedNodeSecurityGroup         ImageId: !Ref NodeImageId         InstanceType: !Ref NodeInstanceType    LCH:     Type: AWS::AutoScaling::LifecycleHook     Properties:       AutoScalingGroupName: !Ref NodeGroup       HeartbeatTimeout: 60       DefaultResult: CONTINUE       LifecycleHookName: !Sub \"${NodeGroupName}-LCH\"       LifecycleTransition: autoscaling:EC2_INSTANCE_TERMINATING  Outputs:    NodeInstanceRole:     Description: The node instance role     Value: !GetAtt NodeInstanceRole.Arn    NodeSecurityGroup:     Description: The security group for the node group     Value: !Ref NodeSecurityGroup <\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u0438 \u0434\u0435\u043f\u043b\u043e\u0435 \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f Spot Fleet:<\/p>\n<p>  <\/p>\n<p><strong>\u041a\u0435\u0439\u04411<\/strong> \u2014 \u0434\u0435\u043f\u043b\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043d\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">NodeAutoScalingGroupDesiredCapacity: 5 #\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u043d\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0445\u043e\u0442\u0438\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 5  NodeAutoScalingGroupMinSize:3 #\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0441\u043a\u0435\u0439\u043b\u0438\u043d\u0433\u0430, \u0442\u043e\u0433\u0434\u0430 \u043e\u043f\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 desired capacity  NodeAutoScalingGroupMaxSize: 10 #\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0441\u043a\u0435\u0439\u043b\u0438\u043d\u0433\u0430, \u0442\u043e\u0433\u0434\u0430 \u043e\u043f\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 desired capacity  OnDemandBaseCapacity: 0 #\u0413\u0440\u0443\u043f\u043f\u0430 \u043d\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445  OnDemandPercentageAboveBaseCapacity: 0  #\u0413\u0440\u0443\u043f\u043f\u0430 \u043d\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445  InstanceTypesOverride: t3.medium,t2.medium,t3a.medium,t3.large #\u0422\u0438\u043f\u044b \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0443 \u0441\u0435\u0431\u044f \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438  SpotInstancePools: 12 #3 \u0437\u043e\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 * 4 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 = 12<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041a\u0435\u0439\u04412<\/strong> \u2014 \u0434\u0435\u043f\u043b\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043d\u043e\u0434 \u0441\u043f\u043e\u0442\u044b + on-demand \u0434\u043b\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0433\u0434\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u043e\u0434 \u0433\u0440\u043e\u0437\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043f\u043e\u0442\u0435\u0440\u044f\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0442\u0435 \u0436\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0447\u0442\u043e \u0438 \u0432\u044b\u0448\u0435 \u043a\u0440\u043e\u043c\u0435: <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> OnDemandBaseCapacity: 2 #\u0413\u0440\u0443\u043f\u043f\u0430 \u043d\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0442\u043e\u0433\u043e \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 2 \u043d\u043e\u0434\u044b on-demand \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0438 3 \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u043f\u043e \u0441\u043d\u0438\u0436\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043d\u0435 \u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0447\u0442\u043e \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432\u044b\u0448\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412 Cloudformation \u0441\u0442\u0435\u043a\u0435 \u0432\u044b\u0448\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e lowest-price \u0434\u043b\u044f \u0441\u043f\u043e\u0442\u043e\u0432 \u0438 prioritized \u0434\u043b\u044f on-demand \u043d\u043e\u0434.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">          OnDemandAllocationStrategy: prioritized           OnDemandBaseCapacity: !Ref OnDemandBaseCapacity           OnDemandPercentageAboveBaseCapacity: !Ref OnDemandPercentageAboveBaseCapacity           SpotAllocationStrategy: lowest-price           SpotInstancePools: !Ref SpotInstancePools<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"4-deploy-aws-node-termination-handler--dashbord--eventy\">4. \u0414\u0435\u043f\u043b\u043e\u0439 Aws Node Termination Handler + \u0434\u0430\u0448\u0431\u043e\u0440\u0434 + \u044d\u0432\u0435\u043d\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u0418 \u0442\u0430\u043a \u043d\u043e\u0434\u044b \u043c\u044b \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0438, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?! \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u043e\u0433\u0434\u0430 \u0430\u043c\u0430\u0437\u043e\u043d \u0448\u043b\u0435\u0442 \u0442\u0435\u0431\u0435 \u0432\u0435\u0441\u0442\u043e\u0447\u043a\u0443 \u0447\u0442\u043e \u0447\u0435\u0440\u0435\u0437 2 \u043c\u0438\u043d\u0443\u0442\u044b \u0442\u0432\u043e\u044f \u043d\u043e\u0434\u0430 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u043e\u0434 \u0434\u043b\u044f AWS EKS, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u043b\u043e\u0432\u0438\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437 \u043a\u0443\u0431\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>Aws Node Termination Handler <a href=\"https:\/\/github.com\/aws\/aws-node-termination-handler\" rel=\"nofollow noopener noreferrer\">GitHub<\/a><\/p>\n<p>  <\/p>\n<p>\u0417\u0430 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432 \u0432\u0430\u0448 \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443 \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 Queue Processor, \u043f\u043b\u044e\u0441\u044b \u0442\u0430\u043c \u0436\u0435 \u0432 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b. \u0412\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u044d\u0432\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0432\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432\u0441\u0435\u0433\u043e \u0432 1 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0432\u0430\u0448\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e SQS \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u043c\u0435\u0441\u0442\u043e daemonset-\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043f\u043e\u0442\u043e\u0432\u043e\u0439 \u043d\u043e\u0434\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0435\u0439\u0448\u043d \u044d\u0432\u0435\u043d\u0442\u044b \u043f\u043e \u0443\u0440\u043b\u0443 <a href=\"http:\/\/169.254.169.254\/latest\/meta-data\/spot\/instance-action\" rel=\"nofollow noopener noreferrer\">http:\/\/169.254.169.254\/latest\/meta-data\/spot\/instance-action<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c Aws Node Termination Handler \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 AWS, \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e:<\/p>\n<p>  <\/p>\n<ol>\n<li>IAM Role<\/li>\n<li>Openid Connect Provider for EKS<\/li>\n<li>SQS Queue &amp; SQS Queue Policy<\/li>\n<li>EventBridge rules<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 terraform \u043a\u043e\u0434 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442: <a href=\"https:\/\/github.com\/AmisGit\/awsspotfleet\" rel=\"nofollow noopener noreferrer\">Terraform code<\/a><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0442\u0430\u043a \u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0445\u0435\u043b\u043c \u0447\u0430\u0440\u0442, \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c: <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f serviceaccount.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">serviceaccount<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">serviceAccount:   # Specifies whether a service account should be created   create: true   # The name of the service account to use. If namenot set and create is true, a name is generated using fullname template   name:   annotations:     eks.amazonaws.com\/role-arn: arn:aws:iam::&lt;YOUR ACCOUNT ID>:role\/node-termination-handler<\/code><\/pre>\n<\/div><\/div>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c SQS Queue mode.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">enableSqsTerminationDraining<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># enableSqsTerminationDraining If true, this turns on queue-processor mode which drains nodes when an SQS termination event is received enableSqsTerminationDraining: true<\/code><\/pre>\n<\/div><\/div>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441\u0435\u0431\u0435, \u0441\u0441\u044b\u043b\u043a\u0430 + \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">webhooks<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># webhookURL if specified, posts event data to URL upon instance interruption action. webhookURL: \"https:\/\/xxx\"  # webhookTemplate if specified, replaces the default webhook message template. webhookTemplate: '{\"text\":\"[Instance Interruption]   \\nAWS Account: {{ .AccountId }}   \\nKind: {{ .Kind }}   \\nInstance: {{ .InstanceID }}   \\nNode: {{ .NodeName }}   \\nDescription: {{ .Description }}   \\nStart Time: {{ .StartTime }}   \\nEventID: {{ .EventID }}\"}'<\/code><\/pre>\n<\/div><\/div>\n<p>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c SQS.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">queueURL<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Listens for messages on the specified SQS queue URL queueURL: \"https:\/\/sqs.&lt;region>.amazonaws.com\/YOUR ACCOUNT ID\/AWSTerminationHandlerQueue\"<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u042f \u0442\u0430\u043a \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u043b \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u043d\u0438\u0442\u043e\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u043e\u0434\u044b \u0443\u0445\u043e\u0434\u044f\u0442 \u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043a\u043e\u043c\u0443 \u043d\u0430\u0434\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0447\u0442\u043e \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043c\u043d\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432\u0438\u0434\u043d\u043e \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e + \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0437\u0430 \u0434\u0435\u043d\u044c.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u044d\u0442\u043e \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b-\u0432\u043e \u043d\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0431\u0440\u0430\u043b \u0430\u043c\u0430\u0437\u043e\u043d \u0437\u0430 78 \u0434\u043d\u0435\u0439, \u043f\u0440\u0438 \u043e\u0431\u0449\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0432 46 \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u043d\u043e\u0434, \u0430\u043c\u0430\u0437\u043e\u043d \u0432 \u0434\u0435\u043d\u044c \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e 10 \u0448\u0442\u0443\u043a, \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0438 \u0438 \u043a\u043e\u043b-\u0432\u043e \u043d\u043e\u0434 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438\u043b\u0438 \u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0431\u043e \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/x5\/hz\/ju\/x5hzjufmlgw20qpwki-ttojcybe.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/x5\/hz\/ju\/x5hzjufmlgw20qpwki-ttojcybe.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u044d\u0432\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043e\u0442 AWS Node Termination Handler \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/um\/jr\/z7\/umjrz7llxiusod-dipqij1v8nt8.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/um\/jr\/z7\/umjrz7llxiusod-dipqij1v8nt8.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"5-kak-imenno-obrabatyvayutsya-sobytiya-i-pereezzhayut-pody\">5. \u041a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0436\u0430\u044e\u0442 \u043f\u043e\u0434\u044b<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0439:<\/p>\n<p>  <\/p>\n<ol>\n<li>AWS Node Termination Handler \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442 SQS Queue \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u044d\u0432\u0435\u043d\u0442\u043e\u0432<\/li>\n<li>\u0410\u043c\u0430\u0437\u043e\u043d \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u044d\u0432\u0435\u043d\u0442 \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0437\u0430\u0431\u0435\u0440\u0435\u0442 \u043d\u043e\u0434\u0443 \u0441 id xxx<\/li>\n<li>AWS Node Termination Handler \u043f\u0440\u0438\u043d\u044f\u043b \u044d\u0442\u043e\u0442 \u044d\u0432\u0435\u043d\u0442 \u0438\u0437 SQS Queue \u0438 \u0442\u0443\u0442 \u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b cordon \u0438 drain \u044d\u0442\u043e\u0439 \u043d\u043e\u0434\u0435<\/li>\n<li>\u0412\u0430\u0448\u0438 \u043f\u043e\u0434\u044b \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u0435<\/li>\n<li>\u041d\u043e\u0434\u0430 \u0443\u0448\u043b\u0430 \u0432 Terminate, \u0438 \u0442\u0430\u043a \u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u0441\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u043e\u0434 \u0432 \u043a\u0443\u0431\u0435\u0440\u0435<\/li>\n<li>Autoscale \u0433\u0440\u0443\u043f\u043f\u0430 \u0443\u0432\u0438\u0434\u0438\u0442 \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e desired \u043d\u043e\u0434 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u0438 \u0437\u0430\u043a\u0430\u0436\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u043f\u043e\u0442\u043e\u0432\u0443\u044e<\/li>\n<li>\u041d\u043e\u0434\u0430 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u0441\u044f \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443 \u0432\u0437\u0430\u043c\u0435\u043d \u0441\u0442\u0430\u0440\u043e\u0439. <\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0418 \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u0438\u044f, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u044d\u0442\u0438\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0438\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u044d\u0432\u0435\u043d\u0442\u044b \u0438\u043d\u043e\u0433\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 AWS Node Termination Handler \u0448\u043b\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431\u0445\u0443\u043a.<\/p>\n<p>  <\/p>\n<p>\u0410\u043c\u0430\u0437\u043e\u043d \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0449\u0435, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0430\u043c\u0430\u0437\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0443 \u0432\u0430\u0441 \u043d\u043e\u0434\u0443 \u0441 \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0442\u0443\u0442 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u043e \u0447\u0442\u043e \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442:<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/aws.amazon.com\/ec2\/spot\/instance-advisor\/\" rel=\"nofollow noopener noreferrer\">Spot Instance advisor<\/a><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/xp\/im\/0k\/xpim0kccqe1k1cqozins6bxe2mk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/xp\/im\/0k\/xpim0kccqe1k1cqozins6bxe2mk.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u0432\u0441\u0435 \u043e\u0442\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u043d\u0438 \u0431\u0443\u0434\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u043e\u0434, \u0443\u0431\u0435\u0434\u0438\u0432\u0448\u0438\u0441\u044c \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u043a drain, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b \u043d\u0435 \u043b\u043e\u0432\u0438\u0442\u0435 5\u0445\u0445 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c Graceful Shutdown \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e 5\u0445\u0445 \u0432\u0430\u0441 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442 \u0438 \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0446\u0435\u043b\u043e\u043c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u043e\u0442\u044b, \u044d\u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0438 \u0434\u0435\u0432 \u0441\u0440\u0435\u0434, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435, \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u0442\u0430\u043a\u0438\u043c \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"6-cluster-autoscaler--batch-etl-na-spotah-zhivoy-primer\">6. Cluster Autoscaler + Batch ETL \u043d\u0430 \u0441\u043f\u043e\u0442\u0430\u0445 \u0436\u0438\u0432\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0433\u0434\u0435 \u043c\u044b \u0435\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043f\u043e\u0442\u044b, \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0431\u0430\u0442\u0447\u0435\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438: <\/p>\n<p>  <\/p>\n<ul>\n<li>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 1 \u043d\u043e\u0447\u0438, \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0433\u0434\u0435 \u0442\u043e \u0432 10-11 \u0443\u0442\u0440\u0430<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 11 \u0443\u0442\u0440\u0430 \u0434\u043e 21 00 \u043d\u0438 \u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043d\u043e\u0434\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u044b<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 21 00 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e 1 \u043d\u043e\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0434\u043e 1 \u043d\u043e\u0447\u0438<\/li>\n<li>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u0434\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445 \u043e\u0442\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0433\u0440\u043e\u0437\u0438\u0442 \u0441\u0431\u043e\u0435\u043c \u0432\u0441\u0435\u0433\u043e \u043e\u0442\u0447\u0435\u0442\u0430, \u0440\u0435\u0441\u0442\u0430\u0440\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0432\u0441\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043a\u0430\u043a \u043d\u0438 \u043a\u0430\u043a, \u043a\u0441\u0442\u0430\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 Cluster AutoScaler + \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0435 \u043d\u043e\u0434\u044b, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u043c \u043d\u043e\u0434\u0430\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u043e\u0432\u044b\u0448\u0435 \u043f\u0440\u0438 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 on-demand \u0438 \u043e\u0442\u0447\u0435\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<p>  <\/p>\n<p>\u0414\u0435\u043f\u043b\u043e\u0438\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043d\u043e\u0434 \u043f\u043e\u0434 \u043e\u0442\u0447\u0435\u0442\u044b, \u0438 \u0441\u043a\u0435\u0439\u043b\u0438\u043c \u0435\u0451 \u0432 0 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u044b \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0430 \u044d\u0442\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u043d\u043e\u0434, Cluster Autoscaler \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0434, \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043e\u0432, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u044b \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442 \u0437\u0430\u0434\u0430\u0447 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, Cluster Autoscaler \u0441\u043a\u0435\u0439\u043b\u0438\u0442 \u043d\u0430\u0448\u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043d\u043e\u0434 \u043e\u043f\u044f\u0442\u044c \u0432 0.<\/p>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c requests &amp; limits \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u043f\u043e\u0434\u043e\u0432, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c Cluster Autoscaler \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0441\u043a\u0435\u0439\u043b\u0438\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0432 0. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0438\u0436\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431 Cluster Autoscaler \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 \u0435\u0433\u043e \u0445\u0435\u043b\u043c \u0447\u0430\u0440\u0442\u0430 \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0432\u044b\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/kubernetes\/autoscaler\" rel=\"nofollow noopener noreferrer\">Cluster Autoscaler GitHub<\/a><\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">Helm Chart Values<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">autoscalingGroups:   - name: NODE GROUP NAME     maxSize: 3     minSize: 0  extraArgs:   logtostderr: true   stderrthreshold: info   v: 4   scale-down-utilization-threshold: 0.5   daemonset-eviction-for-empty-nodes: true   scale-down-unneeded-time: 30m<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/fk\/ux\/um\/fkuxum_xxankzukmsg0jcszl0yk.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/fk\/ux\/um\/fkuxum_xxankzukmsg0jcszl0yk.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"7-vindovye-spoty-i-iis-prilozhenie\">7. \u0412\u0438\u043d\u0434\u043e\u0432\u044b\u0435 \u0441\u043f\u043e\u0442\u044b \u0438 IIS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u0435\u0439\u0441, \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0435 \u043d\u043e\u0434\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u0445 \u0433\u0434\u0435 \u043b\u0438\u043d\u0443\u043a\u0441\u043e\u0432\u044b\u0435 \u043d\u043e\u0434\u044b \u0442\u043e\u043b\u044c\u043a\u043e. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 AWS EKS \u0433\u0434\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043b\u0438\u043d\u0443\u043a\u0441\u043e\u0432\u044b\u0435 \u043d\u043e\u0434\u044b \u0442\u0430\u043a \u0438 \u043d\u043e\u0434\u044b \u043d\u0430 windows server core.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432\u0438\u043d\u0434\u043e\u0432\u044b\u0435 \u043d\u043e\u0434\u044b \u0432 \u0430\u043c\u0430\u0437\u043e\u043d\u0435 \u0441\u0442\u043e\u044f\u0442 \u0440\u0430\u0437\u0430 \u0432 2 \u0434\u043e\u0440\u043e\u0436\u0435, \u0438\u0437 \u0437\u0430 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0441\u043e \u0441\u043a\u0438\u0434\u043a\u043e\u0439 \u0432 50-70% \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043a\u043e\u0441\u0442\u044b \u0437\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0432\u0438\u043d\u0434\u043e\u0432\u044b\u0445 \u043d\u043e\u0434\u0430\u0445 \u0443 \u043d\u0430\u0441 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 IIS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0442\u0430\u043a \u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043a \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 drain \u043d\u0430 \u043d\u043e\u0434\u0443 \u043e\u0442 Aws Node Termination Handler.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c lifecycle preStop + terminationGracePeriodSeconds<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  lifecycle:       preStop:       exec:         command: [           \"iisreset\", \"\/stop\", \"\/noforce\"         ]      terminationGracePeriodSeconds: 60<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0441\u0435\u0441\u0441\u0438\u0439, \u0442\u043e \u0442\u0443\u0442 \u043d\u0430\u0434\u043e \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0440\u043e\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c, \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0448\u0435 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f \u043b\u0438\u0436 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u043d\u043e\u0434 \u0434\u043b\u044f \u0432\u0438\u043d\u0434\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0432\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0432\u0438\u043d\u0434\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0434\u0430 \u0432 2022 \u0432\u0438\u043d\u0434\u0435 \u043e\u043d\u0438 \u0441\u043d\u0438\u0437\u0438\u043b\u0438\u0441\u044c, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u0430\u043b\u0435\u043a\u0438 \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e\u0431 AMI \u043e\u0431\u0440\u0430\u0437\u0435 \u0441 \u0437\u0430\u043b\u0438\u0442\u044b\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0434\u043e\u043a\u0435\u0440 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 10-12 \u043c\u0438\u043d\u0443\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"8-podschet-ekonomii-na-zhivom-primere\">8. \u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043d\u0430 \u0436\u0438\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/h3>\n<p>  <\/p>\n<p>\u0418 \u0442\u0430\u043a \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0438\u043b\u0438 \u0434\u043e\u043c\u043e\u0442\u0430\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0432\u0430\u043c \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0434\u0438 \u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0441\u0435\u0434\u0430\u043d\u0438\u0439 \u0438 \u043e\u0431\u0432\u044f\u0437\u043e\u043a, \u0438 \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u043e\u043d\u043e \u0442\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0438\u043c\u0435\u0435\u043c:<\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b-\u0432\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u0445 \u043d\u043e\u0434<\/strong>: 46<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c:<\/p>\n<p>  <\/p>\n<p><strong>Linux<\/strong>:<br \/>  t3a.large \u2014 3<br \/>  m5.xlarge \u2014 2<br \/>  t3.xlarge \u2014 4<br \/>  m6i.xlarge \u2014 4<br \/>  t3.medium \u2014 16<br \/>  r6i.xlarge \u2014 2<br \/>  t3.large \u2014 4<\/p>\n<p>  <\/p>\n<p><strong>Windows<\/strong>:<br \/>  c6i.xlarge \u2014 6<br \/>  t3.medium \u2014 5<\/p>\n<p>  <\/p>\n<p><strong>\u0422\u043e\u0442\u0430\u043b<\/strong>:<br \/>  On-demand \u0446\u0435\u043d\u0430 Linux: <strong>2956.82$<\/strong><br \/>  On-demand \u0446\u0435\u043d\u0430 Windows: <strong>1964.75$<\/strong><br \/>  On-demand \u0446\u0435\u043d\u0430 \u0437\u0430 \u0432\u0441\u0435: <strong>4921,57$<\/strong><\/p>\n<p>  <\/p>\n<p><strong>\u043f\u0440\u043e\u0442\u0438\u0432<\/strong><\/p>\n<p>  <\/p>\n<p>Spot \u0446\u0435\u043d\u0430 Linux: <strong>829,224$<\/strong><br \/>  Spot \u0446\u0435\u043d\u0430 Windows: <strong>1148,688$<\/strong><br \/>  Spot \u0446\u0435\u043d\u0430 \u0437\u0430 \u0432\u0441\u0435: <strong>1977,912$<\/strong><\/p>\n<p>  <\/p>\n<p>*\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043f\u043e 1 \u0440\u0435\u0433\u0438\u043e\u043d\u0443 \u0438 \u043f\u043e 1 \u0437\u043e\u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438, \u0431\u0435\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c Saving Summary \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Spot Requests \u043d\u043e \u043e\u043d \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 3 \u0434\u043d\u044f.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yb\/7e\/ty\/yb7etyh1asbd_ggrhwlz9oedhpc.png\" data-src=\"https:\/\/habrastorage.org\/webt\/yb\/7e\/ty\/yb7etyh1asbd_ggrhwlz9oedhpc.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0418 \u0442\u0430\u043a \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u043f\u043e\u0442\u0430\u043c\u0438. \u0427\u0442\u043e \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043b\u043e\u0445\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0441\u0442\u0430\u0440\u0442 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043d\u0435 \u043e\u0442\u0447\u0430\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u0434\u043e\u043f\u0438\u0448\u0438\u0442\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 stateless, \u0438\u043b\u0438 \u0432\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0442\u0430\u043a \u0436\u0435 \u0431\u044b\u043b\u0430 \u043c\u0430\u0441\u0441\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e Gracefull Shutdown.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0435\u0442\u0435 \u044d\u0442\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u0435 \u0441\u043f\u043e\u0442\u044b, \u0432\u0430\u0448\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430 \u0440\u044f\u0434\u0443 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u0433\u0438\u0433\u0430\u043d\u0442\u0430\u043c\u0438 \u043a\u0430\u043a <strong>Lyft, Dropbox, Skyscanner<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u043f\u043e\u0442\u044b \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u0438 \u043f\u0440\u043e\u0434\u0430, \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0438 \u0431\u0430\u0442\u0447\u0435\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u044d\u043a\u043e\u043d\u043e\u043c\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447 \u0434\u043e\u043b\u043b\u0430\u0440\u043e\u0432. \u0427\u0435\u043c \u0442\u044b \u0445\u0443\u0436\u0435?)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><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\/post\/719052\/\"> https:\/\/habr.com\/ru\/post\/719052\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/dx\/jk\/et\/dxjketytre0tyd4v0qpdbtkvyiu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/dx\/jk\/et\/dxjketytre0tyd4v0qpdbtkvyiu.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u043f\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u043d\u043e\u0434\u0430\u043c\u0438 AWS, \u043a\u0430\u043a, \u0447\u0442\u043e, \u0438 \u043f\u043e\u0447\u0435\u043c\u0443? \u0410 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0436\u0438\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0441\u043f\u043e\u0442\u0430\u0445, \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u044d\u0442\u043e \u043a\u043e\u043b-\u0432\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u043d\u0435\u0433 $. \u0417\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0440\u043e\u0448\u0443 \u043a\u043e\u0434 \u043a\u0430\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-346051","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346051","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=346051"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346051\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}