Storage management in Kubernetes using AWS Resource like EBS/EFS

10/23/2017

I stuck somewhere when I was architecting to deploy my application on Kubernetes cluster which is on AWS.

Let's say we have a k8s cluster with one master and 3 worker node. And 3 pods of a replication controller is running on all the three nodes. How do I supposed to manage the Storage of it. How all three pods will be in sync ? I tried PVC with EBS but it is mounting on the pod in the single node. Is there any other way around of managing storage storage in kubernetes using EBS. I also saw some blog saying that we can use EFS. If anyone have any idea then pls help me out.

Thanks

-- Nikit Swaraj
amazon-efs
amazon-web-services
kops
kubernetes

3 Answers

10/23/2017
-- Nikit Swaraj
Source: StackOverflow

10/23/2017

I am guessing that by saying "How all three pods will be in sync?" you mean sharing the same persistent volume between pods?

If so, please read about access modes: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes

The AWS EBS provides supports only 'ReadWriteOnce' meaning it can't be shared between pods.
I haven't tried EFS but here it looks like it does support 'ReadWriteMany': https://github.com/kubernetes-incubator/external-storage/blob/f4d25e43f96d3a43359546dd0c1011ed3d203ca4/aws/efs/deploy/claim.yaml#L9

-- itaysk
Source: StackOverflow

10/23/2017

You can do EFS but it might be too slow for you. Basically its an NFS server which you can make a pv pvc for. Then u can mount it on all.

If EFS is too slow use nfs server outside the cluster dont install it in the cluster you need amazon linux ami and not debian os.

-- Ami Mahloof
Source: StackOverflow