NFS or other ReadWriteMany volumes for GKE AutoPilot

Viewed 521

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?

1 Answers

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
Related