feat(linkding): add snapshots PVC

not VolSynced cuz this is more "nice to have" archival data than critical data
This commit is contained in:
JJGadgets
2024-06-03 07:58:14 +08:00
parent df58e84193
commit 611c22fd09
5 changed files with 28 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ spec:
main:
type: deployment
replicas: 1
strategy: RollingUpdate # only snapshots data might be written to disk directly, external Postgres used
pod:
labels:
ingress.home.arpa/nginx-internal: "allow"
@@ -32,11 +33,15 @@ spec:
tag: "1.30.0-plus-alpine@sha256:83a77a850a1b61b97b8f1f75b0bf12b0fd0fd7abd232a4a91faf5efdc9168387"
env:
TZ: "${CONFIG_TZ}"
# Security
LD_ENABLE_OIDC: "True"
LD_CSRF_TRUSTED_ORIGINS: "https://${APP_DNS_LINKDING}"
# Options
LD_SERVER_PORT: &http "8080"
LD_LOG_X_FORWARDED_FOR: "true"
LD_FAVICON_PROVIDER: "https://icons.duckduckgo.com/ip3/{domain}.ico"
LD_SINGLEFILE_PATH: &snap "/snapshots" # archive whole page locally
# Database
LD_DB_ENGINE: "postgres"
LD_DB_OPTIONS: |-
{"sslmode": "require"}
@@ -114,6 +119,11 @@ spec:
- subPath: "tmp"
path: "/tmp"
readOnly: false
snapshots:
existingClaim: linkding-snapshots
globalMounts:
- subPath: "data"
path: *snap
defaultPodOptions:
automountServiceAccountToken: false
enableServiceLinks: false

View File

@@ -0,0 +1,18 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "linkding-snapshots"
namespace: &app "linkding"
annotations:
description: "PVC for saving Linkding page snapshots (similar to Wayback)"
labels:
app.kubernetes.io/name: *app
snapshot.home.arpa/enabled: "true"
kustomize.toolkit.fluxcd.io/prune: "Disabled"
spec:
storageClassName: "file"
accessModes: ["ReadWriteMany"]
resources:
requests:
storage: "100Gi"