Hi,
We’re planning a new Rancher cluster on aws, and I’d really like to spread the nodes out across availability zones. Some of our containers are using EBS for persistent storage. What is the recommended way to deal with EBS and multi-azs? EBS volumes only allow mappings from hosts in the same az, so optimally the EBS plugin would do some snapshot/migration magic in order to have the volume “follow” the container around in different azs. Is this implemented? If not, is it planned?
In any case, some recommendations would be great.
With Rancher 1.6, when you created a host in EC2, we detect (by virtue of being able to hit ec2 metadata) that the host is in EC2 and also what AZ its in. We add the AZ as a label to the host. You can then identify the az in which you want the volume to be created when creating the volume. Here’s how you’d do it with rancher-compose:
version: '2'
volumes:
bar1234:
driver_opts:
ec2_az: us-west-2a
size: '10'
driver: rancher-ebs
services:
foo:
image: nginx
volumes:
- bar1234:/var/lib/storage
Official documentation on this is here: http://docs.rancher.com/rancher/v1.6/en/rancher-services/storage-service/rancher-ebs/
When using EBS, there isn’t any migration. Any replication gets pushed up the stack and you would want to balance your service replication at the service level (so multiple containers & have them maintain replicated state.) If that’s too complex you might want to use a storage option that is not AZ dependent.
Thanks, thats what I figured. We’re gonna try EFS with the rancher-nfs driver for a while and see how that works.