install docspell
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Tobias Brunner 2021-01-10 21:10:35 +01:00
parent 1f8d469f63
commit 98b6cdefc1
13 changed files with 416 additions and 0 deletions

26
_apps/docspell.yaml Normal file
View File

@ -0,0 +1,26 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: docspell
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: docspell
server: https://kubernetes.default.svc
project: apps
source:
path: docspell
repoURL: https://git.tbrnt.ch/tobru/gitops-tbrnt.git
targetRevision: HEAD
directory:
recurse: true
syncPolicy:
automated:
prune: true
---
apiVersion: v1
kind: Namespace
metadata:
name: docspell

View File

@ -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://solrtcp: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://solrtcp:8983/solr/docspell"
}
}
scheduler {
pool-size = 1
}
}

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: docspell-env
namespace: docspell
data:
TZ: Europe/Berlin
DB_TYPE: postgresql
DB_HOST: postgres
DB_PORT: "5432"
BASE_URL: docs.tobru.ch

View File

@ -0,0 +1,37 @@
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
envFrom:
- configMapRef:
name: docspell-env
- secretRef:
name: docspell
ports:
- containerPort: 7878
volumeMounts:
- name: config-volume
mountPath: /etc/docspell
volumes:
- name: config-volume
configMap:
name: docspell-config

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,64 @@
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
valueFrom:
secretKeyRef:
name: docspell
key: DB_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: docspell
key: DB_PASS
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: docspell
key: DB_NAME
- 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

View File

@ -0,0 +1,49 @@
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
envFrom:
- configMapRef:
name: docspell-env
- secretRef:
name: docspell
ports:
- containerPort: 7880
livenessProbe:
httpGet:
path: /
port: 7880
initialDelaySeconds: 15
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 7880
initialDelaySeconds: 15
periodSeconds: 10
volumeMounts:
- name: config-volume
mountPath: /etc/docspell
volumes:
- name: config-volume
configMap:
name: docspell-config

View File

@ -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

View File

@ -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

20
docspell/secret.yaml Normal file
View File

@ -0,0 +1,20 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: docspell
namespace: docspell
spec:
encryptedData:
DB_NAME: AgCuZef2CVCeoMshAa6JzqpuS+hYWraAGJwWBagUpwoGxOplD8OBgsKC5BVd/lqB7M881/bty7J+OZ68C2Xxv034ZQOIKEya56HEU9QEimRqpbozKhR86fJEzn18J/BHSPvEOmgqjrvCcTgzUSiVyHoQQyHLfTb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i2v3L/l45IvLBUWnjtBTc24M12i4rqSUToI73n4+GYvEnV86H1TL8S4s6ysgYSbsj+7cw0+0CRZdmahs+nQ+GPUOH9TRQdodCzi5+kBAbtT3FGepYQE4ltb2JvWSMHovJ3yuTQnF2Lkx5qCWRu9Ns2NUS2M8MUShnOvAhV9CzkfMRzrQvuH/+TrafMY6y3uUsOzWLagjRNNOwJhIQHl6UeCn5S8eMH2N7YWZsLZYxh8BcPSundjzKqqH+PR3CKA4K+oQLtrta9mbV03vusj1cJo7K5Di8NZfdBrDKHhYUzDq1tAN3bRL7KAW4qi5F9FzopKJqbFF40iA==
template:
metadata:
creationTimestamp: null
name: docspell
namespace: docspell
type: Opaque

View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: solr
name: solrtcp
namespace: docspell
spec:
ports:
- name: "8983"
port: 8983
protocol: TCP
targetPort: 8983
selector:
app: solr
type: ClusterIP

View File

@ -0,0 +1,61 @@
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
livenessProbe:
httpGet:
path: /solr/docspell/admin/ping
port: 8983
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /solr/docspell/admin/ping
port: 8983
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 10
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