Skip to content

Helm Charts#

Defining your extensions as Helm charts is one of two methods you can use to run k0s with your preferred extensions (the other being through the use of Manifest Deployer).

k0s supports two methods for deploying applications using Helm charts:

  • Use Helm command in runtime to install applications. Refer to the Helm Quickstart Guide for more information.
  • Insert Helm charts directly into the k0s configuration file, k0s.yaml. This method does not require a separate install of helm tool and the charts automatically deploy at the k0s bootstrap phase.

Helm charts in k0s configuration#

Adding Helm charts into the k0s configuration file gives you a declarative way in which to configure the cluster. k0s controller manages the setup of Helm charts that are defined as extensions in the k0s configuration file.

Wait for install#

Each chart is processed the same way CLI tool does with following options:

  • --wait
  • --wait-for-jobs

It is possible to customize the timeout by using the `timeout' field.

Chart configuration#

Field Default value Description
name - Release name
chartname - chartname in form "repository/chartname" or path to tgz file
version - version to install
timeout - timeout to wait for release install
values - yaml as a string, custom chart values
namespace - namespace to install chart into
order 0 order to apply manifest. For equal values, alphanum ordering is used

Example#

In the example, Prometheus is configured from "stable" Helms chart repository. Add the following to k0s.yaml and restart k0s, after which Prometheus should start automatically with k0s.

spec:
  extensions:
    helm:
      concurrencyLevel: 5
      repositories:
      - name: stable
        url: https://charts.helm.sh/stable
      - name: prometheus-community
        url: https://prometheus-community.github.io/helm-charts
      - name: helm-repo-with-auth
        url: https://can-be-your-own-gitlab-ce-instance.org/api/v4/projects/PROJECTID/packages/helm/main
        username: access-token-name-as-username
        password: access-token-value-as-password
      charts:
      - name: prometheus-stack
        chartname: prometheus-community/prometheus
        version: "14.6.1"
        timeout: 20m
        order: 1
        values: |
          alertmanager:
            persistentVolume:
              enabled: false
          server:
            persistentVolume:
              enabled: false
        namespace: default
      # We don't need to specify the repo in the repositories section for OCI charts
      - name: oci-chart
        chartname: oci://registry:8080/chart
        version: "0.0.1"
        order: 2
        values: ""
        namespace: default
      # Other way is to use local tgz file with chart
      # the file must exist on all controller nodes
      - name: tgz-chart
        chartname: /tmp/chart.tgz
        version: "0.0.1"
        order: 2 
        values: ""
        namespace: default

Example extensions that you can use with Helm charts include:

Helm debug logging#

Running k0s controller with --debug=true enables helm debug logging.