Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install CloudStor plugin on Amazon ECS Optimized AMI Instance
#!/bin/bash
set -ex
if [ $# -ne 2 ]; then
echo "Usage: $0 EFS_ID_REGULAR EFS_ID_MAXIO"
exit 1
fi
EFS_ID_REGULAR=$1
EFS_ID_MAXIO=$2
AWS_REGION="$(cat /etc/yum/vars/awsregion)"
DOCKER_VERSION=$(docker version | awk '/^Server/{f=1} $1 ~ /Version:/ {if(f) {print $2}}')
CLOUDSTOR_REPO="docker4x/cloudstor"
CLOUDSTOR_TAG="${DOCKER_VERSION}-aws1"
docker plugin install \
--alias cloudstor:aws \
--grant-all-permissions\
${CLOUDSTOR_REPO}:${CLOUDSTOR_TAG} \
CLOUD_PLATFORM=AWS EFS_ID_REGULAR=${EFS_ID_REGULAR} EFS_ID_MAXIO=${EFS_ID_MAXIO} AWS_REGION=${AWS_REGION} EFS_SUPPORTED=1 DEBUG=1
@frimik

This comment has been minimized.

Copy link
Owner Author

frimik commented Dec 17, 2019

service docker restart might be needed afterwards... not entirely sure though.

@frimik

This comment has been minimized.

Copy link
Owner Author

frimik commented Dec 17, 2019

Useful tools for EFS, but not necessary for this purpose is in the package amazon-efs-utils. It contains a watchdog agent though that may be useful.

@frimik

This comment has been minimized.

Copy link
Owner Author

frimik commented Apr 9, 2020

https://spot.io/blog/ecs-persistent-storage-docker-plugins/

Key Value
size The size of the volume.
backing Use “shared” for EFS volumes, “relocatable” for EBS volumes.
ebstype If you use EBS volumes, you can specify gp2, io1, st1, sc1
iops Required if ebstype specified is io1, which enables provisioned IOPS. Needs to be in the appropriate range as required by EBS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.