1

With Okteto Cloud, in order to let different pods/deployments access a shared PersistentVolumeClaim, I tried setting the PersistentVolumeClaim's accessModes to "ReadWriteMany":

{
    "kind": "PersistentVolumeClaim",
    "apiVersion": "v1",
    "metadata": {
        "name": "pv-claim-cpdownloads"
    },
    "spec": {
        "accessModes": [
            "ReadWriteMany"
        ],
        "resources": {
            "requests": {
                "storage": "10Gi"
            }
        }
    }
}

Applying my deployment with kubectl succeeds, but the deployment itself times out on the okteto web UI, with the error:

pod has unbound immediate PersistentVolumeClaims (repeated 55 times)

Now, the same PersistentVolumeClaim with accessModes set to "ReadWriteOnce" deploys just fine.

Is the accessMode "ReadWriteMany" disallowed on Okteto Cloud ?

If it is, how could I get several pods/deployments to access the same volume data ?

For precisions, in my case I think I technically only need one pod to write to the volume and the other one to read from it.

My use case is to have one container save files to a folder, and another container watches changes and loads files from that same folder.

Nicolas Marshall
  • 4,186
  • 9
  • 36
  • 54

1 Answers1

3

Okteo Cloud only supports the "ReadWriteOnce" access mode. If you share the volume between pods/deployments they will all go to the same node, which is equivalent to have a single reader/writer. But it is not a recommended practice.

What is your use case? why do you need to share volumes?

  • Added a bit more on what my use case is (or well, "was", since my goal was to install couchpotato + transmission + jellyfin on a server, and Ramiro just confirmed what I suspected, that bittorrent's not allowed on Okteto) In that setup transmission would have downloaded files to a folder, and Jellyfin would have served them in a web UI. – Nicolas Marshall Mar 23 '20 at 19:46
  • 1
    "ReadWriteOnce" should be ok then. Another option is to define both containers in the same deployment/pod, and share an "EmptyDir" volume between them. – Pablo Chico de Guzman Mar 24 '20 at 20:28
  • Thanks ! I didn't know EmptyDir volumes yet so I'll read a bit about that – Nicolas Marshall Mar 25 '20 at 19:00