简体   繁体   中英

Access files from NFS mount with service account in kubernetes pod

I am looking for some help/suggestions with kubernetes. I am trying to mount an NFS shared drive to the docker container running inside a kubernetes pod so that I can access the files inside that drive from code that runs inside the docker container. I was able to successfully mount the drive and I am able to see that based on the kubectl logs for the running pod.

But my problem is that only a service account has access to the contents of the folder I need to access and I am not sure how to use the service account to access the files. I am totally new to the the kubernetes world and trying to understand and learn how this kind of scenarios are handled. I used helm charts for configuring the NFS mount.

So generally mounting directly inside a Docker container is not the greatest solution.

What you should rather look at when mounting data, is to create a PersistentVolume and PersistentClaim in Kubernetes and mount that to the pod. This abstract Storage specifics from your application specifics.

You can find more information on the Kubernetes blog .

In here they explain about using NFS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM