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 proccesed the same way CLI tool does with following options:

  • --wait
  • --wait-for-jobs
  • --timeout 10m

It is possible to customize timeout by using .Timeout field.

Chart configuration

FieldDefault valueDescription
name-Release name
chartname-chartname in form “repository/chartname” or path to tgz file
version-version to install
timeout10mtimeout to wait for release install
values-yaml as a string, custom chart values
namespace-namespace to install chart into
order0order 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.

  1. spec:
  2. extensions:
  3. helm:
  4. concurrencyLevel: 5
  5. repositories:
  6. - name: stable
  7. url: https://charts.helm.sh/stable
  8. - name: prometheus-community
  9. url: https://prometheus-community.github.io/helm-charts
  10. - name: helm-repo-with-auth
  11. url: https://can-be-your-own-gitlab-ce-instance.org/api/v4/projects/PROJECTID/packages/helm/main
  12. username: access-token-name-as-username
  13. password: access-token-value-as-password
  14. charts:
  15. - name: prometheus-stack
  16. chartname: prometheus-community/prometheus
  17. version: "14.6.1"
  18. timeout: 20m
  19. order: 1
  20. values: |
  21. alertmanager:
  22. persistentVolume:
  23. enabled: false
  24. server:
  25. persistentVolume:
  26. enabled: false
  27. namespace: default
  28. # We don't need to specify the repo in the repositories section for OCI charts
  29. - name: oci-chart
  30. chartname: oci://registry:8080/chart
  31. version: "0.0.1"
  32. order: 2
  33. values: ""
  34. namespace: default
  35. # Other way is to use local tgz file with chart
  36. # the file must exist on all controller nodes
  37. - name: tgz-chart
  38. chartname: /tmp/chart.tgz
  39. version: "0.0.1"
  40. order: 2
  41. values: ""
  42. 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.