Migrate Joplin to K3s and add existing k8s manifests

- New k8s/joplin/ deployment for note.expertfab.de (Postgres + Server +
  Traefik ingress with cert-manager), replicas=2 to match cluster size
- coredns-custom.yaml: route note.expertfab.de internally to Traefik LB
- Commit previously-built k8s manifests (documenso, erpnext oauth2-proxy,
  paperless oauth2-proxy) that were running but not in git
- docs/access.md: add Joplin section and Documenso/Cloudflare entries

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-28 20:17:19 +02:00
parent 314a512231
commit c48ab60392
14 changed files with 849 additions and 0 deletions

37
k8s/joplin/ingress.yaml Normal file
View File

@@ -0,0 +1,37 @@
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: redirect-https
namespace: joplin
spec:
redirectScheme:
scheme: https
permanent: true
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: joplin
namespace: joplin
annotations:
cert-manager.io/cluster-issuer: letsencrypt
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
traefik.ingress.kubernetes.io/router.middlewares: joplin-redirect-https@kubernetescrd
spec:
ingressClassName: traefik
rules:
- host: note.expertfab.de
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: joplin
port:
number: 22300
tls:
- hosts:
- note.expertfab.de
secretName: joplin-tls

92
k8s/joplin/joplin.yaml Normal file
View File

@@ -0,0 +1,92 @@
---
apiVersion: v1
kind: Secret
metadata:
name: joplin-env
namespace: joplin
type: Opaque
stringData:
APP_BASE_URL: "https://note.expertfab.de"
APP_PORT: "22300"
DB_CLIENT: "pg"
POSTGRES_HOST: "joplin-postgres"
POSTGRES_PORT: "5432"
POSTGRES_DATABASE: "joplin"
POSTGRES_USER: "joplin"
POSTGRES_PASSWORD: "TXIlCX4DUdKZuqbYt2lTaxMXvz6cJi"
MAILER_ENABLED: "1"
MAILER_HOST: "smtprelay.expertfab.de"
MAILER_PORT: "587"
MAILER_SECURITY: "starttls"
MAILER_AUTH_USER: "it-admin@expertfab.de"
MAILER_AUTH_PASSWORD: "Relay22$$"
MAILER_NOREPLY_NAME: "ExpertFab Joplin"
MAILER_NOREPLY_EMAIL: "it-admin@expertfab.de"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: joplin
namespace: joplin
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: joplin
template:
metadata:
labels:
app: joplin
spec:
containers:
- name: joplin
image: joplin/server:latest
ports:
- containerPort: 22300
envFrom:
- secretRef:
name: joplin-env
readinessProbe:
httpGet:
path: /api/ping
port: 22300
httpHeaders:
- name: Host
value: note.expertfab.de
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 6
livenessProbe:
httpGet:
path: /api/ping
port: 22300
httpHeaders:
- name: Host
value: note.expertfab.de
initialDelaySeconds: 90
periodSeconds: 30
failureThreshold: 5
resources:
requests:
cpu: 100m
memory: 512Mi
limits:
cpu: 1000m
memory: 1500Mi
---
apiVersion: v1
kind: Service
metadata:
name: joplin
namespace: joplin
spec:
selector:
app: joplin
ports:
- port: 22300
targetPort: 22300

19
k8s/joplin/namespace.yaml Normal file
View File

@@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: joplin
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-joplin
provisioner: driver.longhorn.io
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: Immediate
parameters:
numberOfReplicas: "2"
staleReplicaTimeout: "30"
fromBackup: ""
fsType: "ext4"

96
k8s/joplin/postgres.yaml Normal file
View File

@@ -0,0 +1,96 @@
---
apiVersion: v1
kind: Secret
metadata:
name: joplin-postgres
namespace: joplin
type: Opaque
stringData:
POSTGRES_DB: joplin
POSTGRES_USER: joplin
POSTGRES_PASSWORD: "TXIlCX4DUdKZuqbYt2lTaxMXvz6cJi"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: joplin-postgres-data
namespace: joplin
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: longhorn-joplin
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: joplin-postgres
namespace: joplin
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: joplin-postgres
template:
metadata:
labels:
app: joplin-postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: joplin-postgres
env:
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
startupProbe:
exec:
command: ["pg_isready", "-U", "joplin", "-d", "joplin"]
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
readinessProbe:
exec:
command: ["pg_isready", "-U", "joplin", "-d", "joplin"]
periodSeconds: 10
timeoutSeconds: 5
livenessProbe:
exec:
command: ["pg_isready", "-U", "joplin", "-d", "joplin"]
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 5
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1000m
memory: 1Gi
volumes:
- name: data
persistentVolumeClaim:
claimName: joplin-postgres-data
---
apiVersion: v1
kind: Service
metadata:
name: joplin-postgres
namespace: joplin
spec:
selector:
app: joplin-postgres
ports:
- port: 5432
targetPort: 5432