diff --git a/apps/production/kustomization.yaml b/apps/production/kustomization.yaml index fd3e43c..49b1ba6 100644 --- a/apps/production/kustomization.yaml +++ b/apps/production/kustomization.yaml @@ -53,6 +53,10 @@ resources: # Client-seitiger Scan-Dienst für verschlüsselte Räume (Issue #19-Erweiterung) - clamav-http-scanner.yaml - concierge-bot.yaml + # Wiki.js (Plattform-Wiki, ADR-0014, #0048) - wartet auf wikijs-postgres-secret + - wikijs-postgres.yaml + - wikijs.yaml + - wiki-ingress.yaml # Synapse-Modul als eigene Datei gepflegt (lintbar/testbar), aber als ConfigMap gemounted - # disableNameSuffixHash, da der Name in synapse-values.yaml's eingebettetem values.yaml diff --git a/apps/production/networkpolicy.yaml b/apps/production/networkpolicy.yaml index 65c8e8a..4a7401d 100644 --- a/apps/production/networkpolicy.yaml +++ b/apps/production/networkpolicy.yaml @@ -359,3 +359,45 @@ spec: ports: - protocol: TCP port: http +--- +# wiki.axion1337.chat (Traefik) -> Wiki.js (ADR-0014, #0048) +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-ingress-wikijs + namespace: matrix +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: wikijs + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: kube-system + ports: + - protocol: TCP + port: http +--- +# Wiki.js -> sein eigener Postgres (nur von Wiki.js-Pods erreichbar) +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-ingress-wikijs-postgres + namespace: matrix +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: wikijs-postgres + policyTypes: + - Ingress + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: wikijs + ports: + - protocol: TCP + port: postgres diff --git a/apps/production/wiki-ingress.yaml b/apps/production/wiki-ingress.yaml new file mode 100644 index 0000000..b5e8cd4 --- /dev/null +++ b/apps/production/wiki-ingress.yaml @@ -0,0 +1,33 @@ +# Öffentlicher Zugang zum Wiki.js unter wiki.axion1337.chat (ADR-0014, #0048). +# Muster wie apps/authentik/{certificate,ingress}.yaml. DNS-A-Record auf +# 49.13.132.245 ist von sorb angelegt. Login läuft nativ über Authentik-OIDC +# (kein Forward-Auth) — siehe Guide 10 / #0049. +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: wiki-axion1337-chat-cert + namespace: matrix +spec: + secretName: wiki-axion1337-chat-tls + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer + dnsNames: + - wiki.axion1337.chat +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: wikijs + namespace: matrix +spec: + entryPoints: + - websecure + tls: + secretName: wiki-axion1337-chat-tls + routes: + - match: Host(`wiki.axion1337.chat`) + kind: Rule + services: + - name: wikijs + port: 3000 diff --git a/apps/production/wikijs-postgres.yaml b/apps/production/wikijs-postgres.yaml new file mode 100644 index 0000000..b314048 --- /dev/null +++ b/apps/production/wikijs-postgres.yaml @@ -0,0 +1,79 @@ +# Dedizierter Postgres für Wiki.js (ADR-0014, #0048). Bewusst eigenständig statt in +# den Synapse-/Authentik-DBs, damit das Wiki als Suite-Baustein reproduzierbar bleibt. +# git ist die Inhalts-Quelle (Wiki.js Git-Storage), diese DB ist Laufzeit-Index/Cache. +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wikijs-postgres-data + namespace: matrix +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: 2Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wikijs-postgres + namespace: matrix +spec: + replicas: 1 + strategy: + type: Recreate # RWO-Volume: kein RollingUpdate mit zwei Pods + selector: + matchLabels: + app.kubernetes.io/name: wikijs-postgres + template: + metadata: + labels: + app.kubernetes.io/name: wikijs-postgres + spec: + containers: + - name: postgres + image: postgres:16-alpine + ports: + - name: postgres + containerPort: 5432 + env: + - name: POSTGRES_DB + value: wiki + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: wikijs-postgres-secret + key: username + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: wikijs-postgres-secret + key: password + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + volumeMounts: + - name: data + mountPath: /var/lib/postgresql/data + readinessProbe: + exec: + command: ["pg_isready", "-U", "wiki", "-d", "wiki"] + initialDelaySeconds: 5 + periodSeconds: 10 + volumes: + - name: data + persistentVolumeClaim: + claimName: wikijs-postgres-data +--- +apiVersion: v1 +kind: Service +metadata: + name: wikijs-postgres + namespace: matrix +spec: + selector: + app.kubernetes.io/name: wikijs-postgres + ports: + - name: postgres + port: 5432 + targetPort: postgres diff --git a/apps/production/wikijs.yaml b/apps/production/wikijs.yaml new file mode 100644 index 0000000..30094e7 --- /dev/null +++ b/apps/production/wikijs.yaml @@ -0,0 +1,88 @@ +# Wiki.js — Plattform-Wiki (ADR-0014, #0048). Öffentlich unter wiki.axion1337.chat +# (Ingress/Cert in wiki-ingress.yaml), Login nativ via Authentik-OIDC (#0049, Guide 10). +# Git-Storage (Inhalt in git) wird nach dem ersten Start in der Admin-UI eingerichtet. +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wikijs-data + namespace: matrix +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: 2Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wikijs + namespace: matrix +spec: + replicas: 1 + strategy: + type: Recreate # RWO-Volume (Git-Storage-Klon) + selector: + matchLabels: + app.kubernetes.io/name: wikijs + template: + metadata: + labels: + app.kubernetes.io/name: wikijs + spec: + containers: + - name: wikijs + image: ghcr.io/requarks/wiki:2.5 + ports: + - name: http + containerPort: 3000 + env: + - name: DB_TYPE + value: postgres + - name: DB_HOST + value: wikijs-postgres + - name: DB_PORT + value: "5432" + - name: DB_NAME + value: wiki + - name: DB_USER + valueFrom: + secretKeyRef: + name: wikijs-postgres-secret + key: username + - name: DB_PASS + valueFrom: + secretKeyRef: + name: wikijs-postgres-secret + key: password + volumeMounts: + - name: data + mountPath: /wiki/data + readinessProbe: + tcpSocket: + port: http + initialDelaySeconds: 25 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: http + initialDelaySeconds: 60 + periodSeconds: 20 + volumes: + - name: data + persistentVolumeClaim: + claimName: wikijs-data +--- +apiVersion: v1 +kind: Service +metadata: + name: wikijs + namespace: matrix +spec: + selector: + app.kubernetes.io/name: wikijs + ports: + - name: http + port: 3000 + targetPort: http