Jump to content

[Kubernetes] NFS share problem


SGBVida
 Share

Recommended Posts

SGBVida

Hello,

I used emby on docker right now and i want to migrate to k8s...

With the following manifest i can deploy emby and access it:

apiVersion: v1
kind: Service
metadata:
  labels:
    app: emby-server
  name: emby-server
  namespace: media
spec:
  ports:
    - name: http
      port: 8096
      protocol: TCP
    - name: https
      port: 8920
      protocol: TCP
  selector:
    app: emby-server
 ---
 apiVersion: apps/v1
kind: Deployment
metadata:
  name: emby-server
  namespace: media
spec:
  replicas: 1
  selector:
    matchLabels:
      app: emby-server
  template:
    metadata:
      labels:
        app: emby-server
    spec:
      containers:
        - image: 'emby/embyserver:latest'
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /web/index.html
              port: 8096
            timeoutSeconds: 30
          name: emby-server
          ports:
            - containerPort: 8096
            - containerPort: 8920
          readinessProbe:
            httpGet:
              path: /web/index.html
              port: 8096
            timeoutSeconds: 30
          volumeMounts:
            - mountPath: /mnt/library
              name: media-library
            - mountPath: /mnt/perso
              name: media-library-perso
      volumes:
        - name: media-library
          nfs:
            path: /volume1/Data/k8s
            server: 192.168.x.x
        - name: media-library-perso
          nfs:
            path: /volume1/Data/k8s/Photos
            server: 192.168.x.x
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: emby-server
  namespace: media
spec:
  entryPoints:
    - websecure
  routes:
    - kind: Rule
      match: Host(`emby-dev.xxxx.fr`)
      services:
        - name: emby-server
          port: 8096
  tls:
    secretName: xxxxxxxxxx

 

From this point i have 2 issues:

- I can browse the folder (GUI) but he's empty and if i access it in cli and show the contents of the folder i can see my files.

image.png.71525fe3570c7144c3e706556bfb6eed.png

image.png.b08372ea03a765b4c8c7778d762769b0.png

 

MY second problem is i can't reach a subfolder in the GUI.

on my Nas i have many folders under /volume1/Data/k8s but i have an error if i try to add it:

image.png.14a99dd19495a54f0522a4fb616b68c0.png

But i see then in cli:

image.png.bd893db7af0bc4a3dfd538045a3cf194.png

 

Did i miss something ?

 

Link to comment
Share on other sites

SGBVida

Ok i found the problem... this is a permission problem!

 

I mount the volume and check the permission, here it's 1024 forthe user and 100 for the group

image.png.ba4c1aa31b223c731441fa772e17f493.png

 

Now i need to update the deployment like this:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    argocd.argoproj.io/instance: media
  name: emby-server
  namespace: media
spec:
  replicas: 1
  selector:
    matchLabels:
      app: emby-server
  template:
    metadata:
      labels:
        app: emby-server
    spec:
      containers:
        - env:
            - name: UID
              value: '1024'
            - name: GID
              value: '100'
          image: 'emby/embyserver:latest'
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /web/index.html
              port: 8096
            timeoutSeconds: 30
          name: emby-server
          ports:
            - containerPort: 8096
            - containerPort: 8920
          readinessProbe:
            httpGet:
              path: /web/index.html
              port: 8096
            timeoutSeconds: 30
          volumeMounts:
            - mountPath: /mnt/library
              name: media-library
      volumes:
        - name: media-library
          nfs:
            path: /volume1/Data/k8s
            server: 192.168.x.x
       

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...