I am deploying containers via AWS Fargate but I am running into "No Space left on device"
. Is there a way I can specify the volume size in task_definitions:
task_size:
mem_limit: 2GB
cpu_limit: 256
Support for Amazon EBS volumes isn't available for tasks on Fargate.
This is because, with Fargate, you only pay for the amount of resources you provision. Fargate is better than EC2 in terms of flexibility. However, there is no long-term commitment to the resources you have provisioned. Hence if you require flexibility, then go for Fargate.
If you need auto-scaling or run containers in a serverless environment, then Fargate is the right choice. But, ECS is better if you need more flexibility or are on a budget. Overall, both services are excellent choices for running containers in AWS. It just comes down to your specific needs and preferences.
As of Fargate platform 1.4, released on 04/2020, ephemeral storage is now 20 GB, instead of 10 GB. Additionally, you can now mount persistent EFS storage volumes in Fargate tasks.
For example:
{
"containerDefinitions": [
{
"name": "container-using-efs",
"image": "amazonlinux:2",
"entryPoint": [
"sh",
"-c"
],
"command": [
"ls -la /mount/efs"
],
"mountPoints": [
{
"sourceVolume": "myEfsVolume",
"containerPath": "/mount/efs",
"readOnly": true
}
]
}
],
"volumes": [
{
"name": "myEfsVolume",
"efsVolumeConfiguration": {
"fileSystemId": "fs-1234",
"rootDirectory": "/path/to/my/data",
"transitEncryption": "ENABLED",
"transitEncryptionPort": integer,
"authorizationConfig": {
"accessPointId": "fsap-1234",
"iam": "ENABLED"
}
}
}
]
}
Taken from: efs-volumes in Fargate
You can now increase your fargate ephemeral storage to 200GB in task definition. Therefore with this there is no need to attach the volume unless you need a storage of larger than 200GB.
"ephemeralStorage": {
"sizeInGiB": 200
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With