创建自定义掌舵图

Create custom helm charts

我正在使用 helm 图表创建部署微服务,通过执行 helm create 它创建了包含部署、服务和入口的基本图表,但我几乎没有其他配置,例如水平 Pod 自动缩放器、Pod 中断预算。

我目前所做的是复制 yaml 并进行相应更改,但这需要很多时间,而且我不认为这是(正确的 way/best 做法)。

helm create <chartname>

我想知道如何创建 helm charts 以及如何进行额外配置。

Bitnami 的 guide to creating your first helm chart describes helm create as "the best way to get started" and says that "if you already have definitions for your application, all you need to do is replace the generated YAML files for your own". The approach is also suggested in the official helm docs and the chart developer guide。所以你是在按照最好的建议行事。

如果有一个向导可以用来获取现有的 kubernetes yaml 文件并从中制作一个 helm 图表,那就太棒了。当前可用的一种工具是 chartify. It is listed on helm's related projects page(我看不到任何其他相关的工具)。

您可以尝试使用 Move2Kube。您必须将所有 yaml(如果源是 kubernetes yaml)或其他源工件放在目录中(例如 src)并执行 move2kube translate -s src/.

在出现的向导中,您可以选择 helm 而不是 yamls,它将为您创建一个舵图。