Menu Close

Why are storage volumes in K8s a problem?

Why are storage volumes in K8s a problem?

Why Storage Volumes in K8s?? Data in a container are ephemeral, which presents problems for non-trivial applications such as databases when running in containers. First, when a container crashes, Kubernetes will restart the container in a clean state where all the data is lost.

How to Mount EFS as a persistent volume in Kubernetes?

Create storage class for EFS via efs-provisioner (only the first time): efs-provisioner runs as a container that plays the role of EFS broker. It allows other pods to mount EFS as the persistent volumes. Just be aware that EFS is built on top of NFS4, so you need to have nfs-common packages installed in your Kubernetes nodes.

Can a non root user mount a volume in Kubernetes?

This came as one of the challenges for the Kubernetes Deployments/StatefulSets, when you have to run process inside a container as non-root user. But, when you mount a volume to a pod, it always gets mounted with the permission of root:root. So, the non-root user must have access to the folder where it wants to read and write data.

Do you have to be root to mount a volume?

But, when you mount a volume to a pod, it always gets mounted with the permission of root:root. So, the non-root user must have access to the folder where it wants to read and write data. Please follow the below steps for the same.

Create storage class for EFS via efs-provisioner (only the first time): efs-provisioner runs as a container that plays the role of EFS broker. It allows other pods to mount EFS as the persistent volumes. Just be aware that EFS is built on top of NFS4, so you need to have nfs-common packages installed in your Kubernetes nodes.

This came as one of the challenges for the Kubernetes Deployments/StatefulSets, when you have to run process inside a container as non-root user. But, when you mount a volume to a pod, it always gets mounted with the permission of root:root. So, the non-root user must have access to the folder where it wants to read and write data.

But, when you mount a volume to a pod, it always gets mounted with the permission of root:root. So, the non-root user must have access to the folder where it wants to read and write data. Please follow the below steps for the same.

How to mount an EFS drive on EKS?

If you do a Google search for “mount EFS drive on EKS”, you’ll probably find this AWS Knowledge Center article, or the Github repository that contains the efs-provisioner utility mentioned in that article. The sample configuration provided with that repository includes: