{"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\/es\/blog\/administrirovanie\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm","title":{"rendered":"Una forma sencilla y segura de automatizar despliegues canarios usando Helm","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Una forma sencilla y segura de automatizar despliegues canarios usando Helm\" src=\"\/wp-content\/uploads\/2019\/09\/255c7f20fb17c079b8a59ced9c092088.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nEl despliegue canario es una forma muy eficaz de probar nuevo c\u00f3digo en un subconjunto de usuarios. Reduce significativamente la carga de tr\u00e1fico, lo que puede generar problemas durante el despliegue, ya que ocurre solo dentro de un grupo espec\u00edfico. Esta nota se dedica a c\u00f3mo organizar dicho despliegue utilizando Kubernetes y la automatizaci\u00f3n del despliegue. <i>Se supone que sabes algo sobre Helm y los recursos de Kubernetes<\/i>. <br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\n<img decoding=\"async\" alt=\"Una forma sencilla y segura de automatizar despliegues canarios usando Helm\" src=\"\/wp-content\/uploads\/2019\/09\/e8501460ddbfe797d036a399680032c1.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nUn despliegue canario simple en Kubernetes incluye dos recursos clave: el servicio y la herramienta de despliegue. El despliegue canario funciona a trav\u00e9s de un servicio que interact\u00faa con dos recursos diferentes que manejan el tr\u00e1fico de actualizaci\u00f3n. Uno de estos recursos trabajar\u00e1 con la versi\u00f3n 'canaria', y el otro con la estable. En esta situaci\u00f3n, podemos regular la cantidad de versiones canarias para reducir la carga de tr\u00e1fico que se requiere atender. Si, por ejemplo, prefieres usar YAML, se ver\u00e1 de la siguiente manera en Kubernetes: <\/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 # El selector dirigir\u00e1 el tr\u00e1fico a ambos despliegues.<\/code><\/pre>\n<p>\nEs a\u00fan m\u00e1s f\u00e1cil visualizar esta opci\u00f3n en kubectl, y en <noindex><a rel=\"nofollow\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/cluster-administration\/manage-deployment\/#canary-deployments\">la documentaci\u00f3n de Kubernetes<\/a><\/noindex> incluso hay un tutorial completo para este escenario. Pero la pregunta principal de este post es c\u00f3mo planeamos automatizar este proceso utilizando Helm. <\/p>\n<h3>Automatizaci\u00f3n del despliegue canario <\/h3>\n<p>\nPrimero, necesitaremos un gr\u00e1fico de charts de Helm que ya incluya los recursos que discutimos arriba. Deber\u00eda verse aproximadamente as\u00ed:<\/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>\nLa base del concepto de Helm es la gesti\u00f3n de versiones m\u00faltiples de lanzamientos. La versi\u00f3n estable es nuestra rama principal y estable del c\u00f3digo del proyecto. Pero con Helm podemos desplegar un lanzamiento canario con nuestro c\u00f3digo experimental. Lo principal es mantener el intercambio de tr\u00e1fico entre la versi\u00f3n estable y el lanzamiento canario. Gestionaremos todo esto con un selector especial:<\/p>\n<pre><code class=\"xml\">selector:\n  app.kubernetes.io\\\/name: myapp<\/code><\/pre>\n<p>\nNuestros recursos de despliegue, tanto \"canarios\" como estables, indicar\u00e1n esta etiqueta en los m\u00f3dulos. Si se configura todo correctamente, durante el despliegue de la versi\u00f3n canaria de nuestro gr\u00e1fico Helm, veremos que el tr\u00e1fico se dirige a los m\u00f3dulos reci\u00e9n desplegados. La versi\u00f3n estable de este comando ser\u00e1 as\u00ed: <\/p>\n<pre><code class=\"xml\">helm upgrade\n  --install myapp \n  --namespace default \n  --set app.name=myapp       # Se incluye en app.kubernetes.io\/name\n  --set app.version=v1       # Se incluye en app.kubernetes.io\/version\n  --set image.tag=stable \n  --set replicaCount=5<\/code><\/pre>\n<p>\nAhora comprobamos nuestro lanzamiento canario. Para desplegar la versi\u00f3n canaria, debemos recordar dos cosas. El nombre del lanzamiento debe ser diferente, para que no actualicemos la versi\u00f3n estable actual. La versi\u00f3n y la etiqueta tambi\u00e9n deben ser diferentes, para que podamos desplegar otro c\u00f3digo y determinar diferencias por etiquetas de recursos. <\/p>\n<pre><code class=\"xml\">helm upgrade\n  --install myapp-canary \n  --namespace default \n  --set app.name=myapp       # Se incluye en app.kubernetes.io\/name\n  --set app.version=v2       # Se incluye en app.kubernetes.io\/version\n  --set image.tag=canary \n  --set replicaCount=1<\/code><\/pre>\n<p>\n\u00a1Y eso es todo! Si hacemos ping al servicio, veremos que la actualizaci\u00f3n canaria dirige el tr\u00e1fico solo parte del tiempo. <\/p>\n<p>\nSi est\u00e1s buscando herramientas de automatizaci\u00f3n de despliegue que incluyan la l\u00f3gica descrita, presta atenci\u00f3n a <noindex><a rel=\"nofollow\" href=\"https:\/\/deliverybot.github.io\/\">Deliverybot<\/a><\/noindex> y en <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/deliverybot\/helm\">herramientas de automatizaci\u00f3n de Helm en GitHub<\/a><\/noindex>. Los gr\u00e1ficos de Helm utilizados para implementar el m\u00e9todo descrito anteriormente se encuentran en Github, <noindex><a rel=\"nofollow\" href=\"http:\/\/github.com\/deliverybot\/helm\/charts\">aqu\u00ed<\/a><\/noindex>. En general, esta fue una revisi\u00f3n te\u00f3rica de c\u00f3mo implementar la automatizaci\u00f3n del despliegue de versiones canarias en la pr\u00e1ctica, con conceptos y ejemplos concretos.<br \/>\n<br \/>Fuente: <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 - 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\/es\/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\" \/>\n\t\t<meta property=\"og:locale\" content=\"es_ES\" \/>\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\/es\/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\udd47Una forma sencilla y segura de automatizar despliegues canarios con Helm | ProHoster","description":"Canario.","canonical_url":"https:\/\/prohoster.info\/es\/blog\/administrirovanie\/prostoj-i-bezopasnyj-sposob-avtomatizatsii-kanareechnyh-deploev-s-pomoshhyu-helm","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"es_ES","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\/es\/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\/es\/wp-json\/wp\/v2\/posts\/38312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/comments?post=38312"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/posts\/38312\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/media\/28760"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/media?parent=38312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/categories?post=38312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/es\/wp-json\/wp\/v2\/tags?post=38312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}