diff --git a/apps/firefly/cronjob.yaml b/apps/firefly/cronjob.yaml new file mode 100644 index 0000000..a4c38c8 --- /dev/null +++ b/apps/firefly/cronjob.yaml @@ -0,0 +1,28 @@ +# Firefly's daily job (recurring transactions, bill reminders, auto-budgets). +apiVersion: batch/v1 +kind: CronJob +metadata: + name: firefly-cron +spec: + schedule: "0 3 * * *" + timeZone: Europe/Paris + concurrencyPolicy: Forbid + jobTemplate: + spec: + backoffLimit: 2 + template: + spec: + restartPolicy: Never + containers: + - name: cron + image: curlimages/curl:8.22.0 + env: + - name: STATIC_CRON_TOKEN + valueFrom: + secretKeyRef: + name: firefly-secrets + key: STATIC_CRON_TOKEN + command: + - /bin/sh + - -c + - curl -fsS -m 300 "http://firefly/api/v1/cron/$STATIC_CRON_TOKEN" diff --git a/apps/firefly/deployment.yaml b/apps/firefly/deployment.yaml new file mode 100644 index 0000000..711b4d6 --- /dev/null +++ b/apps/firefly/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: firefly +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: firefly + template: + metadata: + labels: + app: firefly + spec: + securityContext: + # The image runs as www-data (33). + fsGroup: 33 + containers: + - name: firefly + image: fireflyiii/core:version-6.7.8 + ports: + - name: http + containerPort: 8080 + # APP_KEY, DB_PASSWORD, STATIC_CRON_TOKEN. + envFrom: + - secretRef: + name: firefly-secrets + env: + - name: APP_URL + value: https://firefly.un-oeil.fr + - name: TRUSTED_PROXIES + value: "**" + - name: TZ + value: Europe/Paris + - name: DEFAULT_LANGUAGE + value: fr_FR + - name: DB_CONNECTION + value: pgsql + - name: DB_HOST + value: postgres.postgres.svc + - name: DB_PORT + value: "5432" + - name: DB_DATABASE + value: firefly + - name: DB_USERNAME + value: firefly + volumeMounts: + - name: upload + mountPath: /var/www/html/storage/upload + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + memory: 512Mi + volumes: + - name: upload + persistentVolumeClaim: + claimName: firefly-upload diff --git a/apps/firefly/ingress.yaml b/apps/firefly/ingress.yaml new file mode 100644 index 0000000..78030dc --- /dev/null +++ b/apps/firefly/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: firefly +spec: + ingressClassName: traefik + rules: + - host: firefly.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: firefly + port: + name: http diff --git a/apps/firefly/kustomization.yaml b/apps/firefly/kustomization.yaml new file mode 100644 index 0000000..84585db --- /dev/null +++ b/apps/firefly/kustomization.yaml @@ -0,0 +1,10 @@ +# Personal finance, data in the shared Postgres. https://firefly.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml + - cronjob.yaml diff --git a/apps/firefly/pvc.yaml b/apps/firefly/pvc.yaml new file mode 100644 index 0000000..a808d71 --- /dev/null +++ b/apps/firefly/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: firefly-upload +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 2Gi diff --git a/apps/firefly/service.yaml b/apps/firefly/service.yaml new file mode 100644 index 0000000..5d9447b --- /dev/null +++ b/apps/firefly/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: firefly +spec: + selector: + app: firefly + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/freshrss/deployment.yaml b/apps/freshrss/deployment.yaml new file mode 100644 index 0000000..c8c93de --- /dev/null +++ b/apps/freshrss/deployment.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: freshrss +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: freshrss + template: + metadata: + labels: + app: freshrss + spec: + containers: + - name: freshrss + image: freshrss/freshrss:1.30.1 + ports: + - name: http + containerPort: 80 + env: + - name: TZ + value: Europe/Paris + # Refresh feeds every 20 min (built-in cron). + - name: CRON_MIN + value: "*/20" + - name: TRUSTED_PROXY + value: 10.42.0.0/16 + volumeMounts: + - name: data + mountPath: /var/www/FreshRSS/data + subPath: data + - name: data + mountPath: /var/www/FreshRSS/extensions + subPath: extensions + resources: + requests: + cpu: 20m + memory: 64Mi + limits: + memory: 256Mi + volumes: + - name: data + persistentVolumeClaim: + claimName: freshrss-data diff --git a/apps/freshrss/ingress.yaml b/apps/freshrss/ingress.yaml new file mode 100644 index 0000000..1bec341 --- /dev/null +++ b/apps/freshrss/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: freshrss +spec: + ingressClassName: traefik + rules: + - host: rss.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: freshrss + port: + name: http diff --git a/apps/freshrss/kustomization.yaml b/apps/freshrss/kustomization.yaml new file mode 100644 index 0000000..6f15a99 --- /dev/null +++ b/apps/freshrss/kustomization.yaml @@ -0,0 +1,8 @@ +# RSS reader, SQLite. First visit runs the setup wizard. https://rss.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/freshrss/pvc.yaml b/apps/freshrss/pvc.yaml new file mode 100644 index 0000000..359b572 --- /dev/null +++ b/apps/freshrss/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: freshrss-data +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 2Gi diff --git a/apps/freshrss/service.yaml b/apps/freshrss/service.yaml new file mode 100644 index 0000000..529feb0 --- /dev/null +++ b/apps/freshrss/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: freshrss +spec: + selector: + app: freshrss + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/hedgedoc/deployment.yaml b/apps/hedgedoc/deployment.yaml new file mode 100644 index 0000000..d0be26b --- /dev/null +++ b/apps/hedgedoc/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hedgedoc +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: hedgedoc + template: + metadata: + labels: + app: hedgedoc + spec: + securityContext: + fsGroup: 10000 + containers: + - name: hedgedoc + image: quay.io/hedgedoc/hedgedoc:1.12.0 + ports: + - name: http + containerPort: 3000 + # CMD_DB_URL (postgres://hedgedoc:...@postgres.postgres.svc/hedgedoc) + # and CMD_SESSION_SECRET. + envFrom: + - secretRef: + name: hedgedoc-secrets + env: + - name: CMD_DOMAIN + value: md.un-oeil.fr + - name: CMD_PROTOCOL_USESSL + value: "true" + - name: CMD_URL_ADDPORT + value: "false" + # Only people with an account can create notes. + - name: CMD_ALLOW_ANONYMOUS + value: "false" + - name: CMD_ALLOW_EMAIL_REGISTER + value: "true" + volumeMounts: + - name: uploads + mountPath: /hedgedoc/public/uploads + readinessProbe: + httpGet: + path: /_health + port: http + initialDelaySeconds: 15 + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + memory: 512Mi + volumes: + - name: uploads + persistentVolumeClaim: + claimName: hedgedoc-uploads diff --git a/apps/hedgedoc/ingress.yaml b/apps/hedgedoc/ingress.yaml new file mode 100644 index 0000000..97ae016 --- /dev/null +++ b/apps/hedgedoc/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: hedgedoc +spec: + ingressClassName: traefik + rules: + - host: md.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: hedgedoc + port: + name: http diff --git a/apps/hedgedoc/kustomization.yaml b/apps/hedgedoc/kustomization.yaml new file mode 100644 index 0000000..32d36f3 --- /dev/null +++ b/apps/hedgedoc/kustomization.yaml @@ -0,0 +1,9 @@ +# Collaborative markdown, data in the shared Postgres. https://md.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/hedgedoc/pvc.yaml b/apps/hedgedoc/pvc.yaml new file mode 100644 index 0000000..10fdb47 --- /dev/null +++ b/apps/hedgedoc/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: hedgedoc-uploads +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 5Gi diff --git a/apps/hedgedoc/service.yaml b/apps/hedgedoc/service.yaml new file mode 100644 index 0000000..93c0716 --- /dev/null +++ b/apps/hedgedoc/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: hedgedoc +spec: + selector: + app: hedgedoc + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/homepage/config/bookmarks.yaml b/apps/homepage/config/bookmarks.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/apps/homepage/config/bookmarks.yaml @@ -0,0 +1 @@ +[] diff --git a/apps/homepage/config/services.yaml b/apps/homepage/config/services.yaml new file mode 100644 index 0000000..4487041 --- /dev/null +++ b/apps/homepage/config/services.yaml @@ -0,0 +1,98 @@ +# siteMonitor: Homepage checks each URL itself and shows a green/red dot. +# Uptime Kuma (status.un-oeil.fr) remains the source of alerts. +- Infra: + - Proxmox: + href: https://proxmox.un-oeil.fr + siteMonitor: https://proxmox.un-oeil.fr + icon: proxmox.svg + - Uptime Kuma: + href: https://status.un-oeil.fr + siteMonitor: https://status.un-oeil.fr + icon: uptime-kuma.svg + - Pelican: + href: https://pelican.un-oeil.fr + siteMonitor: https://pelican.un-oeil.fr + icon: pelican-panel.svg + - ntfy: + href: https://ntfy.un-oeil.fr + siteMonitor: https://ntfy.un-oeil.fr/v1/health + icon: ntfy.svg + +- Services: + - Nextcloud: + href: https://cloud.un-oeil.fr + siteMonitor: https://cloud.un-oeil.fr/status.php + icon: nextcloud.svg + - Vaultwarden: + href: https://vault.un-oeil.fr + siteMonitor: https://vault.un-oeil.fr/alive + icon: vaultwarden.svg + - Forgejo: + href: https://forgejo.un-oeil.fr + siteMonitor: https://forgejo.un-oeil.fr/api/healthz + icon: forgejo.svg + - Jellyfin: + href: https://jellyfin.un-oeil.fr + siteMonitor: https://jellyfin.un-oeil.fr/health + icon: jellyfin.svg + - Overleaf: + href: https://latex.un-oeil.fr + siteMonitor: https://latex.un-oeil.fr + icon: overleaf.svg + - Paperless: + href: https://paperless.un-oeil.fr + siteMonitor: https://paperless.un-oeil.fr + icon: paperless-ngx.svg + - Wiki.js: + href: https://wiki.un-oeil.fr + siteMonitor: https://wiki.un-oeil.fr/healthz + icon: wikijs.svg + - Firefly III: + href: https://firefly.un-oeil.fr + siteMonitor: https://firefly.un-oeil.fr + icon: firefly.svg + - Leaderboard: + href: https://leaderboard.un-oeil.fr + siteMonitor: https://leaderboard.un-oeil.fr + +- Outils: + - Etherpad: + href: https://pad.un-oeil.fr + siteMonitor: https://pad.un-oeil.fr + icon: etherpad.svg + - HedgeDoc: + href: https://md.un-oeil.fr + siteMonitor: https://md.un-oeil.fr/_health + icon: hedgedoc.svg + - Vikunja: + href: https://tasks.un-oeil.fr + siteMonitor: https://tasks.un-oeil.fr + icon: vikunja.svg + - FreshRSS: + href: https://rss.un-oeil.fr + siteMonitor: https://rss.un-oeil.fr + icon: freshrss.svg + - Linkwarden: + href: https://links.un-oeil.fr + siteMonitor: https://links.un-oeil.fr + icon: linkwarden.svg + - SearXNG: + href: https://search.un-oeil.fr + siteMonitor: https://search.un-oeil.fr/healthz + icon: searxng.svg + - n8n: + href: https://n8n.un-oeil.fr + siteMonitor: https://n8n.un-oeil.fr/healthz + icon: n8n.svg + - PrivateBin: + href: https://paste.un-oeil.fr + siteMonitor: https://paste.un-oeil.fr + icon: privatebin.svg + - Stirling-PDF: + href: https://pdf.un-oeil.fr + siteMonitor: https://pdf.un-oeil.fr + icon: stirling-pdf.svg + - IT-Tools: + href: https://tools.un-oeil.fr + siteMonitor: https://tools.un-oeil.fr + icon: it-tools.svg diff --git a/apps/homepage/config/settings.yaml b/apps/homepage/config/settings.yaml new file mode 100644 index 0000000..85a17d6 --- /dev/null +++ b/apps/homepage/config/settings.yaml @@ -0,0 +1,15 @@ +title: un-oeil homelab +language: fr +theme: dark +color: slate +headerStyle: clean +layout: + Infra: + style: row + columns: 4 + Services: + style: row + columns: 4 + Outils: + style: row + columns: 4 diff --git a/apps/homepage/config/widgets.yaml b/apps/homepage/config/widgets.yaml new file mode 100644 index 0000000..2868b6a --- /dev/null +++ b/apps/homepage/config/widgets.yaml @@ -0,0 +1,9 @@ +- search: + provider: custom + url: https://search.un-oeil.fr/search?q= + target: _blank +- datetime: + text_size: md + format: + dateStyle: long + timeStyle: short diff --git a/apps/homepage/deployment.yaml b/apps/homepage/deployment.yaml new file mode 100644 index 0000000..5031608 --- /dev/null +++ b/apps/homepage/deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: homepage +spec: + replicas: 1 + selector: + matchLabels: + app: homepage + template: + metadata: + labels: + app: homepage + spec: + containers: + - name: homepage + image: ghcr.io/gethomepage/homepage:v2.5.0 + ports: + - name: http + containerPort: 3000 + env: + - name: HOMEPAGE_ALLOWED_HOSTS + value: home.un-oeil.fr + volumeMounts: + # Homepage writes to /app/config (logs, missing default files), so + # the directory is writable and only our files come from the + # ConfigMap. + - name: config-dir + mountPath: /app/config + - name: config + mountPath: /app/config/settings.yaml + subPath: settings.yaml + - name: config + mountPath: /app/config/services.yaml + subPath: services.yaml + - name: config + mountPath: /app/config/widgets.yaml + subPath: widgets.yaml + - name: config + mountPath: /app/config/bookmarks.yaml + subPath: bookmarks.yaml + resources: + requests: + cpu: 20m + memory: 64Mi + limits: + memory: 256Mi + volumes: + - name: config-dir + emptyDir: {} + - name: config + configMap: + name: homepage-config diff --git a/apps/homepage/ingress.yaml b/apps/homepage/ingress.yaml new file mode 100644 index 0000000..98b1cae --- /dev/null +++ b/apps/homepage/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: homepage +spec: + ingressClassName: traefik + rules: + - host: home.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: homepage + port: + name: http diff --git a/apps/homepage/kustomization.yaml b/apps/homepage/kustomization.yaml new file mode 100644 index 0000000..a9ee3c0 --- /dev/null +++ b/apps/homepage/kustomization.yaml @@ -0,0 +1,15 @@ +# Start page with links to every service. https://home.un-oeil.fr +# Edit config/*.yaml and push; the pod restarts with the new config. +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml + - service.yaml + - ingress.yaml +configMapGenerator: + - name: homepage-config + files: + - config/settings.yaml + - config/services.yaml + - config/widgets.yaml + - config/bookmarks.yaml diff --git a/apps/homepage/service.yaml b/apps/homepage/service.yaml new file mode 100644 index 0000000..e89e85b --- /dev/null +++ b/apps/homepage/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: homepage +spec: + selector: + app: homepage + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/it-tools/deployment.yaml b/apps/it-tools/deployment.yaml new file mode 100644 index 0000000..7879aff --- /dev/null +++ b/apps/it-tools/deployment.yaml @@ -0,0 +1,26 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: it-tools +spec: + replicas: 1 + selector: + matchLabels: + app: it-tools + template: + metadata: + labels: + app: it-tools + spec: + containers: + - name: it-tools + image: corentinth/it-tools:2024.10.22-7ca5933 + ports: + - name: http + containerPort: 80 + resources: + requests: + cpu: 10m + memory: 16Mi + limits: + memory: 64Mi diff --git a/apps/it-tools/ingress.yaml b/apps/it-tools/ingress.yaml new file mode 100644 index 0000000..76b2dfd --- /dev/null +++ b/apps/it-tools/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: it-tools +spec: + ingressClassName: traefik + rules: + - host: tools.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: it-tools + port: + name: http diff --git a/apps/it-tools/kustomization.yaml b/apps/it-tools/kustomization.yaml new file mode 100644 index 0000000..ad2575e --- /dev/null +++ b/apps/it-tools/kustomization.yaml @@ -0,0 +1,7 @@ +# Developer utilities, static site, no data. https://tools.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/it-tools/service.yaml b/apps/it-tools/service.yaml new file mode 100644 index 0000000..34b57d4 --- /dev/null +++ b/apps/it-tools/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: it-tools +spec: + selector: + app: it-tools + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/linkwarden/deployment.yaml b/apps/linkwarden/deployment.yaml new file mode 100644 index 0000000..dcd25db --- /dev/null +++ b/apps/linkwarden/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: linkwarden +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: linkwarden + template: + metadata: + labels: + app: linkwarden + spec: + containers: + - name: linkwarden + image: ghcr.io/linkwarden/linkwarden:v2.16.3 + ports: + - name: http + containerPort: 3000 + # DATABASE_URL and NEXTAUTH_SECRET. + envFrom: + - secretRef: + name: linkwarden-secrets + env: + - name: NEXTAUTH_URL + value: https://links.un-oeil.fr/api/v1/auth + volumeMounts: + # Page archives (screenshots, PDFs, readable copies). + - name: data + mountPath: /data/data + resources: + requests: + cpu: 100m + memory: 512Mi + # Archiving runs a headless Chromium. + limits: + memory: 2Gi + volumes: + - name: data + persistentVolumeClaim: + claimName: linkwarden-data diff --git a/apps/linkwarden/ingress.yaml b/apps/linkwarden/ingress.yaml new file mode 100644 index 0000000..e89dbb1 --- /dev/null +++ b/apps/linkwarden/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: linkwarden +spec: + ingressClassName: traefik + rules: + - host: links.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: linkwarden + port: + name: http diff --git a/apps/linkwarden/kustomization.yaml b/apps/linkwarden/kustomization.yaml new file mode 100644 index 0000000..81ec115 --- /dev/null +++ b/apps/linkwarden/kustomization.yaml @@ -0,0 +1,9 @@ +# Bookmarks + page archives, data in the shared Postgres. https://links.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/linkwarden/pvc.yaml b/apps/linkwarden/pvc.yaml new file mode 100644 index 0000000..9d8a97e --- /dev/null +++ b/apps/linkwarden/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: linkwarden-data +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 20Gi diff --git a/apps/linkwarden/service.yaml b/apps/linkwarden/service.yaml new file mode 100644 index 0000000..87b30e1 --- /dev/null +++ b/apps/linkwarden/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: linkwarden +spec: + selector: + app: linkwarden + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/n8n/deployment.yaml b/apps/n8n/deployment.yaml new file mode 100644 index 0000000..aed7454 --- /dev/null +++ b/apps/n8n/deployment.yaml @@ -0,0 +1,58 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: n8n +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: n8n + template: + metadata: + labels: + app: n8n + spec: + securityContext: + # The image runs as node (1000). + fsGroup: 1000 + containers: + - name: n8n + image: n8nio/n8n:2.43.3 + ports: + - name: http + containerPort: 5678 + envFrom: + - secretRef: + name: n8n-secrets + env: + - name: N8N_HOST + value: n8n.un-oeil.fr + - name: N8N_PROTOCOL + value: https + - name: WEBHOOK_URL + value: https://n8n.un-oeil.fr/ + - name: N8N_PROXY_HOPS + value: "1" + - name: GENERIC_TIMEZONE + value: Europe/Paris + - name: TZ + value: Europe/Paris + volumeMounts: + - name: data + mountPath: /home/node/.n8n + readinessProbe: + httpGet: + path: /healthz + port: http + resources: + requests: + cpu: 50m + memory: 256Mi + limits: + memory: 1Gi + volumes: + - name: data + persistentVolumeClaim: + claimName: n8n-data diff --git a/apps/n8n/ingress.yaml b/apps/n8n/ingress.yaml new file mode 100644 index 0000000..a3e7d75 --- /dev/null +++ b/apps/n8n/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: n8n +spec: + ingressClassName: traefik + rules: + - host: n8n.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: n8n + port: + name: http diff --git a/apps/n8n/kustomization.yaml b/apps/n8n/kustomization.yaml new file mode 100644 index 0000000..5427a99 --- /dev/null +++ b/apps/n8n/kustomization.yaml @@ -0,0 +1,9 @@ +# Workflow automation, SQLite. First visit creates the owner account. https://n8n.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/n8n/pvc.yaml b/apps/n8n/pvc.yaml new file mode 100644 index 0000000..e34ea99 --- /dev/null +++ b/apps/n8n/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: n8n-data +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 2Gi diff --git a/apps/n8n/service.yaml b/apps/n8n/service.yaml new file mode 100644 index 0000000..fea1f49 --- /dev/null +++ b/apps/n8n/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: n8n +spec: + selector: + app: n8n + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/ntfy/configmap.yaml b/apps/ntfy/configmap.yaml new file mode 100644 index 0000000..20461e7 --- /dev/null +++ b/apps/ntfy/configmap.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: ntfy-config +data: + server.yml: | + base-url: https://ntfy.un-oeil.fr + behind-proxy: true + cache-file: /var/lib/ntfy/cache.db + attachment-cache-dir: /var/lib/ntfy/attachments + # Nobody can read or publish without an account. Create users with + # `ntfy user add` (README). + auth-file: /var/lib/ntfy/user.db + auth-default-access: deny-all + # iOS only gets instant notifications through ntfy.sh's relay (it carries + # a poll request, not the message). + upstream-base-url: https://ntfy.sh diff --git a/apps/ntfy/deployment.yaml b/apps/ntfy/deployment.yaml new file mode 100644 index 0000000..5b989d9 --- /dev/null +++ b/apps/ntfy/deployment.yaml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ntfy +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: ntfy + template: + metadata: + labels: + app: ntfy + spec: + containers: + - name: ntfy + image: binwiederhier/ntfy:v2.29.0 + args: ["serve"] + ports: + - name: http + containerPort: 80 + volumeMounts: + - name: config + mountPath: /etc/ntfy + - name: data + mountPath: /var/lib/ntfy + readinessProbe: + httpGet: + path: /v1/health + port: http + resources: + requests: + cpu: 10m + memory: 32Mi + limits: + memory: 128Mi + volumes: + - name: config + configMap: + name: ntfy-config + - name: data + persistentVolumeClaim: + claimName: ntfy-data diff --git a/apps/ntfy/ingress.yaml b/apps/ntfy/ingress.yaml new file mode 100644 index 0000000..cd69fb0 --- /dev/null +++ b/apps/ntfy/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ntfy +spec: + ingressClassName: traefik + rules: + - host: ntfy.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: ntfy + port: + name: http diff --git a/apps/ntfy/kustomization.yaml b/apps/ntfy/kustomization.yaml new file mode 100644 index 0000000..aba09c9 --- /dev/null +++ b/apps/ntfy/kustomization.yaml @@ -0,0 +1,9 @@ +# Push notifications (Uptime Kuma, CrowdSec, n8n...). https://ntfy.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - configmap.yaml + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/ntfy/pvc.yaml b/apps/ntfy/pvc.yaml new file mode 100644 index 0000000..bae8255 --- /dev/null +++ b/apps/ntfy/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ntfy-data +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 2Gi diff --git a/apps/ntfy/service.yaml b/apps/ntfy/service.yaml new file mode 100644 index 0000000..f4b49cc --- /dev/null +++ b/apps/ntfy/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: ntfy +spec: + selector: + app: ntfy + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/paperless/deployment.yaml b/apps/paperless/deployment.yaml new file mode 100644 index 0000000..b6273e0 --- /dev/null +++ b/apps/paperless/deployment.yaml @@ -0,0 +1,76 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: paperless +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: paperless + template: + metadata: + labels: + app: paperless + spec: + containers: + - name: paperless + image: ghcr.io/paperless-ngx/paperless-ngx:3.3.0 + ports: + - name: http + containerPort: 8000 + # PAPERLESS_DBPASS, PAPERLESS_SECRET_KEY, PAPERLESS_ADMIN_PASSWORD. + envFrom: + - secretRef: + name: paperless-secrets + env: + - name: PAPERLESS_URL + value: https://paperless.un-oeil.fr + - name: PAPERLESS_REDIS + value: redis://valkey:6379 + - name: PAPERLESS_DBHOST + value: postgres.postgres.svc + - name: PAPERLESS_DBUSER + value: paperless + - name: PAPERLESS_DBNAME + value: paperless + # Created on first start only. Change the password in the UI. + - name: PAPERLESS_ADMIN_USER + value: admin + - name: PAPERLESS_OCR_LANGUAGE + value: fra+eng + - name: PAPERLESS_TIME_ZONE + value: Europe/Paris + # Longhorn volumes don't send inotify events reliably. + - name: PAPERLESS_CONSUMER_POLLING + value: "30" + volumeMounts: + - name: data + mountPath: /usr/src/paperless/data + - name: media + mountPath: /usr/src/paperless/media + - name: consume + mountPath: /usr/src/paperless/consume + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 60 + resources: + requests: + cpu: 100m + memory: 512Mi + # OCR is the memory-hungry part. + limits: + memory: 2Gi + volumes: + - name: data + persistentVolumeClaim: + claimName: paperless-data + - name: media + persistentVolumeClaim: + claimName: paperless-media + - name: consume + persistentVolumeClaim: + claimName: paperless-consume diff --git a/apps/paperless/ingress.yaml b/apps/paperless/ingress.yaml new file mode 100644 index 0000000..5908678 --- /dev/null +++ b/apps/paperless/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: paperless +spec: + ingressClassName: traefik + rules: + - host: paperless.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: paperless + port: + name: http diff --git a/apps/paperless/kustomization.yaml b/apps/paperless/kustomization.yaml new file mode 100644 index 0000000..a7e4190 --- /dev/null +++ b/apps/paperless/kustomization.yaml @@ -0,0 +1,10 @@ +# Document OCR + archive, metadata in the shared Postgres. https://paperless.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - pvc.yaml + - valkey.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/paperless/pvc.yaml b/apps/paperless/pvc.yaml new file mode 100644 index 0000000..31080d5 --- /dev/null +++ b/apps/paperless/pvc.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: paperless-data +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 2Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: paperless-media +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 50Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: paperless-consume +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 5Gi diff --git a/apps/paperless/service.yaml b/apps/paperless/service.yaml new file mode 100644 index 0000000..593ab1e --- /dev/null +++ b/apps/paperless/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: paperless +spec: + selector: + app: paperless + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/paperless/valkey.yaml b/apps/paperless/valkey.yaml new file mode 100644 index 0000000..3a2233f --- /dev/null +++ b/apps/paperless/valkey.yaml @@ -0,0 +1,39 @@ +# Task queue for Paperless. Nothing in it needs to survive a restart. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: valkey +spec: + replicas: 1 + selector: + matchLabels: + app: valkey + template: + metadata: + labels: + app: valkey + spec: + containers: + - name: valkey + image: valkey/valkey:8.1.10-alpine + ports: + - name: redis + containerPort: 6379 + resources: + requests: + cpu: 10m + memory: 32Mi + limits: + memory: 128Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: valkey +spec: + selector: + app: valkey + ports: + - name: redis + port: 6379 + targetPort: redis diff --git a/apps/postgres/backup-cronjob.yaml b/apps/postgres/backup-cronjob.yaml new file mode 100644 index 0000000..174bafa --- /dev/null +++ b/apps/postgres/backup-cronjob.yaml @@ -0,0 +1,38 @@ +# Nightly pg_dumpall streamed into restic on LXC 105, then a ping to the +# "Backup – Postgres (k3s)" Push monitor in Uptime Kuma. +# Suspended until postgres-backup-secrets exists (README, "Postgres backups"). +apiVersion: batch/v1 +kind: CronJob +metadata: + name: postgres-backup +spec: + suspend: true + schedule: "45 2 * * *" + timeZone: Europe/Paris + concurrencyPolicy: Forbid + jobTemplate: + spec: + backoffLimit: 1 + template: + spec: + restartPolicy: Never + containers: + - name: backup + image: postgres:17.11-alpine + envFrom: + - secretRef: + name: postgres-secrets + - secretRef: + name: postgres-backup-secrets + command: + - /bin/sh + - -ec + - | + set -o pipefail + apk add --no-cache restic curl >/dev/null + restic cat config >/dev/null 2>&1 || restic init + export PGPASSWORD="$POSTGRES_PASSWORD" + pg_dumpall -h postgres -U postgres \ + | restic backup --stdin --stdin-filename pg_dumpall.sql --host k3s-postgres + restic forget --host k3s-postgres --keep-daily 7 --keep-weekly 4 --keep-monthly 3 --prune + curl -fsS -m 10 -o /dev/null "$KUMA_PUSH_URL" diff --git a/apps/postgres/init/10-app-databases.sh b/apps/postgres/init/10-app-databases.sh new file mode 100644 index 0000000..9f4bd17 --- /dev/null +++ b/apps/postgres/init/10-app-databases.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# Runs once, on the first start with an empty data directory. One role and one +# database per app; passwords come from postgres-secrets. +# Adding an app later: run the same CREATE ROLE / CREATE DATABASE by hand +# (kubectl -n postgres exec -it postgres-0 -- psql -U postgres). +set -e +for app in wikijs paperless linkwarden firefly hedgedoc; do + var=$(echo "$app" | tr a-z A-Z)_DB_PASSWORD + eval pass=\$$var + psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" < Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: privatebin +spec: + ingressClassName: traefik + rules: + - host: paste.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: privatebin + port: + name: http diff --git a/apps/privatebin/kustomization.yaml b/apps/privatebin/kustomization.yaml new file mode 100644 index 0000000..9e3ce13 --- /dev/null +++ b/apps/privatebin/kustomization.yaml @@ -0,0 +1,8 @@ +# Encrypted pastebin. https://paste.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/privatebin/pvc.yaml b/apps/privatebin/pvc.yaml new file mode 100644 index 0000000..681c51e --- /dev/null +++ b/apps/privatebin/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: privatebin-data +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 1Gi diff --git a/apps/privatebin/service.yaml b/apps/privatebin/service.yaml new file mode 100644 index 0000000..c31a041 --- /dev/null +++ b/apps/privatebin/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: privatebin +spec: + selector: + app: privatebin + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/searxng/deployment.yaml b/apps/searxng/deployment.yaml new file mode 100644 index 0000000..733a2ae --- /dev/null +++ b/apps/searxng/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: searxng +spec: + replicas: 1 + selector: + matchLabels: + app: searxng + template: + metadata: + labels: + app: searxng + spec: + containers: + - name: searxng + image: searxng/searxng:2026.10.4-d48c4b555 + ports: + - name: http + containerPort: 8080 + envFrom: + - secretRef: + name: searxng-secrets + env: + - name: SEARXNG_BASE_URL + value: https://search.un-oeil.fr/ + readinessProbe: + httpGet: + path: /healthz + port: http + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + memory: 512Mi diff --git a/apps/searxng/ingress.yaml b/apps/searxng/ingress.yaml new file mode 100644 index 0000000..328b9b1 --- /dev/null +++ b/apps/searxng/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: searxng +spec: + ingressClassName: traefik + rules: + - host: search.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: searxng + port: + name: http diff --git a/apps/searxng/kustomization.yaml b/apps/searxng/kustomization.yaml new file mode 100644 index 0000000..393115f --- /dev/null +++ b/apps/searxng/kustomization.yaml @@ -0,0 +1,8 @@ +# Private metasearch, stateless. https://search.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/searxng/service.yaml b/apps/searxng/service.yaml new file mode 100644 index 0000000..1b163e5 --- /dev/null +++ b/apps/searxng/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: searxng +spec: + selector: + app: searxng + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/stirling-pdf/deployment.yaml b/apps/stirling-pdf/deployment.yaml new file mode 100644 index 0000000..b53fab7 --- /dev/null +++ b/apps/stirling-pdf/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: stirling-pdf +spec: + replicas: 1 + selector: + matchLabels: + app: stirling-pdf + template: + metadata: + labels: + app: stirling-pdf + spec: + containers: + - name: stirling-pdf + image: stirlingtools/stirling-pdf:3.1.0 + ports: + - name: http + containerPort: 8080 + env: + - name: SYSTEM_DEFAULTLOCALE + value: fr-FR + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 30 + resources: + requests: + cpu: 100m + memory: 512Mi + limits: + memory: 2Gi diff --git a/apps/stirling-pdf/ingress.yaml b/apps/stirling-pdf/ingress.yaml new file mode 100644 index 0000000..35ddcc6 --- /dev/null +++ b/apps/stirling-pdf/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: stirling-pdf +spec: + ingressClassName: traefik + rules: + - host: pdf.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: stirling-pdf + port: + name: http diff --git a/apps/stirling-pdf/kustomization.yaml b/apps/stirling-pdf/kustomization.yaml new file mode 100644 index 0000000..1130c93 --- /dev/null +++ b/apps/stirling-pdf/kustomization.yaml @@ -0,0 +1,7 @@ +# PDF toolkit. Files are processed in memory, nothing is kept. https://pdf.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/stirling-pdf/service.yaml b/apps/stirling-pdf/service.yaml new file mode 100644 index 0000000..bb24018 --- /dev/null +++ b/apps/stirling-pdf/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: stirling-pdf +spec: + selector: + app: stirling-pdf + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/vikunja/deployment.yaml b/apps/vikunja/deployment.yaml new file mode 100644 index 0000000..c9d112d --- /dev/null +++ b/apps/vikunja/deployment.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vikunja +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: vikunja + template: + metadata: + labels: + app: vikunja + spec: + securityContext: + fsGroup: 1000 + containers: + - name: vikunja + image: vikunja/vikunja:2.7.0 + ports: + - name: http + containerPort: 3456 + envFrom: + - secretRef: + name: vikunja-secrets + env: + - name: VIKUNJA_SERVICE_PUBLICURL + value: https://tasks.un-oeil.fr/ + - name: VIKUNJA_SERVICE_TIMEZONE + value: Europe/Paris + # Turn off once your account exists (README). + - name: VIKUNJA_SERVICE_ENABLEREGISTRATION + value: "true" + - name: VIKUNJA_DATABASE_TYPE + value: sqlite + - name: VIKUNJA_DATABASE_PATH + value: /app/vikunja/files/vikunja.db + volumeMounts: + - name: data + mountPath: /app/vikunja/files + resources: + requests: + cpu: 20m + memory: 64Mi + limits: + memory: 256Mi + volumes: + - name: data + persistentVolumeClaim: + claimName: vikunja-data diff --git a/apps/vikunja/ingress.yaml b/apps/vikunja/ingress.yaml new file mode 100644 index 0000000..1b4727f --- /dev/null +++ b/apps/vikunja/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: vikunja +spec: + ingressClassName: traefik + rules: + - host: tasks.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: vikunja + port: + name: http diff --git a/apps/vikunja/kustomization.yaml b/apps/vikunja/kustomization.yaml new file mode 100644 index 0000000..482e044 --- /dev/null +++ b/apps/vikunja/kustomization.yaml @@ -0,0 +1,9 @@ +# Tasks / projects, SQLite. https://tasks.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - pvc.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/vikunja/pvc.yaml b/apps/vikunja/pvc.yaml new file mode 100644 index 0000000..52676fe --- /dev/null +++ b/apps/vikunja/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: vikunja-data +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: longhorn + resources: + requests: + storage: 5Gi diff --git a/apps/vikunja/service.yaml b/apps/vikunja/service.yaml new file mode 100644 index 0000000..af2a079 --- /dev/null +++ b/apps/vikunja/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: vikunja +spec: + selector: + app: vikunja + ports: + - name: http + port: 80 + targetPort: http diff --git a/apps/wikijs/deployment.yaml b/apps/wikijs/deployment.yaml new file mode 100644 index 0000000..f04e8aa --- /dev/null +++ b/apps/wikijs/deployment.yaml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wikijs +spec: + replicas: 1 + selector: + matchLabels: + app: wikijs + template: + metadata: + labels: + app: wikijs + spec: + containers: + - name: wikijs + image: ghcr.io/requarks/wiki:2.5.314 + ports: + - name: http + containerPort: 3000 + envFrom: + - secretRef: + name: wikijs-secrets + env: + - name: DB_TYPE + value: postgres + - name: DB_HOST + value: postgres.postgres.svc + - name: DB_PORT + value: "5432" + - name: DB_USER + value: wikijs + - name: DB_NAME + value: wikijs + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 20 + resources: + requests: + cpu: 50m + memory: 256Mi + limits: + memory: 768Mi diff --git a/apps/wikijs/ingress.yaml b/apps/wikijs/ingress.yaml new file mode 100644 index 0000000..3db767e --- /dev/null +++ b/apps/wikijs/ingress.yaml @@ -0,0 +1,18 @@ +# Reached through Caddy (LXC 100) -> Traefik on 10.0.0.141-143:80. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: wikijs +spec: + ingressClassName: traefik + rules: + - host: wiki.un-oeil.fr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: wikijs + port: + name: http diff --git a/apps/wikijs/kustomization.yaml b/apps/wikijs/kustomization.yaml new file mode 100644 index 0000000..c6e0f3c --- /dev/null +++ b/apps/wikijs/kustomization.yaml @@ -0,0 +1,8 @@ +# Wiki, data in the shared Postgres. First visit runs the setup wizard. https://wiki.un-oeil.fr +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - sealed-secret.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/apps/wikijs/service.yaml b/apps/wikijs/service.yaml new file mode 100644 index 0000000..03b5a7d --- /dev/null +++ b/apps/wikijs/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: wikijs +spec: + selector: + app: wikijs + ports: + - name: http + port: 80 + targetPort: http