canonical/microk8s

NFS Volumes not working on microk8s with strict confinement

Naegionn opened this issue · 1 comments

Summary

I am trying to use standard (non PV) nfs volumes on my strict microk8s 1.29 Installation (accroding to charmed kubeflow installation)
I have nfs file shares that are shared between multiple systems some of them without k8s.
These shared need to be mounted as simple nfs volume to some pods.

volumes:
      - name: shared-storage
        nfs:
          server: shared-storage.local
          path: /pool/share1

On the host I have nfs-common installed but it cant be used likely due to strict confinement.

Events:
  Type     Reason       Age                  From     Message
  ----     ------       ----                 ----     -------
  Warning  FailedMount  17s (x65 over 116m)  kubelet  MountVolume.SetUp failed for volume "shared-storage" : mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t nfs shared-storgage.local:/pool/share1 /var/snap/microk8s/common/var/lib/kubelet/pods/2c4d03f0-ff66-460f-838c-5b222d8628e2/volumes/kubernetes.io~nfs/shared-storage
Output: mount: /var/snap/microk8s/common/var/lib/kubelet/pods/2c4d03f0-ff66-460f-838c-5b222d8628e2/volumes/kubernetes.io~nfs/shared-storage: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.

Trying to link nfs-mount to microk8s does not work:

lukas@yavin1:~$ sudo snap connect microk8s:nfs-mount                                                                                                                                                                                                                          error: snap "microk8s" has no plug named "nfs-mount"                                                                                                                                                                                                                                    

What Should Happen Instead?

I expect microk8s to mount the nfs volume, maybe after I have executed connect:microk8s:nfs-mount

Reproduction Steps

  1. Install microk8s sudo snap install microk8s --channel=1.29-strict/stable
  2. Install sudo apt install nfs-common
  3. Apply deployment manifest that is using nfs volume
  4. It does not work
  5. Try linking microk8s and nfs-mount, it does not work either

Introspection Report

Can you suggest a fix?

Allow strict confinement to use nfs-volume. maybe by a connection

Are you interested in contributing with a fix?

Yes, but I dont know how

Hey this is still an issue for me, some input would be appreciated