Skip to content

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

@TheAnachronism

Description

@TheAnachronism

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:

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:

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions