I have a kubernetes deployment with three replicas, each one in one AZ (eu-west-1a,eu-west-1b and eu-west-1c). I have three AWS EBS volumes (each one in a different AZ) that I want to attach to each replica.
I know I can attach the volume with volume type awsElasticBlockStore but, how can I match each volume to the replica matching the AZ?
Optionally, you can map AWS EBS volumes within failure-domain.beta.kubernetes.io/zone
built-in label, thus you don't need to make a local volumes accross Statefulsets. It will give you a chance to bind persistent volume claims (PVCs) to persistent volumes (PVs) residing on the same node matching appropriate availability zone, as I've suggested in the separate Stack thread.
as suggested above, you have below choices