3

The only option I could find for rwmany on GKE is NFS, and I went with this tutorial:

https://medium.com/@Sushil_Kumar/readwritemany-persistent-volumes-in-google-kubernetes-engine-a0b93e203180

The only problem is that it contains the spec

    spec:
      containers:
        - name: nfs-server
          image: k8s.gcr.io/volume-nfs:0.8
          ports:
            - name: nfs
              containerPort: 2049
            - name: mountd
              containerPort: 20048
            - name: rpcbind
              containerPort: 111
          securityContext:
            privileged: true

The problem being privileged: true. This is not allowed on AutoPilot. Any ideas how to get around this limitation?

yspreen
  • 1,759
  • 2
  • 20
  • 44
  • Perhaps check [filestore](https://stackoverflow.com/questions/54796639/how-do-i-create-a-persistent-volume-claim-with-readwritemany-in-gke) – dany L Aug 18 '21 at 20:00
  • I agree - filestore is a good option here. If you want dynamic provisioning, you can use the Filestore CSI driver: https://github.com/kubernetes-sigs/gcp-filestore-csi-driver – Gari Singh Aug 19 '21 at 08:56
  • 2
    doesn't filestore start at 1TB? That's way too much for us – yspreen Aug 19 '21 at 13:17

1 Answers1

0

As I see in this documentation Privileged containers are not permitted in Autopilot and that's probably why the NFS server didn't work.

My recomendations are

  1. Use a Standar Cluster
  2. Have the NFS server outside the cluster as in a normal VM
  3. Use a managed service like Filestore
  • 2. is what I went with. It seems like an ugly hack though, and I hoped there might be a better solution – yspreen Aug 19 '21 at 13:18