Pls add nfs support when docker package

When I try to deploy node-red in k8s, there will be an error that no nfs support.
Pls add nfs when docker package.

Logs show:

  Warning  FailedMount  2s  kubelet  MountVolume.SetUp failed for volume "pvc-075917ea-7e74-4f59-8268-2c321bed7bed" : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/61206e57-819c-4a06-b8df-24167bcb7399/volumes/kubernetes.io~nfs/pvc-075917ea-7e74-4f59-8268-2c321bed7bed --scope -- mount -t nfs 10.80.105.120:/var/nfsroot/k8s/default-node-red-pvc-pvc-075917ea-7e74-4f59-8268-2c321bed7bed /var/lib/kubelet/pods/61206e57-819c-4a06-b8df-24167bcb7399/volumes/kubernetes.io~nfs/pvc-075917ea-7e74-4f59-8268-2c321bed7bed
Output: Running scope as unit: run-rba0b6e4eaa5547139384b53795fc48c1.scope
mount: /var/lib/kubelet/pods/61206e57-819c-4a06-b8df-24167bcb7399/volumes/kubernetes.io~nfs/pvc-075917ea-7e74-4f59-8268-2c321bed7bed: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.

This is my yaml

apiVersion: v1
kind: Service
metadata:
  name: node-red-svc
  namespace: default
spec:
  type: NodePort
  ports:
    - port: 1880
      nodePort: 8720
      targetPort: 1880
  selector:
    k8s-app: node-red

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: node-red-pvc
  namespace: default
spec:
  storageClassName: "nfs"
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    k8s-app: node-red
  name: node-red-deployment
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: node-red
  template:
    metadata:
      labels:
        k8s-app: node-red
    spec:
      containers:
      - name: node-red
        image: nodered/node-red
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 1880
        volumeMounts:
        - name: storage
          mountPath: /data
          subPath: nodered
      nodeSelector:
        kubernetes.io/hostname: "node1"
      restartPolicy: Always
      volumes:
      - name: storage
        persistentVolumeClaim:
          claimName: node-red-pvc

the stock node-red docker file is kept as minimalistic as possible.

If you have package requirements its best to build your own docker node-red image. Its easy....follow the directions.

Mounting volumes should be handled by the the machine hosting the Kubernetes node not the individual containers.

Just to be clear, I'm saying you need to add NFS mount support to your K8s node, not the container.

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