Helm managing a collection of services

杀马特。学长 韩版系。学妹 提交于 2019-12-12 19:21:36

问题


I have a Kubernetes cluster that runs a number of independent, discrete services. I want to use helm to deploy them, and I have made a helm chart for every individual resource.

However, now I want to be able to deploy the cluster as a single entity, but it is not clear to me how helm supports stitching together multiple charts.

When I look at example repos, they simply have every single template file in the template folder of a single chart, and then a giant, sprawling Values.yaml file.

To me, that seems unwieldly, especially crawling around a 2000 line Values.yaml looking for settings.

Is there any way to take a folder structure that looks like this:

helm
|____ Service1
      |_______ values.yaml
      |_______ templates
      Service2
      |_______ values.yaml
      |_______ templates
      Service3
      |_______ values.yaml
      |_______ templates

And package it into one deployment without manually merging and de-duping the files and values?


回答1:


Use helm subcharts

You'd need to have something like a meta-chart, myapps. Then you'd add a requirements.yaml file like so:

# myapp/requirements.yaml
dependencies:
  - name: Service1
    repository: http://localhost:10191
    version: 0.1.0
  - name: Service2
    repository: http://localhost:10191
    version: 0.1.0
  - name: Service3
    repository: http://localhost:10191
    version: 0.1.0



回答2:


We also have similar scenarios wherein we have independent applications that we either need to deploy together to address features that span across them or individually deployed to address bugs. We end up using helmfile (https://github.com/roboll/helmfile). Each application still maintain their own charts, using helmfile, we can deploy them altogether if need to.



来源:https://stackoverflow.com/questions/51545829/helm-managing-a-collection-of-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!