eikek / eikek/docspell

[Kubernetes] Wrong PostgreSQL mount path and other Kubernetes manifest issues

Open
#2,498 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elm
Stars
2.3k
Forks
184
Avg merge
8h 2m
Merged PRs (30d)
4

Description

I'm currently in the process of generally reworking my entire docspell setup, and decided to switch to a Kubernetes-based deployment. I was pleased to find that there were already `kustomize` ready manifests available, but I've found some issues with them.

### 1. The volume mount for the `postgres` stateful set doesn't quite work.
Due to how volume mounting works, it can happen that there is a `lost+found` directory created within the specified `/var/lib/postgresql/data` path. This causes Postgres to fail on startup, due to the not-empty directory.

To fix this, a simple `subPath` statement can be added:
```yaml
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
subPath: pgdata
```

### 2. Wrong permissions for Apache Solr in `/var/solr`
Sadly, the volume mounts causes solr to have issues with file permissions in the `/var/solr` directory. To make sure, that the file permissions are always correct, an _initContainer_ should be added:

```yaml
template:
metadata:
labels:
app: solr
spec:
initContainers:
- name: fix-permissions
image: busybox
command:
- "sh"
- "-c"
- "chown -R 8983:8983 /var/solr"
volumeMounts:
- name: solr-data
mountPath: /var/solr
```

### 3. Whatever the ingress is supposed to be?

I'm really unsure what the original intent of the `ingress.yaml` was for the Kubernetes deployment, but it doesn't work together with either the used service names, or the actual paths.
A simple path to the `restserver` service on port `7880` is already enough to make docspell available from outside.

### 4. With the new languages added in v0.41.0, an additional module has to be added so that the index can properly be created.

Without the `-Dsolr.modules=analysis-extras` module, joex cannot create the proper full search index inside solr.
This can be solved with the `SOLR_OPTS` environment variable, that can be passed to the container:

```yaml
env:
- name: SOLR_OPTS
value: "-Dsolr.modules=analysis-extras"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.