# Kubernetes

# Plex Media Server - Volume Mounting

Reference: [https://www.plex.tv/blog/plex-pro-week-23-a-z-on-k8s-for-plex-media-server/](https://www.plex.tv/blog/plex-pro-week-23-a-z-on-k8s-for-plex-media-server/)  
Reference: [https://github.com/plexinc/pms-docker/tree/master/charts/plex-media-server](https://github.com/plexinc/pms-docker/tree/master/charts/plex-media-server)

Mounting CIFS Volume to PMS on Kubernetes (values).

```yaml
rclone:
  # if the rclone sidecar should be created
  enabled: true

  # The name of the secret that contains the rclone configuration file.
  # The key must be called `rclone.conf` in the secret
  configSecret: "plex-rconf"

  # the remote drive that should be mounted using rclone
  # this must be in the form of `name:[/optional/path]`
  # this remote will be mounted at `/data/name` in the PMS container
  remotes: 
    - video:/video

  # if the remote volumes should be mounted as read only
  readOnly: true
```

rclone.conf must be a secret in the following format (anonymous access):

```yaml
apiVersion: v1
kind: Secret
metadata:
  name: plex-rconf
type: Opaque
stringData:
  rclone.conf: |
    [video]
    type = smb
    host = 10.10.10.10
    user = guest

```

Effectivly mounting \\\\10.10.10.10\\video

# k3s - Multiple network interfaces

k3s will pick the first address it finds as node ip.

Adding --flannel-iface and/or --node-ip will allow to configure the addresses.

Reference: [https://docs.k3s.io/cli/server](https://docs.k3s.io/cli/server)

Removing gateway from all interfaces except one will be choosen as default route.

# Plex Media Server - iGPU Mounting

/dev/dri mounted through container for iGPU usage

```yaml
# Optionally specify additional volume mounts for the PMS and init containers.
extraVolumeMounts:
  - name: dev-dri
    mountPath: /dev/dri
    
# extraVolumeMounts:
#   - name: some-volume-name
#     mountPath: /path/in/container


# Optionally specify additional volumes for the pod.
extraVolumes:
  - name: dev-dri
    hostPath: 
      path: /dev/dri
# extraVolumes:
#   - name: some-volume-name
#     emptyDir: {}
```

Reference: [https://github.com/plexinc/pms-docker/tree/master/charts/plex-media-server](https://github.com/plexinc/pms-docker/tree/master/charts/plex-media-server)

# k3s increase inotify

When you encounter the following error on k3s/k8s:

```json
{"component":"virt-handler","level":"fatal","msg":"Failed to create an inotify watcher","pos":"cert-manager.go:105","reason":"too many open files","timestamp":"2025-08-19T21:31:37.405064Z"}
```

You may increase the following value fs.inotify.max\_user\_instances = 8192. It defaults to 128 on Debian 13. You may check fs.inotify.max\_user\_watches as well. However its handled dynamically in most cases.

```bash
 sysctl -w fs.inotify.max_user_instances=8192
```

Its recommended to make it persistent by creating a file in /etc/systctl.d/.