为基于微服务的应用程序设计Helm图表 [英] Designing Helm charts for microservices based application

查看:54
本文介绍了为基于微服务的应用程序设计Helm图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在构建一个由4个微服务(a,b,c,d)组成的应用程序.我们希望将Kubernetes Helm纳入CI/CD流程的一部分.

I'm currently building an application that is composed of 4 microservices (a, b, c, d). We would like to make Kubernetes Helm part of our CI/CD pipeline.

我们正在讨论如何最好地定义图表,并想知道社区的建议.

We are at the point where we're discussing how best to define the charts and was wondering was the advice from the community.

我们当前的选项似乎是:

Our current options appear to be:

  1. 每个微服务的图表(因此有4个图表)
  2. 每个应用程序流"的图表(服务a调用b,服务c调用d,因此总共2张图表)
  3. 部署所有4个微服务的单个图表
  4. 1和3.的某种组合,我们利用Helm的依赖项功能

可能值得一提:

  • 我们目前不要求隔离部署任何微服务,例如使它可用于单独的应用程序.
  • 我们可能需要具备独立扩展任何微服务的能力,即不能简单地复制所有4个服务.

我之所以提及这些要求,是因为我认为它们可能与图表设计有关.

I'm mentioning these requirements because I feel that they may be relevant to the chart design.

推荐答案

可能是一个较晚的答案,但FWIW,这取决于您开发微服务应用程序的方式和位置.如果每个微服务都有自己的存储库和CI管道,则也有必要将图表分开(每个服务一个).但是,如果所有服务都在同一个仓库中,并且使用单个ci管道进行部署,则单个图表更合适.

Might be a late answer, but FWIW, it depends on how and where you develop your microservices app. If each microservice has it's own repo and CI pipeline, then it makes sense to separate the charts as well (one per service). However, if all services are in the same repo and deployed with a single ci pipeline, then a single chart is a better fit.

您所有的4个选项都可以使用.而且,无论您是使用单独的图表还是使用单独的图表来部署应用程序,只要最终将部署所有服务,都没有任何区别.

All your 4 options will work. And whether you deploy your app with separate charts or with one won't make any difference as long as eventually all your services will be deployed.

关于独立扩展服务,如果您在一张大图表中为服务使用单独的部署,则可以通过在values.yaml中为每个部署使用输入值来分别扩展服务...因此,这并不是迫使您进行扩展的原因拆分图表.

As for scaling services independently, if you use separate deployments for your services in one big chart, you can scale them separately by using input values for each deployment in your values.yaml ... so it's not something which forces you to split your charts.

对于注释中的图像更改问题,只需要使用新的图像标签对已安装的发行版进行升级.

And for your image changing question in the comments, it only needs an upgrade for your installed release with the new image tag.

顺便说一句,我们使用 helmsman 从我们代码中的头盔图表进行部署(和管理) CI/CD管道.可能对您有用;)

By the way, We use helmsman for deploying (and managing) helm charts from code in our CI/CD pipelines. Might be useful for you ;)

这篇关于为基于微服务的应用程序设计Helm图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆