โข About Docker
โข Fundamentals
โข Task Definitions
โข Tasks
โข Services
โข Clusters
โข Container Instances vs. Fargate
{ 1/17 }
๐๐ผ๐ฐ๐ธ๐ฒ๐ฟ
Before getting started with ECS, you need to understand Docker, because it's one of the basic building blocks.
Docker helps to create environments to run your application, regardless of the underlying operating system.
{ 2/17 }
This lightweight environment is called a ๐๐ผ๐ฐ๐ธ๐ฒ๐ฟ ๐ฐ๐ผ๐ป๐๐ฎ๐ถ๐ป๐ฒ๐ฟ and contains everything that is needed to run your application, e.g. certain versions of a library or language.
You can even run multiple containers on the same machine.
{ 3/17 }
Containers can even communicate with each other when needed.
You may have already guessed: looking at a growing application, there will be soon challenges in managing all those containers: deployments, scheduling, scaling and more will be a tedious task.
{ 4/17 }
That's where you'll be in need of a ๐ฐ๐ผ๐ป๐๐ฎ๐ถ๐ป๐ฒ๐ฟ ๐บ๐ฎ๐ป๐ฎ๐ด๐ฒ๐บ๐ฒ๐ป๐ ๐๐ฒ๐ฟ๐๐ถ๐ฐ๐ฒ.
It's another abstracting layer helping you to easily manage your containerized applications and reduce your operational tasks.
That's where ECS comes in!
{ 5/17 }
Amazons ๐lastic ๐ontainer ๐ฆervice is a highly scalable & fast container management service.
It allows you to view & manage the state of your clusters from a centralized service. Easily schedule based on resource needs & availability requirements.
{ 6/17 }
Let's have a look at two different areas of responsibility:
โข Lifecycle management of your tasks
โข Actually running your containers
ECS does not actually execute or run your containers. It only provides the management pane for controlling your tasks.
{ 7/17 }
So finally to the important question: which services actually run our containers?
You can either pick from using ๐๐๐ฎ ๐ถ๐ป๐๐๐ฎ๐ป๐ฐ๐ฒ๐ (that have the ECS Container Agent running) or ๐๐ฎ๐ฟ๐ด๐ฎ๐๐ฒ Launch Type
So it's not ECS ๐ผ๐ฟ Fargate, but ECS ๐ฎ๐ป๐ฑ Fargate.
{ 8/17 }
Let's dig into ECS' ๐๐ฒ๐ ๐ง๐ฒ๐ฟ๐บ๐, which can be confusing at first but are crucial to understanding how it's internally working:
โข Task Definition
โข Task
โข Service
โข Cluster
{ 9/17 }
A ๐ง๐ฎ๐๐ธ ๐๐ฒ๐ณ๐ถ๐ป๐ถ๐๐ถ๐ผ๐ป is a blueprint of your container. It includes things like
โข the image to use (e.g. exakt ECR URL)
โข CPU & memory allocation
โข secrets & environment vars
โข logging configuration
โข exposed ports
{ 10/17 }
A ๐ง๐ฎ๐๐ธ is an actual instance that runs the containers that are defined in your definition.
You can run multiple tasks from the same definition if this is required (e.g. for redundancy or traffic demands).
{ 11/17 }
๐ฆ๐ฒ๐ฟ๐๐ถ๐ฐ๐ฒ
As we can have several tasks for the same definition, we need some boundaries and management. This is where the service comes in.
It defines how auto-scaling & load distribution is handled and what are the minimum & maximum tasks.
{ 12/17 }
Auto-Scaling rules can be for example that a new task is started if the CPU load exceeds a certain threshold for a defined period of time - or when an existing task is gracefully stopped if the load is too low.
{ 13/17 }
A ๐๐น๐๐๐๐ฒ๐ฟ is a logical grouping of tasks or services which run on infrastructure that is registered to such a cluster.
If you're using EC2 launch types, it's a set of container instances you manage. If using Fargate, infrastructure capacity is provided by AWS.
{ 14/17 }
You can even provide your on-premise virtual machines as compute capacities for your cluster.
Additionally, it's possible to have a cluster with ๐บ๐ถ๐ ๐ฒ๐ฑ tasks hosted on Fargate, EC2 instances, or even external instances.
{ 15/17 }
ECS Container Instance vs. Fargate
If you have very high computation requirements, you should know that Fargate is way more restrictive regarding what capacities are possible within a single task.
โข ๐๐๐ฃ๐จ๐: 448 vs. 4
โข ๐ ๐ฒ๐บ๐ผ๐ฟ๐: 26TB vs. 30 GB
{ 16/17 }
Even if you're a big serverless fan, knowing about ECS is crucial because you'll bump into it almost everywhere.
Considering the abstraction layer of ECS in combination with Fargate, it's considered a serverless technology.
{ 17/17 }
That's it for the fundamentals - thank you for reading!
If you've liked this thread, โป๏ธ or โฅ๏ธthe initial post & follow me for more regular cloud content ๐ค
Also, comment or drop me a message about topics you're interested in! ๐จ
โข โข โข
Missing some Tweet in this thread? You can try to
force a refresh
There's a lot that comes out of the box to gain insights into how well your serverless app is performing
A quick overview to get you started โ
1๏ธโฃ Amazon CloudWatch
CloudWatch automatically monitors your functions on your behalf. It reports a lot of useful metrics:
โข number of invocations
โข execution durations
โข occurred errors
โข function throttles
Everything is exposed on a function level!
2๏ธโฃ Amazon CloudTrail
CloudTrail offers you governance, compliance & auditing features for several services, including Lambda.
It enables you to log all (encryption supported!) actions taken regarding your infrastructure, regardless if it's via the console UI or AWS SDK!
โข Introduction
โข Importance of Messaging Systems
โข Fundamentals
โข Queue Types
โข Visibility Timeouts
โข Retention Periods
โข Limitations
{ 1/22 }
๐๐ป๐๐ฟ๐ผ๐ฑ๐๐ฐ๐๐ถ๐ผ๐ป
Believe it or not: SQS was the ๐ณ๐ถ๐ฟ๐๐ publicly launched service by AWS!
Quoting Jeff Bar:
"We launched the Simple Queue Service in ๐น๐ฎ๐๐ฒ ๐ฎ๐ฌ๐ฌ๐ฐ, Amazon S3 in early 2006, and Amazon EC2 later that summer."
Thanks for all your interest in my AWS 1x1 threads! ๐ ๐
The good news: ๐๐ต๐ฒ๐ฟ๐ฒ'๐ ๐ฎ ๐น๐ผ๐ ๐บ๐ผ๐ฟ๐ฒ ๐ถ๐ป ๐๐ต๐ฒ ๐ฝ๐ถ๐ฝ๐ฒ๐น๐ถ๐ป๐ฒ!
... also for Azure ๐
Didn't see the previous ones yet?
๐๐ถ๐ป๐ธ๐ ๐๐ผ ๐ฎ๐น๐น ๐บ๐ ๐ฟ๐ฒ๐ฐ๐ฒ๐ป๐ ๐ฝ๐ผ๐๐๐ ๐ฎ๐ฟ๐ฒ ๐ฏ๐ฒ๐น๐ผ๐ โ
โข Fan-in & Fan-out
โข Simple Web Service
โข Publish/Subscribe
โข Strangler
โข Aggregator
{ 1/7 }
๐๐ฎ๐ป-๐ถ๐ป & ๐๐ฎ๐ป-๐ผ๐๐
Common problem: large tasks that are exceeding Lambda's execution time limit
With Fan-out, you're splitting those large tasks into small ones and delegating those to Lambda workers.
Afterward, results are aggregated (= Fan-in).