linuxserver / docker-emulatorjs

Web based retro emulation frontend with rom scanning and automated art ingestion.
GNU General Public License v3.0
509 stars 51 forks source link

Volume mounts for k8s #29

Closed zenmaster24 closed 1 year ago

zenmaster24 commented 1 year ago

This seems like an awesome self hosting project - as such I wanted to trial running this in kubernetes (k3s) - I am trying to re-use a directory I already have for roms, but they do not seem to get picked up. I can upload roms successfully through the content management portal, and start a test uploaded rom from the webui. The local filesystem has permission set 777 for testing.

I am using line 80 of this readme to determine that presenting volumeMounts are possible.

Expected Behavior

The webui/content management ui should show all roms presented through the mounted volume.

Current Behavior

The webui/content managment ui show the volume names (snes and segaMD) as presented through the options given in the manifest, but do not show the local rom files, only uploaded roms.

Steps to Reproduce

  1. Apply this manifest
    ---
    apiVersion: v1
    kind: Namespace
    metadata:
    name: emulatorjs
    ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: emulatorjs-pv-claim
    namespace: emulatorjs
    labels:
    app: emulatorjs
    spec:
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
      storage: 1Gi
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: emulatorjs
    namespace: emulatorjs
    spec:
    selector:
    matchLabels:
      app: emulatorjs
    replicas: 1
    template:
    metadata:
      labels:
        app: emulatorjs
    spec:
      containers:
      - name: emulatorjs
        image: lscr.io/linuxserver/emulatorjs:latest
        ports:
        - containerPort: 3000
          name: management
        - containerPort: 80
          name: webui
        env:
        - name: TZ
          value: Australia/Sydney
        - name: SUBFOLDER
          value: /emulatorjs/
        volumeMounts:
        - mountPath: /data/snes/roms
          name: snes
        - mountPath: /data/segaMD/roms
          name: segamd
        imagePullPolicy: IfNotPresent
      volumes:
      - name: snes
        hostPath:
          path: /share/CACHEDEV2_DATA/roms/snes
      - name: segamd
        hostPath:
          path: /share/CACHEDEV2_DATA/roms/genesis
    ---
    apiVersion: v1
    kind: Service
    metadata:
    name: emulatorjs
    namespace: emulatorjs
    labels:
    app: emulatorjs
    spec:
    clusterIP: None
    ports:
    - port: 80
    protocol: TCP
    name: webui
    - port: 3000
    protocol: TCP
    name: management
    selector:
    app: emulatorjs
    ---
    apiVersion: traefik.containo.us/v1alpha1
    kind: IngressRoute
    metadata:
    name: emulatorjs-http
    namespace: emulatorjs
    spec:
    entryPoints:
    - web
    routes:
    - match: PathPrefix(`/{path:(?i:emulatorjs)}`)
      kind: Rule
      services:
      - name: emulatorjs
        port: 3000
    ---
    apiVersion: traefik.containo.us/v1alpha1
    kind: IngressRoute
    metadata:
    name: emulatorjs-https
    namespace: emulatorjs
    spec:
    entryPoints:
    - websecure
    routes:
    - match: PathPrefix(`/{path:(?i:emulatorjs)}`)
      kind: Rule
      services:
      - name: emulatorjs
        port: 80
      middlewares:
      - name: emulatorjs-stripprefix
        namespace: emulatorjs
    ---
    apiVersion: traefik.containo.us/v1alpha1
    kind: Middleware
    metadata:
    name: emulatorjs-stripprefix
    namespace: emulatorjs
    spec:
    stripPrefix:
    prefixes:
      - '/emulatorjs'

    Environment

    OS: Linux CPU architecture: x86_64 How docker service was installed: OS provided

Command used to create docker container (run/create/compose/screenshot)

kubectl apply -f ./file.yaml

Docker logs

Nothing is logged to stdout of the pod - even if the content management page is successfully hit, so I am unsure if this is by design or a bug in the latest container.

Edit - looks like only ERRORS are logged to stdout. eg:

2022-09-18T18:19:25.443+1000    ERROR   bitswap providerquerymanager/providerquerymanager.go:338        Received provider (12D3KooWGdc7YV8RzAoW58i8iVVS8MYruaNvB9MC8UTqxrXAT3Nh) for cid (QmTdEd9pcvb5AQp5iwLVb9LpogzSXWosYZFAJrj8n2G6qW) not requested

Additional question: Can I present multiple volumeMounts that form part of the /data folder structure? Eg I would like to create a pvc for the downloading of the /data/main/* contents, and have that persist and be subsequently available to use for any replacement pod, but I would also want to present data/<emulator>/roms to the pod from my local file storage.

github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.