NFS shares mounted in ReadOnly mode on TKGi worker
search cancel

NFS shares mounted in ReadOnly mode on TKGi worker

book

Article ID: 410510

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

PodA is mounting an NFS share in readOnly mode.

PodA spec:

    spec:
      containers:
      - name: podA
        image: busybox
        command: [ "sh", "-c", "sleep 3600" ]
        volumeMounts:
        - mountPath: /data/pod
          name: pvc-data
      volumes:
      - name: pvc-data
        persistentVolumeClaim:
          claimName: pvc-data
          readOnly: true

The volume is mounted on the Worker and Pod in readOnly mode.

10.###.###.250:/srv/nfs_share on /var/vcap/data/kubelet/pods/2b21e33c-####-####-####-##########/volumes/kubernetes.io~nfs/pvc-data type nfs (ro,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.###.###.250,mountvers=3,mountport=43606,mountproto=udp,local_lock=none,addr=10.###.###.250)

 

PodB is attempting to mount the same NFS share in readWrite mode.

    spec:
      containers:
      - name: podB
        image: busybox
        command: [ "sh", "-c", "sleep 3600" ]
        volumeMounts:
        - mountPath: /data/pod
          name: pvc-dataB
      volumes:
      - name: pvc-dataB
        persistentVolumeClaim:
          claimName: pvc-data

However the volume is mounted on the Worker in readOnly mode. It should be mounted in ReadWrite mode.

10.###.###.250:/srv/nfs_share on /var/vcap/data/kubelet/pods/e4cf0a27-####-####-####-##########/volumes/kubernetes.io~nfs/pvc-data type nfs (ro,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.###.###.250,mountvers=3,mountport=43606,mountproto=udp,local_lock=none,addr=10.###.###.250)

 

Environment

TKGi 1.22 and Stemcell 1.844

Cause

The first pod starts on the Worker node and mounts the share in readOnly mode. This causes subsequent mounts of the same share to also be mounted in readOnly on the same Worker.

Resolution

This issue is being investigated by TKGi R&D team.

To workaround the issue, update the Pod spec to mount the volume in readWrite mode.