Research-Stack/4-Infrastructure/k3s-flake/manifests/media/audiobookshelf.yaml
Brandon Schneider 6d9c4e23de fix(infra): standardize k3s cluster — Traefik, ingress, architecture docs, Ray GPU workers
Architecture alignment:
- Rewrite k3s-server.nix from aspirational role=server to actual role=agent
  (cupfox is the real control-plane at 100.110.163.82:6443)
- Update flake.nix: correct serverAddr for all nodes, annotate dead nodes,
  fix hostname from nixos-laptop to nixos
- Update join-agent.sh default SERVER to cupfox
- Document actual vs intended architecture in comments

Ingress:
- Add rs-apps-books Ingress for audiobookshelf (/apps/books → media ns)
- Add strip-apps-books middleware for prefix stripping
- Create ray-ingress.yaml for Ray dashboard at /server/ray

Ray:
- Fix raycluster.yaml: enable dashboard, mount /dev/dri on gpu-workers
- Point gpu-workers to qfox-1 (was neon-64gb)
- Remove nvidia.com/gpu resource dependency (use /dev/dri via Mesa)

Security:
- Move OPENID_CLIENT_SECRET from plaintext to K8s Secret ref
- Update manifest to use valueFrom.secretKeyRef

Cleanup:
- Remove 53 committed test PNG screenshots from git tracking
- Remove auth-state.json from git tracking
- Add *.png, *.json to tests/.gitignore

Build: no build needed
2026-05-31 23:13:04 -05:00

91 lines
2.2 KiB
YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: audiobookshelf-config
namespace: media
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: audiobookshelf
namespace: media
labels:
app: audiobookshelf
spec:
replicas: 1
selector:
matchLabels:
app: audiobookshelf
template:
metadata:
labels:
app: audiobookshelf
spec:
nodeSelector:
topology.researchstack.io/role: foxtop
containers:
- name: audiobookshelf
image: ghcr.io/advplyr/audiobookshelf:latest
ports:
- containerPort: 80
env:
- name: TZ
value: "America/Chicago"
- name: HOST
value: "0.0.0.0"
- name: ROUTER_BASE_PATH
value: "/audiobookshelf"
- name: OPENID_ENABLED
value: "true"
- name: OPENID_ISSUER_URL
value: "https://auth.researchstack.info"
- name: OPENID_CLIENT_ID
value: "sso-audiobookshelf"
- name: OPENID_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: audiobookshelf-oidc
key: OPENID_CLIENT_SECRET
- name: OPENID_REDIRECT_URI
value: "https://audiobooks.researchstack.info/audiobookshelf/auth/openid/callback"
volumeMounts:
- name: config
mountPath: /config
- name: metadata
mountPath: /metadata
- name: media
mountPath: /audiobooks
subPath: audiobooks
- name: media
mountPath: /podcasts
subPath: podcasts
volumes:
- name: config
persistentVolumeClaim:
claimName: audiobookshelf-config
- name: metadata
emptyDir: {}
- name: media
hostPath:
path: /mnt/media
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
name: audiobookshelf
namespace: media
spec:
type: NodePort
selector:
app: audiobookshelf
ports:
- port: 80
targetPort: 80
nodePort: 30807