helm-charts

Trilium Helm Chart

This is the Helm Chart for Trilium, to easily deploy Trilium on your Kubernetes cluster. This chart leverages the bjw-s common library which inherits all the possible values of that template.

Please refer to the section “Modifying Deployed Resources” below on how to customize the deployment, or refer to the examples in the examples folder

Aside from the values.yaml, please also view the additional files in the templates folder to see the additional values that are provided to Helm, to create the Kubernetes release. These values can also be overridden, and the defaults should be completely unobtrusive to any changes that are commonly made.

If you find that a value in your release is inconsistent with those found in the values.yaml and the bjw-s common library, then they are being modified in the templates folder. Any value changes specified by the user override any values defined within this chart.

Requirements

Deploying

helm repo add trilium https://triliumnext.github.io/helm-charts
helm install --create-namespace --namespace trilium trilium trilium/trilium -f values.yaml

Example values

Below are some examples of what you could provide for the chart’s values, for additional examples, please check out the examples folder.

controllers:
  main:
    containers:
      trilium:
        image:
          repository: triliumnext/notes
          tag: v0.90.4
          pullPolicy: IfNotPresent
        env:
          key: "value"

persistence:
  data:
    enabled: true
    type: persistentVolumeClaim
    existingClaim: trilium-data-pvc

Using Helm CLI

helm repo add trilium https://triliumnext.github.io/helm-charts
helm install --create-namespace --namespace trilium trilium trilium/trilium

Using GitOps

If you want to use GitOps, essentially using a Git repository as the single source of truth for the applications in your cluster, you can use tools such as ArgoCD or Flux. Below is an example of what an “Application” that creates a Helm release in ArgoCD looks like:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: trilium
  namespace: argocd

spec:
  project: default
  source:
    chart: trilium
    repoURL: https://trilium-next.github.io/helm-charts
    targetRevision: 1.0.3
    helm:
      values: |
        controllers:
          main:
            containers:
              trilium:
              image:
                repository: zadam/trilium
                tag: 0.63.7
                pullPolicy: IfNotPresent
              env:
                key: "value"

		persistence:
		  data:
			enabled: true
			type: persistentVolumeClaim
			existingClaim: my-claim-1
  destination:
    server: "https://kubernetes.default.svc"
    namespace: apps
  syncPolicy:
    automated:
      prune: true
      selfHeal: true 

Modifying Deployed Resources

Often times, modifications need to be made to a Helm chart to allow it to operate in your Kubernetes cluster. By utilizing bjw-s’s common library, there are quite a few options that can be easily modified.

Anything you see here, including the top-level keys, can be added and subtracted from this chart’s values.yaml.

For example, if you wished to create a serviceAccount, refer to the values here, and override them as needed. So, to create a serviceAccount, you would want to add YAML below to your Helm release values:

serviceAccount:
  create: true

Then, (for some reason), if you wished to change the Deployment type to DaemonSet, (referencing the values here), you could do the following:

controllers:
  main:
    type: daemonset

Development

To use Helm in order to create the individual Kubernetes manifests needed to deploy it “by hand”, you can use the following commands:

git clone https://github.com/TriliumNext/helm-charts
cd helm-chart/charts/trilium
helm dependency update
helm package .
helm template test1 . --namespace testing -f values.yaml --debug > output.yaml