From 553808eb8388a78724f24413f38d58ec7ba47661 Mon Sep 17 00:00:00 2001 From: aaronspruit Date: Tue, 27 Oct 2026 16:48:18 -0700 Subject: [PATCH] feat(chart): add extraVolumes and extraVolumeMounts The chart mounts only the data and uploads volumes, and no value adds another one. Add two lists that go into the Deployment as written: extraVolumes for the pod, and extraVolumeMounts for the trek container, next to the data and uploads mounts. Both lists are empty by default, so the default render does not change. The values file shows one use: a ConfigMap of KItinerary extractor scripts, mounted at /usr/local/share/kitinerary/extractors. The chart README and the Reservations-and-Bookings wiki page tell Helm and Compose users how to mount extractors there. The variants render in the Helm Chart & Compose job sets both values, so kubeconform checks them. --- .github/workflows/test.yml | 5 +++++ charts/README.md | 3 ++- charts/trek/templates/deployment.yaml | 6 ++++++ charts/trek/values.yaml | 14 ++++++++++++++ wiki/Reservations-and-Bookings.md | 15 +++++++++++++++ 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7468612ec..501e9c488 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1263,6 +1263,11 @@ jobs: --set 'extraEnv[0].name=SESSION_DURATION' \ --set 'extraEnv[0].value=7d' \ --set 'extraEnvFrom[0].secretRef.name=trek-smtp' \ + --set 'extraVolumes[0].name=kitinerary-extractors' \ + --set 'extraVolumes[0].configMap.name=trek-kitinerary-extractors' \ + --set 'extraVolumeMounts[0].name=kitinerary-extractors' \ + --set 'extraVolumeMounts[0].mountPath=/usr/local/share/kitinerary/extractors' \ + --set 'extraVolumeMounts[0].readOnly=true' \ --set probes.liveness=null \ > "$out/variants.yaml" diff --git a/charts/README.md b/charts/README.md index 6c78a452d..d74419e80 100644 --- a/charts/README.md +++ b/charts/README.md @@ -5,7 +5,7 @@ This is a minimal Helm chart for deploying the TREK app. ## Features - Deploys the TREK container - Exposes port 3000 via Service -- Optional persistent storage for `/app/data` and `/app/uploads` +- Optional persistent storage for `/app/data` and `/app/uploads` and extra volumes support - Configurable environment variables and secrets - Optional generic Ingress support - Configurable health checks (liveness/readiness probes) on `/api/health` @@ -55,3 +55,4 @@ See `values.yaml` for more options. - `COOKIE_SECURE` is auto-derived (on when `NODE_ENV=production` or `FORCE_HTTPS=true`). Set `env.COOKIE_SECURE: "false"` only during local testing without TLS. **Not recommended for production.** - Web Push needs no chart settings: TREK generates its key pair on first start and keeps it in the database on the data PVC. To bring your own pair, set `env.VAPID_PUBLIC_KEY` and `secretEnv.VAPID_PRIVATE_KEY` together (and optionally `env.VAPID_SUBJECT`); changing the pair later means every device has to turn push on again. - Set `env.OIDC_DISCOVERY_URL` to override the auto-constructed OIDC discovery endpoint. Required for providers (e.g. Authentik) that expose it at a non-standard path. +- Use `extraVolumes` and `extraVolumeMounts` to add your own volumes to the pod. To give the booking import more KItinerary extractors, mount a ConfigMap at `/usr/local/share/kitinerary/extractors`, with one `.json` and one `.js` key for each extractor; see the example in `values.yaml`. diff --git a/charts/trek/templates/deployment.yaml b/charts/trek/templates/deployment.yaml index 33fd248eb..5724ac7f7 100644 --- a/charts/trek/templates/deployment.yaml +++ b/charts/trek/templates/deployment.yaml @@ -141,6 +141,9 @@ spec: mountPath: /app/data - name: uploads mountPath: /app/uploads + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- with (default dict .Values.probes).startup }} startupProbe: {{- toYaml . | nindent 12 }} @@ -168,3 +171,6 @@ spec: {{- else }} emptyDir: {} {{- end }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/trek/values.yaml b/charts/trek/values.yaml index 05270b102..35e9f751f 100644 --- a/charts/trek/values.yaml +++ b/charts/trek/values.yaml @@ -260,6 +260,20 @@ extraEnv: [] # name: trek-smtp extraEnvFrom: [] +# Further volumes for the pod. The chart does not create the objects they name. +# extraVolumes: +# - name: kitinerary-extractors +# configMap: +# name: trek-kitinerary-extractors +extraVolumes: [] +# Where the trek container mounts them. For example, KItinerary +# loads extractors for the booking import from this path: +# extraVolumeMounts: +# - name: kitinerary-extractors +# mountPath: /usr/local/share/kitinerary/extractors +# readOnly: true +extraVolumeMounts: [] + resources: requests: cpu: 100m diff --git a/wiki/Reservations-and-Bookings.md b/wiki/Reservations-and-Bookings.md index cf9980fd9..6b8719ed2 100644 --- a/wiki/Reservations-and-Bookings.md +++ b/wiki/Reservations-and-Bookings.md @@ -203,6 +203,21 @@ The import button is hidden only when the server has neither the `kitinerary-ext The binary ships inside the official TREK Docker image. If you run TREK from source, install the `libkitinerary-bin` package (Debian trixie, Ubuntu 25.04 or newer) or set `KITINERARY_EXTRACTOR_PATH` to the binary's full path. See [Environment-Variables](Environment-Variables). +### Your own extractors + +KDE Itinerary also loads extractor scripts that you write, from `/usr/local/share/kitinerary/extractors` in the container. Each extractor is a `.json` file and a `.js` file. Itinerary reads the directory on each import, so a new extractor works without a restart. + +With Docker Compose, mount a folder of extractors there with a plain volume: + +```yaml +services: + app: + volumes: + - ./extractors:/usr/local/share/kitinerary/extractors:ro +``` + +With the Helm chart, mount a ConfigMap there with `extraVolumes` and `extraVolumeMounts`. See the example in the chart's `values.yaml`. + ### Review mark A booking TREK could not complete on its own carries an amber warning icon next to its title, and a **Review** pill in its detail. It comes from AirTrail imports whose date is not exact or whose airport could not be placed, and from bookings an AI assistant created with the flag set. Open the booking, check the missing parts and save it; saving in the editor clears the mark. File imports never keep it, because each one passes through the editor before it is saved.