Score:0

NFS permissions (with AKS)

be flag

I'm mounting NFS (on the Azure Virtual Machine) into k8s (AKS). My application is running with Apache (www-data user). Now for some reason I cannot eventually comprehend my application errors with permission denied error, namely it cannot write into mounted NFS volume. It is clearly permissions issue and also I messed it all up together.

Application run by Apache: uid=33(www-data) gid=33(www-data) groups=33(www-data) Exported from NFS directory and all its children (recursively): I've chowned them to www-data:www-data.

When I type id in the container I'm root: uid=0(root) gid=0(root) groups=0(root),1000 When I touch new file in the container in the mounted volume it has permissions: uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup). It is a bit surprising.

When I type id in the NFS server: uid=1000(azureuser) gid=1000(azureuser) groups=1000(azureuser) If I touch new file in NFS server it has: uid=1000(azureuser) gid=1000(azureuser) groups=1000(azureuser). So this I assume is connected with this declaration in deployment k8s config:

securityContext:
 fsGroup: 1000

/etc/exports file in the NFS I configured like so: /export 10.240.0.0/16(rw,async,insecure,fsid=0,crossmnt,no_subtree_check)

I'm confused what is what now, could you help me solving this and clarify what is what?

Btw the connection between NFS and AKS is established (I can create a file in the container in the mounted volume and it will be visible in the NFS server, also opposite works).

Mikolaj S. avatar
cn flag
Which Kubernetes version are you using?
Mikolaj S. avatar
cn flag
Could you please share a example pod definition with NFS volume + securityContext that you are using? How did you configure NFS server on VM? Could you please share steps / tutorial that you followed?
Wytrzymały Wiktor avatar
it flag
Hello @Murakami. Any updates?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.