diff --git a/docspell/configmap.yaml b/docspell/configmap.yaml new file mode 100644 index 0000000..cf993b3 --- /dev/null +++ b/docspell/configmap.yaml @@ -0,0 +1,58 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: docspell-config + namespace: docspell +data: + docspell.conf: | + docspell.server { + app-id = ${HOSTNAME} + base-url = "https://"${BASE_URL} + bind { + address = "0.0.0.0" + } + integration-endpoint { + enabled = true + http-header { + enabled = true + header-value = ${?DOCSPELL_HEADER_VALUE} + } + } + # Configuration of the full-text search engine. + full-text-search { + enabled = true + solr = { + url = "http://solr:8983/solr/docspell" + } + recreate-key = ${SOLR_RECREATE_KEY} + } + backend { + jdbc { + url = "jdbc:"${DB_TYPE}"://"${DB_HOST}":"${DB_PORT}"/"${DB_NAME} + user = ${DB_USER} + password = ${DB_PASS} + } + } + } + + docspell.joex { + app-id = "joex-"${HOSTNAME} + base-url = "http://joex:7878" + bind { + address = "0.0.0.0" + } + jdbc { + url = "jdbc:"${DB_TYPE}"://"${DB_HOST}":"${DB_PORT}"/"${DB_NAME} + user = ${DB_USER} + password = ${DB_PASS} + } + full-text-search { + enabled = true + solr = { + url = "http://solr:8983/solr/docspell" + } + } + scheduler { + pool-size = 1 + } + } diff --git a/docspell/deployment-joex.yaml b/docspell/deployment-joex.yaml new file mode 100644 index 0000000..0b43d45 --- /dev/null +++ b/docspell/deployment-joex.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: joex + name: joex + namespace: docspell +spec: + replicas: 1 + selector: + matchLabels: + app: joex + strategy: {} + template: + metadata: + labels: + app: joex + spec: + containers: + - image: docker.io/eikek0/docspell:joex-LATEST + name: joex + args: + - /etc/docspell/docspell.conf + env: + - name: TZ + value: Europe/Berlin + - name: DOCSPELL_HEADER_VALUE + value: "none" + - name: DB_TYPE + value: postgresql + - name: DB_HOST + value: postgres + - name: DB_PORT + value: "5432" + - name: DB_NAME + value: docspell + - name: DB_USER + value: docspell + - name: DB_PASS + value: jQbslGY72R8aqDxqet5ypKLvjrfmK1 + - name: BASE_URL + value: docs.tobru.ch + - name: SOLR_RECREATE_KEY + value: hX2hJ3N8o3kayqE4jL0HVDrS3uNj8B + ports: + - containerPort: 7878 + volumeMounts: + - name: config-volume + mountPath: /etc/docspell + volumes: + - name: config-volume + configMap: + name: docspell-config diff --git a/docspell/deployment-restserver.yaml b/docspell/deployment-restserver.yaml new file mode 100644 index 0000000..53677a7 --- /dev/null +++ b/docspell/deployment-restserver.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: restserver + name: restserver + namespace: docspell +spec: + replicas: 1 + selector: + matchLabels: + app: restserver + strategy: {} + template: + metadata: + labels: + app: restserver + spec: + containers: + - image: docker.io/eikek0/docspell:restserver-LATEST + name: docspell + args: + - /etc/docspell/docspell.conf + env: + - name: TZ + value: Europe/Berlin + - name: DOCSPELL_HEADER_VALUE + value: "none" + - name: DB_TYPE + value: postgresql + - name: DB_HOST + value: postgres + - name: DB_PORT + value: "5432" + - name: DB_NAME + value: docspell + - name: DB_USER + value: docspell + - name: DB_PASS + value: jQbslGY72R8aqDxqet5ypKLvjrfmK1 + - name: BASE_URL + value: docs.tobru.ch + - name: SOLR_RECREATE_KEY + value: hX2hJ3N8o3kayqE4jL0HVDrS3uNj8B + ports: + - containerPort: 7880 + volumeMounts: + - name: config-volume + mountPath: /etc/docspell + volumes: + - name: config-volume + configMap: + name: docspell-config diff --git a/docspell/docspell.conf b/docspell/docspell.conf new file mode 100644 index 0000000..9ea246a --- /dev/null +++ b/docspell/docspell.conf @@ -0,0 +1,49 @@ +docspell.server { + base-url = "http://localhost:7880" + bind { + address = "0.0.0.0" + } + integration-endpoint { + enabled = true + http-header { + enabled = true + header-value = ${?DOCSPELL_HEADER_VALUE} + } + } + # Configuration of the full-text search engine. + full-text-search { + enabled = true + solr = { + url = "http://solr:8983/solr/docspell" + } + } + backend { + jdbc { + url = "jdbc:"${DB_TYPE}"://"${DB_HOST}":"${DB_PORT}"/"${DB_NAME} + user = ${DB_USER} + password = ${DB_PASS} + } + } +} + +docspell.joex { + app-id = "joex-"${HOSTNAME} + base-url = "http://"${HOSTNAME}":7878" + bind { + address = "0.0.0.0" + } + jdbc { + url = "jdbc:"${DB_TYPE}"://"${DB_HOST}":"${DB_PORT}"/"${DB_NAME} + user = ${DB_USER} + password = ${DB_PASS} + } + full-text-search { + enabled = true + solr = { + url = "http://solr:8983/solr/docspell" + } + } + scheduler { + pool-size = 1 + } +} diff --git a/docspell/ingress.yaml b/docspell/ingress.yaml new file mode 100644 index 0000000..9891095 --- /dev/null +++ b/docspell/ingress.yaml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + ingress.kubernetes.io/ssl-redirect: "true" + name: restserver + namespace: docspell +spec: + rules: + - host: docs.tobru.ch + http: + paths: + - path: / + backend: + service: + name: restserver + port: + number: 7880 + pathType: Exact + tls: + - hosts: + - docs.tobru.ch + secretName: docs-tobru-ch-cert + diff --git a/docspell/service-joex.yaml b/docspell/service-joex.yaml new file mode 100644 index 0000000..71ade60 --- /dev/null +++ b/docspell/service-joex.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: joex + name: joex + namespace: docspell +spec: + ports: + - name: "7878" + port: 7878 + protocol: TCP + targetPort: 7878 + selector: + app: joex + type: ClusterIP diff --git a/docspell/service-postgres.yaml b/docspell/service-postgres.yaml new file mode 100644 index 0000000..9301434 --- /dev/null +++ b/docspell/service-postgres.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: postgres + name: postgres + namespace: docspell +spec: + ports: + - name: "5432" + port: 5432 + protocol: TCP + targetPort: 5432 + selector: + app: postgres + type: ClusterIP diff --git a/docspell/service-restserver.yaml b/docspell/service-restserver.yaml new file mode 100644 index 0000000..9ca5363 --- /dev/null +++ b/docspell/service-restserver.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: restserver + name: restserver + namespace: docspell +spec: + ports: + - name: "7880" + port: 7880 + protocol: TCP + targetPort: 7880 + selector: + app: restserver + type: ClusterIP diff --git a/docspell/service-solr.yaml b/docspell/service-solr.yaml new file mode 100644 index 0000000..8434d33 --- /dev/null +++ b/docspell/service-solr.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: solr + name: solr + namespace: docspell +spec: + ports: + - name: "8983" + port: 8983 + protocol: TCP + targetPort: 8983 + selector: + app: solr + type: ClusterIP diff --git a/docspell/statefulset-postgres.yaml b/docspell/statefulset-postgres.yaml new file mode 100644 index 0000000..8266849 --- /dev/null +++ b/docspell/statefulset-postgres.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: postgres + namespace: docspell +spec: + updateStrategy: + type: RollingUpdate + selector: + matchLabels: + app: postgres + serviceName: postgres + replicas: 1 + template: + metadata: + labels: + app: postgres + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: postgres + image: docker.io/postgres:13.1 + imagePullPolicy: IfNotPresent + ports: + - name: postgres + containerPort: 5432 + protocol: TCP + resources: + requests: + cpu: 100m + memory: 256Mi + env: + - name: POSTGRES_USER + value: docspell + - name: POSTGRES_PASSWORD + value: jQbslGY72R8aqDxqet5ypKLvjrfmK1 + - name: POSTGRES_DB + value: docspell + - name: PGUSER + value: postgres + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + volumeMounts: + - mountPath: /var/lib/postgresql/data/pgdata + name: postgres + subPath: postgres-db + volumeClaimTemplates: + - metadata: + name: postgres + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + diff --git a/docspell/statefulset-solr.yaml b/docspell/statefulset-solr.yaml new file mode 100644 index 0000000..3d6515a --- /dev/null +++ b/docspell/statefulset-solr.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: solr + namespace: docspell +spec: + updateStrategy: + type: RollingUpdate + selector: + matchLabels: + app: solr + serviceName: solr + replicas: 1 + template: + metadata: + labels: + app: solr + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: solr + image: docker.io/solr:8 + imagePullPolicy: IfNotPresent + command: + - solr-precreate + - docspell + ports: + - name: solr + containerPort: 8983 + protocol: TCP + resources: + requests: + cpu: 100m + memory: 256Mi + volumeMounts: + - mountPath: /var/solr + name: solr + subPath: solr-db + volumeClaimTemplates: + - metadata: + name: solr + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi +