How to deploy statefulset in EKS with more than one availability zone ?

  • My EKS cluster has three nodes. When I deploy my cluster with two availbility zone (ex us-west-1a, us-west-1b), one node is deployed in us-west-1a and another two nodes are deployed in us-west-1b.
  • I try to deploy statefulset that has 3 replicas and each pod has its own PVC. Because anti-affinity rule is 'hard', 3 pods are deployed in different node.
  • When I scale down all my instance then scale up thm, nodes are not deployed to same avaialblity zone. So, pod in statefulset cannot mount PV because PV is in different availbility zone from pod.
  1. Is there any method to deploy node in same availability zone when scaling down and up ?
  2. If not, is there any limitation that statefulset cannot be deploy across more than one avaialbility zone ?
asked 2 months ago249 views
1 Answer

Follow the steps outlined in the How do I create and troubleshoot topology aware volume provisioning that uses an EBS CSI driver in Amazon EKS knowledge center article to configure topology aware volume provisioning with the EBS CSI driver.

If you're using Karpenter, refer to the Scaling Kubernetes with Karpenter: Advanced Scheduling with Pod Affinity and Volume Topology Awareness blog post for detailed guidance on configuring topology aware volume provisioning.

This blog post explains how to leverage Karpenter's advanced scheduling features, including Pod Affinity and Volume Topology Awareness, to optimize your Kubernetes cluster's performance and resource utilization.

profile pictureAWS
answered 2 months ago
profile picture
reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions