Using Rclone with Kubernetes

What is the problem you are having with rclone?

Hi, I’m having trouble with Rclone on Kubernetes. All my infrastructure use it and I would like to setup rclone with it.

As of now, I am successfully mounting my google drive in the container but I am not able to export the folder on my host. I think the problem is with the fuse filesystem used with rclone and Kubernetes doesn’t seem to have a correct way to use fuse.

Do you have any idea on how can I expose my drive from the container to the host ?
Thank you.
Here is my kubernetes yaml deployment file.

What is your rclone version (output from rclone version)

rclone --version
rclone v1.56.1

  • os/version: alpine 3.14.2 (64 bit)
  • os/kernel: 5.4.0-1042-raspi (aarch64)
  • os/type: linux
  • os/arch: arm64
  • go/version: go1.17.1
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google-drive

The rclone config contents with secrets removed.

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: rclone
  name: rclone
  namespace: rclone
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rclone
  template:
    metadata:
      labels:
        app: rclone
      annotations:
        container.apparmor.security.beta.kubernetes.io/rclone: localhost/fuse
    spec:
      serviceAccountName: default
      volumes:
      - name: share-data
        emptyDir: {}
      - name: rclone-data
        hostPath:
          path: /mnt/nfs/kubernetes/rclone/data
      - name: rclone-conf
        hostPath:
          path: /mnt/nfs/kubernetes/rclone/conf
      - name: rclone-passwd
        hostPath:
          path: /etc/passwd
      - name: rclone-group
        hostPath:
          path: /etc/group
      containers:
      - image: rclone/rclone:1.56
        name: rclone
        command: ["rclone"]
        args: ["mount", "google-drive:", "/data", "--allow-root", "--allow-other"]
        resources:
          limits:
            smarter-devices/fuse: 1
            memory: 512Mi
          requests:
            smarter-devices/fuse: 1
            cpu: 100m
            memory: 256Mi
        ports:
        - containerPort: 5572
          name: webui
          protocol: TCP
        volumeMounts:
        - name: rclone-data
          mountPath: /data
        - name: rclone-group
          mountPath: /etc/group
          readOnly: true
        - name: rclone-passwd
          mountPath: /etc/passwd
          readOnly: true
        - name: rclone-conf
          mountPath: /config/rclone
        securityContext:
          privileged: true
          capabilities:
            add: ["SYS_ADMIN", "SETPCAP", "MKNOD"]
      nodeSelector:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.