StatefulSets and availability zones in AWS

272 views
Skip to first unread message

Vivek

unread,
Mar 23, 2018, 3:31:19 PM3/23/18
to Kubernetes user discussion and Q&A
Hey team,

I have an application container that I wish to run on Kubernetes in an AWS environment, backed by EBS volumes.

I’m currently thinking that the application will be created by a StatefulSet with a single PersistentVolume attached (EBS underlying).

I had originally thought that if the AWS availability zone went down, Kubernetes would automatically spin up the node again in a different AZ, attaching to the same volume. That said, I then realized that EBS volumes only exist within the same AZ as the instance to which they are attached.

From the AWS documentation, It seems the proper way to duplicate an EBS across AZs is to create a volume snapshot and then spin up another volume and attach that new volume to a new instance in another AZ.

That said, I’m not sure if StatefulSets in Kubernetes have the necessary logic to accomplish this. Questions:

- Is there a way that I can specify for StatefulSets to create a persistent volume from a snapshot in the event that the original volume does not exist for a pod?
- Alternatively: does anyone see an easier architecture that I might opt for instead, given these application constraints?

Disclaimer: I’m fairly new to Kubernetes, so I’m sure that I have made some obvious logic errors!

Regards,
Vivek

Rodrigo Campos

unread,
Mar 25, 2018, 11:39:38 AM3/25/18
to kubernet...@googlegroups.com
AWS also offers EFS volumes (https://aws.amazon.com/efs/) that are basically NFS volumes that can be accessed within a region (so there should be no problem if one AZ is down or whatever).

Pricing is quite different, but it might be a better fit as you don't need to handle any of the complexity.

And regarding Kubernetes, you can use a NFS volume and that should do the trick (NFS instead of EBS)

Also, please share your experience if you do try it :-)
--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages