After deploying k3s on one of my servers (which I will post about later) I searched for a solution to manage the components deployed on it. My first thought was to use terraform, but it has several drawbacks when it comes to k8s and helm support. Additionally it needs managing unnecessary state files managing even for that simple task. While it may be worth sticking to one tool if everything is in it, this was not the case for me this time. Therefore, I began looking for something simpler, more as a code, and easier to use than firing all helm commands manually. That’s when I discovered helmfile.

Using helmfile, we can specify repositories and releases in a single file (in my case I stick to helmfile.yml). There’s nothing fancy or nothing complicated about it, and repositories can come from different sources - including URLs or even local files. The latter was particularly useful when configuring woodpecker to use unreleased version that required a small local change.

Here is sample configuration for renovate:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
repositories:
  - name: renovate
    url: https://docs.renovatebot.com/helm-charts

releases:
  - name: renovate
    chart: renovate/renovate
    version: 34.159.2
    namespace: gitea
    createNamespace: true
    cleanupOnFail: false
    devel: false
    installed: true
    skipDeps: false
    values:
    - renovate:
        config: |
          {
            "printConfig": true,

            "kubernetes": {
              "fileMatch": ["^k8s_.*\\.yaml$"]
            },
            "droneci": {
              "fileMatch": [".woodpecker.yml"]
            }
          }          
    - existingSecret: renovate-env