From f0a1da6c1884a119d04aa25c2daf63caf187e290 Mon Sep 17 00:00:00 2001 From: perfectra1n <jonfuller2012@gmail.com> Date: Fri, 13 Sep 2024 21:45:19 -0700 Subject: [PATCH] Update README.md --- README.md | 102 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 80 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index daefecd..2050300 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,58 @@ -# ||WIP|| Trilium Helm Chart +# 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](https://github.com/bjw-s/helm-charts/blob/common-3.1.0/charts/library/common/values.yaml) to further increase the ease of use when deploying. Please view the previous link to see what values you can change/tweak to your needs [here](https://github.com/bjw-s/helm-charts/blob/common-3.1.0/charts/library/common/values.yaml). +This is the Helm Chart for Trilium, to easily deploy Trilium on your Kubernetes cluster. This chart leverages the [bjw-s common library](https://github.com/bjw-s/helm-charts/blob/common-3.3.2/charts/library/common/values.yaml) which inherits all the possible [values](https://github.com/bjw-s/helm-charts/blob/common-3.3.2/charts/library/common/values.yaml) 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](./examples/) -Below are some examples of what you could provide for the chart's values. +Aside from the [values.yaml](./charts/trilium/values.yaml), please also view the additional files in the [templates](./charts/trilium/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. -## Example values +If you find that a value in your release is inconsistent with those found in the [values.yaml](./charts/trilium/values.yaml) and the [bjw-s common library](https://github.com/bjw-s/helm-charts/blob/common-3.3.2/charts/library/common/values.yaml), then they are being modified in the [templates](./charts/trilium/templates/) folder. Any value changes specified by the user override any values defined within this chart. + +## Requirements + +- A working Kubernetes cluster. +- A PVC provisioner. + - If you don't have one, but have something that serves an NFS share, take a look at the following + - [nfs-subdir-external-provisioner](https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner) + - [democratic-csi](https://github.com/democratic-csi/democratic-csi) + +## Deploying + +```bash +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](./examples/). ```yaml -image: - repository: zadam/trilium - tag: 0.63.5 - pullPolicy: IfNotPresent +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 +```bash +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: @@ -32,19 +69,19 @@ spec: source: chart: trilium repoURL: https://trilium-next.github.io/helm-charts - targetRevision: 0.0.1 + targetRevision: 1.0.3 helm: values: | - controllers: - trilium: - containers: - trilium: - image: - repository: zadam/trilium - tag: 0.63.5 - pullPolicy: IfNotPresent - env: - key: "value" + controllers: + main: + containers: + trilium: + image: + repository: zadam/trilium + tag: 0.63.7 + pullPolicy: IfNotPresent + env: + key: "value" persistence: data: @@ -60,14 +97,35 @@ spec: 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](https://github.com/bjw-s/helm-charts/blob/d9e8c23df242dd9a2dda7c3738360928526d7a20/charts/library/common/values.yaml), 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](https://github.com/bjw-s/helm-charts/blob/d9e8c23df242dd9a2dda7c3738360928526d7a20/charts/library/common/values.yaml#L364-L376), and override them as needed. So, to create a `serviceAccount`, you would want to add YAML below to your Helm release values: + +```yaml +serviceAccount: + create: true +``` + +Then, (for some reason), if you wished to change the Deployment type to `DaemonSet`, ([referencing the values here](https://github.com/bjw-s/helm-charts/blob/d9e8c23df242dd9a2dda7c3738360928526d7a20/charts/library/common/values.yaml#L96)), you could do the following: + +```yaml +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: + ```bash -git clone https://github.com/TriliumNext/helm-chart -cd helm-chart +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 ``` -