0

I'm running a GKE cluster and I'm trying to get write access to the host filesystem from a pod using hostPath. The pod mounts the host path using:

    hostPath:
      path: /lib/modules

but its not granted write access. I have also tried with securityContext using:

 securityContext:
   runAsUser: 0
   runAsGroup: 0

and

allowPrivilegeEscalation: true

Is there some particular requirement needed to allow a pod to have write access to the host?

Thank you for your time.

  • Hi pantelis ampatzoglou, welcome to severfault. You will want to include the **error message** you received that you used to decide that you do not have write access. You would also ideally want to try `path: /` and see if you can write to _any_ directory, or if there is something special about `/lib/modules`. Good luck! – mdaniel Feb 17 '20 at 19:16
  • Your desire path is /lib/modules or that's just an example? Since it's read-only file system i think it might be hard to do, maybe even not possible, found similar issue [here](https://stackoverflow.com/questions/59005523/read-only-file-system-in-hostpath-so-unable-to-mount-volume), maybe initContainer which will change settings of the file is the way here. As @mdaniel already asked, do you have any errors to show? – Jakub Feb 18 '20 at 10:49

0 Answers0