From 8300c7599f430906c3e6eee489e1257d38f54aba Mon Sep 17 00:00:00 2001 From: xeruf Date: Fri, 9 Feb 2024 18:14:49 +0000 Subject: [PATCH] docs: re-add removed documentation (#19) Co-authored-by: xeruf <27jf@pm.me> Reviewed-on: https://kolaente.dev/vikunja/helm-chart/pulls/19 Co-authored-by: xeruf Co-committed-by: xeruf --- README.md | 78 ++++++++++++++++++++++++++++++----------------------- values.yaml | 18 ++++++++++--- 2 files changed, 58 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 9e3e0d4..225269f 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,46 @@ Vikunja Helm Chart This Helm Chart deploys both the Vikunja [frontend](https://hub.docker.com/r/vikunja/frontend) and Vikunja [api](https://hub.docker.com/r/vikunja/api) containers, in addition to other Kubernetes resources so that you'll have a fully functioning Vikunja deployment quickly. Also, you can deploy Bitnami's [PostgreSQL](https://github.com/bitnami/charts/tree/main/bitnami/postgresql) and [Redis](https://github.com/bitnami/charts/tree/main/bitnami/redis) as subcharts if you want, as Vikunja can utilize them as its database and caching mechanism (respectively). -## Requirements - -- Kubernetes >= 1.19 -- Helm >= 3 +See https://artifacthub.io/packages/helm/vikunja/vikunja for version information and installation instructions. ## Quickstart -The majority of default values defined in `values.yaml` should be compatible for your deployment. Additionally, if you utilize an Ingress for both the API and Frontend, you will be able to access the frontend out of the box. However, it won't have any default credentials. So, you'll need to create an account using the registration button. +Define ingress settings according to your controller (for both API and Frontend) to access the application. +You can set all Vikunja API options as yaml under `api.configMaps.config.data.config.yml`: https://vikunja.io/docs/config-options -That should be it! +For example, you can disable registration (if you do not with to allow others to register on your Vikunja), by providing the following values in your `values.yaml`: + +```yaml +api: + configMaps: + config: + enabled: true + data: + config.yml: + service: + enableregistration: false +``` + +You can still create new users by executing the following command in the `api` container: + +```bash +./vikunja user create --email --user --password +``` + +## Advanced Features + +### Replicas + +To effectively run multiple replicas of the API, +make sure to set up the redis cache as well +by setting `api.configMaps.config.data.config.yml.keyvalue.type` to `redis`, +configuring the redis subchart (see [values.yaml](./values.yaml#L119)) +and the connection [in Vikunja](https://vikunja.io/docs/config-options/#redis) ### Use an existing file volume claim -In the `values.yaml` file, you can either define your own existing Persistent Volume Claim (PVC) or have the chart create one on your behalf. +In the `values.yaml` file, you can either define your own existing Persistent Volume Claim (PVC) +or have the chart create one on your behalf. To have the chart use your pre-existing PVC: @@ -45,9 +71,12 @@ api: ### Utilizing environment variables from Kubernetes secrets -Each environment variable that is "injected" into a pod can be sourced from a Kubernetes secret. This is useful when you wish to add values that you would rather keep as secrets in your GitOps repo, as environment variables in the pods. +Each environment variable that is "injected" into a pod can be sourced from a Kubernetes secret. +This is useful when you wish to add values that you would rather keep as secrets in your GitOps repo +as environment variables in the pods. -Assuming that you had a Kubernetes secret named `vikunja-env`, this is how you would add the value stored at key `VIKUNJA_DATABASE_PASSWORD` as the environment variable named `VIKUNJA_DATABASE_PASSWORD`: +Assuming that you had a Kubernetes secret named `vikunja-env`, +this is how you would add the value stored at key `VIKUNJA_DATABASE_PASSWORD` as the environment variable named `VIKUNJA_DATABASE_PASSWORD`: ```yaml api: @@ -60,7 +89,8 @@ api: VIKUNJA_DATABASE_USERNAME: "db-user" ``` -Alternatively, instead of defining each and every key, if the keys within the secret are the names of environment variables, you could also do the following: +If the keys within the secret are the names of environment variables, +you can simplify passing multiple values to this: ```yaml api: @@ -106,9 +136,10 @@ stringData: ### 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/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml), including the top-level keys, can be added and subtracted from this chart's `values.yaml`, underneath the `api`, `frontend`, and (optionally) `typesense` key. +Oftentimes, modifications need to be made to a Helm chart to allow it to operate in your Kubernetes cluster. +Anything you see [in bjw-s' `common` library](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml), +including the top-level keys, can be added and subtracted from this chart's `values.yaml`, +underneath the `api`, `frontend`, and (optionally) `typesense` key. For example, if you wished to create a `serviceAccount` as can be seen [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L85-L87) for the `api` pod: @@ -126,27 +157,6 @@ frontend: type: daemonset ``` -### Another Example of Modifying `config.yml` (Enabling Registration) - -You can disable registration (if you do not with to allow others to register on your Vikunja), by providing the following values in your `values.yaml`: - -```yaml -api: - configMaps: - config: - enabled: true - data: - config.yml: - service: - enableregistration: false -``` - -If you need to create another user, you could opt to execute the following command on the `api` container: - -```bash -./vikunja user create --email --user --password -``` - ## Publishing The following steps are automatically performed when a git tag for a new version is pushed to the repository. diff --git a/values.yaml b/values.yaml index 4a084b1..1a99f07 100644 --- a/values.yaml +++ b/values.yaml @@ -97,16 +97,21 @@ frontend: paths: - path: "/" tls: [] - # If you've used the "built-in" ingress in the api section, you don't need to specify VIKUNJA_API_URL as an environment variable here. - # If you've used something else, you'll need to provide the URL to the API here. - # env: - # VIKUNJA_API_URL: http://vikunja.local/api + # You only need to provide the URL to the API as environment variable here if you deviate from the "built-in" ingress in the api section. + #env: + # VIKUNJA_API_URL: http://vikunja.local/api ########################## # END VIKUNJA COMPONENTS # ########################## # Optional Dependencies + +# ┬─┐┌─┐┐─┐┌┐┐┌─┐┬─┐┬─┐┐─┐┐─┐┬ +# │─┘│ │└─┐ │ │ ┬│┬┘├─ └─┐│ ││ +# ┘ ┘─┘──┘ ┘ ┘─┘┘└┘┴─┘──┘└─\┘─┘ +# Please refer to PostgreSQL subchart for a full list of possible values +# https://github.com/bitnami/charts/tree/main/bitnami/postgresql/#parameters postgresql: enabled: true global: @@ -116,6 +121,11 @@ postgresql: database: vikunja password: vikunja +# ┬─┐┬─┐┬─┐o┐─┐ +# │┬┘├─ │ ││└─┐ +# ┘└┘┴─┘┘─┘┘──┘ +# Please refer to Redis subchart for a full list of possible values +# https://github.com/bitnami/charts/tree/main/bitnami/redis/#parameters redis: enabled: false architecture: standalone