Is there a declarative way to install helm charts in a kuberenetes cluster

3/13/2019

I am just wondering if anyone has figured out a declarative way to have helm charts installed/configured as part of a cluster initiation and that could be checked into source control. Using Kuberenetes I have very much gotten used to the "everything as code" type of workflow and I realize that installing and configuring helm is based mostly on imperative workflows via the CLI.

The reason I am asking is because currently we have our cluster in development and will be recreating it in production. Most of our configuration has been done declaratively via the deployment.yaml file. However we have spent a significant amount of time installing and configuring certain helm charts (e.g. prometheus, grafana etc.)

-- Josh L
azure-aks
kubectl
kubernetes
kubernetes-helm

2 Answers

3/13/2019

My team had a similar kind of problem and we solved it with Operators. And the best part about of Operators is that there are 3 kinds and one of them is Helm based.

So you could use a Helm Based Operator , create an associated CRD and then declare your configurations there. Those configurations are then ported directly to the Helm chart without you, as the user, having to do anything.

--
Source: StackOverflow

3/13/2019

There a tools like helmfile or helmsman which allow you to declare to be installed Helm releases as code.

Here is an example from a helmfile.yaml doing so:

releases:
  # Published chart example
  - name: promnorbacxubuntu         # name of this release
    namespace: prometheus              # target namespace
    chart: stable/prometheus             # the chart being installed to create this release, referenced by `repository/chart` syntax
    set:                                   # values (--set)
      - name: rbac.create
        value: false

Running helmfile charts will then ensure that all listed releases are installed

-- Lukas Eichler
Source: StackOverflow