处理多个Helm图表之间的共享Kubernetes对象 [英] Handling shared Kubernetes objects between multiple Helm charts

查看:113
本文介绍了处理多个Helm图表之间的共享Kubernetes对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近问了一个有关如何构建应捆绑在一起的多个应用程序的问题,并且正在考虑走一条路,让每个单独的应用程序拥有自己的Helm图表和自己的入口控制器.这样一来,CI/CD即可轻松更新每个组件,而不会影响其余组件.

I've recently asked a question about how to structure multiple applications which should be bundled together and am thinking of going down a route of having each separate application have it's own Helm chart and own ingress controller. This would allow for CI/CD to update each component easily without affecting the rest.

我还考虑在实际发行时使用伞形"图表指定其他图表的版本,并将其保存在另一个存储库中.

I was also thinking about using a "Umbrella" chart to specify versions of the other charts when it comes to actual releases and keep that in another repo.

但是,当将多个Helm图表与每个入口控制器一起使用时,我将如何处理它们之间共享的某些对象?例如机密,TLS发行者和这些之间共享的卷?我可以将它们放在伞形图中,但是随后我失去了能够在CI/CD中使用它的好处.我可以在每个图表中复制它们,但这对我来说似乎是错误的.我在想我需要另一个Helm图表来单独管理这些资源.

However, when using multiple Helm charts with an ingress controller for each, how would I handle some objects which are shared between them? Such as secrets, TLS issuers and volumes shared between these? I could put them in the umbrella chart but then I'd lose the benefit of being able to use this in CI/CD. I could duplicate them inside each individual chart but that seems wrong to me. I'm thinking that I'd need another Helm chart to manage these resources alone.

是否有建议的标准执行此操作?或者您会以什么方式推荐?

Is there a suggested standard for doing this or what way would you reccomend?

推荐答案

您可以创建一个舵图,并在其中创建应用A,应用B和共享图表的子图表,还可以定义共享对象的全局值,并在应用程序A&的主要子图表模板中使用此名称

You can create one helm chart and inside of it your subcharts for app A, app B, and Shared chart, and you can define global Values for shared objects, and use this names in templates of main subcharts of app A & B.

有关子图表和全局值的更多信息,请检查

For more information about subchart and global values, check this

这篇关于处理多个Helm图表之间的共享Kubernetes对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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