{"id":38312,"date":"2019-10-31T22:22:55","date_gmt":"2019-10-31T19:22:55","guid":{"rendered":"https:\/\/prohoster.info\/blog\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm\/"},"modified":"2019-10-31T22:22:55","modified_gmt":"2019-10-31T19:22:55","slug":"prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm","status":"publish","type":"post","link":"https:\/\/prohoster.info\/ro\/blog\/administrirovanie\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm","title":{"rendered":"O metod\u0103 simpl\u0103 \u0219i sigur\u0103 de automatizare a implement\u0103rilor canar cu ajutorul Helm","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"O metod\u0103 simpl\u0103 \u0219i sigur\u0103 de automatizare a implement\u0103rilor canar cu ajutorul Helm\" src=\"\/wp-content\/uploads\/2019\/09\/255c7f20fb17c079b8a59ced9c092088.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nImplementarea canariei este o metod\u0103 foarte eficient\u0103 de testare a unui nou cod pe un subset de utilizatori. Aceasta reduce semnificativ \u00eenc\u0103rc\u0103tura de trafic, ceea ce poate provoca probleme \u00een timpul desf\u0103\u0219ur\u0103rii, deoarece are loc doar \u00een cadrul unei subgrupuri definite. Aceast\u0103 not\u0103 este dedicat\u0103 modului de organizare a unei astfel de desf\u0103\u0219ur\u0103ri prin intermediul Kubernetes \u0219i a automatiz\u0103rii desf\u0103\u0219ur\u0103rii. <i>Se presupune c\u0103 \u0219ti\u021bi c\u00e2te ceva despre Helm \u0219i resursele Kubernetes.<\/i>. <br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\n<img decoding=\"async\" alt=\"O metod\u0103 simpl\u0103 \u0219i sigur\u0103 de automatizare a implement\u0103rilor canar cu ajutorul Helm\" src=\"\/wp-content\/uploads\/2019\/09\/e8501460ddbfe797d036a399680032c1.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nO desf\u0103\u0219urare simpl\u0103 canarie \u00een Kubernetes include dou\u0103 resurse cheie: serviciul \u00een sine \u0219i instrumentul de desf\u0103\u0219urare. Desf\u0103\u0219urarea canarie func\u021bioneaz\u0103 printr-un singur serviciu care interac\u021bioneaz\u0103 cu dou\u0103 resurse diferite, care gestioneaz\u0103 traficul de actualizare. Una dintre aceste resurse va func\u021biona cu versiunea \u201ecanarie\u201d, iar a doua \u2014 cu versiunea stabil\u0103. \u00cen aceast\u0103 situa\u021bie, putem regla cantitatea de versiuni canarie pentru a reduce volumul de trafic ce trebuie gestionat. Dac\u0103, de exemplu, prefera\u021bi s\u0103 folosi\u021bi Yaml, aceasta ar ar\u0103ta \u00een Kubernetes astfel: <\/p>\n<pre><code class=\"xml\">kind: Deployment\nmetadata:\n  name: app-canary\n  labels:\n    app: app\nspec:\n  replicas: 1\n  ...\n    image: myapp:canary\n---\nkind: Deployment\nmetadata:\n  name: app\n  labels:\n    app: app\nspec:\n  replicas: 5\n  ...\n    image: myapp:stable\n---\nkind: Service\nselector:\n  app: app # Selectorul va ruta traficul c\u0103tre ambele desf\u0103\u0219ur\u0103ri.<\/code><\/pre>\n<p>\nUn alt mod simplu de a vizualiza acest scenariu este prin kubectl, iar \u00een <noindex><a rel=\"nofollow\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/cluster-administration\/manage-deployment\/#canary-deployments\">documenta\u021bia Kubernetes<\/a><\/noindex> exist\u0103 chiar un tutorial complet pentru acest scenariu. \u00cens\u0103 \u00eentrebarea principal\u0103 a acestui post este cum ne propunem s\u0103 automatiz\u0103m acest proces folosind Helm. <\/p>\n<h3>Automatizarea desf\u0103\u0219ur\u0103rii canariei <\/h3>\n<p>\n\u00cen primul r\u00e2nd, avem nevoie de o hart\u0103 Helm a charturilor, \u00een care sunt deja incluse resursele discutate mai sus. Aceasta ar trebui s\u0103 arate cam a\u0219a:<\/p>\n<pre><code class=\"xml\">~\\\/charts\\\/app\n\u251c\u2500\u2500 Chart.yaml\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 templates\n\u2502   \u251c\u2500\u2500 NOTES.txt\n\u2502   \u251c\u2500\u2500 _helpers.tpl\n\u2502   \u251c\u2500\u2500 deployment.yaml\n\u2502   \u2514\u2500\u2500 service.yaml\n\u2514\u2500\u2500 values.yaml<\/code><\/pre>\n<p>\nBaza conceptului Helm este gestionarea versiunilor multiple ale eliber\u0103rilor. Versiunea stabil\u0103 este ramura principal\u0103 stabil\u0103 a codului proiectului nostru. Dar cu ajutorul Helm, putem desf\u0103\u0219ura o eliberare canarie cu codul nostru experimental. Principalul aspect este s\u0103 men\u021binem schimbul de trafic \u00eentre versiunea stabil\u0103 \u0219i eliberarea canarie. Vom gestiona totul cu ajutorul unui selector special:<\/p>\n<pre><code class=\"xml\">selector:\n  app.kubernetes.io\\\/name: myapp<\/code><\/pre>\n<p>\nResursele noastre, at\u00e2t cele \u00abcanar\u00bb, c\u00e2t \u0219i cele stable de desf\u0103\u0219urare, vor indica aceast\u0103 etichet\u0103 pe module. Dac\u0103 totul este configurat corect, \u00een timpul desf\u0103\u0219ur\u0103rii versiunii canar a graficului nostru Helm, vom observa c\u0103 traficul va fi redirec\u021bionat c\u0103tre modulele nou desf\u0103\u0219urate. Versiunea stabil\u0103 a acestei comenzi va ar\u0103ta astfel: <\/p>\n<pre><code class=\"xml\">helm upgrade\n  --install myapp \n  --namespace default \n  --set app.name=myapp       # Merge \u00een app.kubernetes.io\/name\n  --set app.version=v1       # Merge \u00een app.kubernetes.io\/version\n  --set image.tag=stable \n  --set replicaCount=5<\/code><\/pre>\n<p>\nAcum s\u0103 verific\u0103m lansarea noastr\u0103 canar. Pentru a desf\u0103\u0219ura versiunea canar, trebuie s\u0103 \u021binem cont de dou\u0103 lucruri. Numele lans\u0103rii trebuie s\u0103 fie diferit, astfel \u00eenc\u00e2t s\u0103 nu aplic\u0103m o actualizare pe versiunea stabil\u0103 actual\u0103. Versiunea \u0219i eticheta trebuie, de asemenea, s\u0103 fie diferite, pentru a putea desf\u0103\u0219ura un cod diferit \u0219i a determina diferen\u021bele pe baza etichetelor resurselor. <\/p>\n<pre><code class=\"xml\">helm upgrade\n  --install myapp-canary \n  --namespace default \n  --set app.name=myapp       # Merge \u00een app.kubernetes.io\/name\n  --set app.version=v2       # Merge \u00een app.kubernetes.io\/version\n  --set image.tag=canary \n  --set replicaCount=1<\/code><\/pre>\n<p>\nAsta e tot! Dac\u0103 ping\u0103m serviciul, putem vedea c\u0103 actualizarea canar redirec\u021bioneaz\u0103 traficul doar o parte din timp. <\/p>\n<p>\nDac\u0103 c\u0103uta\u021bi instrumente de automatizare a desf\u0103\u0219ur\u0103rii care includ logica descris\u0103, atunci arunca\u021bi o privire asupra <noindex><a rel=\"nofollow\" href=\"https:\/\/deliverybot.github.io\/\">Deliverybot<\/a><\/noindex> \u0219i pe <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/deliverybot\/helm\">instrumentelor de automatizare Helm de pe GitHub<\/a><\/noindex>. Graficele Helm folosite pentru implementarea metodei descrise mai sus se afl\u0103 pe GitHub, <noindex><a rel=\"nofollow\" href=\"http:\/\/github.com\/deliverybot\/helm\/charts\">aici<\/a><\/noindex>. \u00cen general, aceasta a fost o revizuire teoretic\u0103 a modului de implementare a automatiz\u0103rii desf\u0103\u0219ur\u0103rii versiunilor canar \u00een practic\u0103, cu concepte \u0219i exemple specifice.<br \/>\n<br \/>Sursa: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/itsumma\/blog\/468013\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u0430\u043d\u0430\u0440\u0435\u0435\u0447\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041e\u043d \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a-\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0433\u0440\u0443\u043f\u043f\u044b. \u042d\u0442\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Kubernetes \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u043f\u043b\u043e\u044f. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u043a\u043e\u0435-\u0447\u0442\u043e \u0437\u043d\u0430\u0435\u0442\u0435 \u043e Helm \u0438 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":28760,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-38312","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u0430\u043d\u0430\u0440\u0435\u0435\u0447\u043d\u044b\u0439.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/ro\/blog\/administrirovanie\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"ro_RO\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u043d\u0430\u0440\u0435\u0435\u0447\u043d\u044b\u0445 \u0434\u0435\u043f\u043b\u043e\u0435\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Helm | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u0430\u043d\u0430\u0440\u0435\u0435\u0447\u043d\u044b\u0439.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/ro\/blog\/administrirovanie\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:22:55+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:22:55+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47O modalitate simpl\u0103 \u0219i sigur\u0103 de a automatiza desf\u0103\u0219ur\u0103rile canar cu ajutorul Helm | ProHoster","description":"Canar.","canonical_url":"https:\/\/prohoster.info\/ro\/blog\/administrirovanie\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"ro_RO","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u043d\u0430\u0440\u0435\u0435\u0447\u043d\u044b\u0445 \u0434\u0435\u043f\u043b\u043e\u0435\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Helm | ProHoster","og:description":"\u041a\u0430\u043d\u0430\u0440\u0435\u0435\u0447\u043d\u044b\u0439.","og:url":"https:\/\/prohoster.info\/ro\/blog\/administrirovanie\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:22:55+00:00","article:modified_time":"2019-10-31T19:22:55+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"38312","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-23 21:27:22","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 01:11:24","updated":"2026-01-23 21:27:22","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts\/38312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/comments?post=38312"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts\/38312\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/media\/28760"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/media?parent=38312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/categories?post=38312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/tags?post=38312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}