Bind specific volume to deployment replicas

7/7/2019

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?

-- Demerzel
kubernetes

2 Answers

7/8/2019

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.

-- mk_sta
Source: StackOverflow

7/8/2019

as suggested above, you have below choices

  1. Use statefulsets. then each replica would get independent storage volume
  2. use local volumes ( supported on 1.14 and above )
  3. There is a PR already to enable independent storage for each replica. follow the link https://github.com/openshift/origin/issues/4211
-- P Ekambaram
Source: StackOverflow