Key Concepts Flashcards
What is ECS?
Elastic container service is a fully managed cloud container orchestration service. It runs multiple containers using EC2 instances OR Fargate
ECS Cluster
a logical grouping of EC2 instances or Fargate resources are run
Task
a single instance of running a container or a group of containers that define how a containerized application should be deployed
Task Definition
a template that describes the source of the application image, resources required in the terms of CPU and memory units container, and host port mapping, and other critical info
Why use ECS over EC2?
Although from a high level they appear to host workloads and are pretty similar, on a deeper level they are suited for different types of workloads and are different.
ECS (Elastic Container Service):
1. Container Orchestration: Manages and scales containers automatically.
2. Simplified Management: No need to manage underlying EC2 instances if using Fargate.
3. Optimized Scaling: Easily scales containers up or down based on demand.
4. Integration: Built-in support for AWS services (e.g., IAM, CloudWatch).
5. Cost Efficiency: Pay only for resources used (compute & memory), especially with Fargate.
EC2 (Elastic Compute Cloud):
1. Full Control: Offers more flexibility with instance types and configurations.
2. Custom Configurations: Ideal for custom environments that need full OS control.
3. Persistent Workloads: Better suited for applications needing long-running processes or custom networking.
Availability Zone (AZ)
a distinct location within an AWS Region. Each AWS Region consists of multiple Availability Zones, which are designed to be isolated from failures in other zones. This provides redundancy and fault tolerance.
1. physical locations
2. high availability
3. low latency
4. Redundancy and Disaster Recovery
5. Usage in AWS Services
What is an ECS service?
A long-running ECS task that can be managed, scaled, and monitored ensuring the desired number of tasks are always running
How does ECS manage access control?
Through IAM roles and policies
Which service integrates with ECS for secrets management?
AWS Secrets Manager or Systems Manager Parameter Store for managing sensitive data
What is ECR?
A fully managed container image registry service that allows you to store, manage, and deploy Docker container images
How does ECR integrate with ECS?
ECR stores container images that ECS pulls to deploy and run tasks
Target group
a set of registered targets (ECS tasks) to which a load balancer distributes traffic. It contains health check settings for monitoring targets
Load Balancer
distributes incoming application traffic across multiple tasks or containers to ensure high availability and reliability
Service Directory
a feature that enables ECS tasks to automatically register with DNS. This makes it easy to find and connect to tasks across clusters
capacity provider
defines the infrastructure capacity available for the tasks in your cluster. ECS uses capacity providers to determine where to place tasks
IAM Roles for ECS
- Task Role: Permissions for the tasks to interact with AWS services
- Execution Role: Permissions for ECS to pull images, write logs, etc
ECS Service Auto Scaling
Adjusts the number of tasks in your service based on demand, helping manage scaling automatically
Placement Strategies and Contraints
Defines rules for task placement, such as balancing tasks across availability zones or restricting placement to specific instances
ECS Agent
A component that runs on container instances and communicates with ECS API to handle task operations
Task Definition Revision
Every time a task definition is updated, a new revision is created. ECS uses these revisions to run tasks, so you can revert to previous versions if needed
Container Defintion
Part of a task definition where that specifies individual container configurations, such as image, port mappings, environment variables, logging, and storage
Port Mapping
specifies which ports are open to the external network and which are connected to the container within the task definition
Environment Variables
variables passed to the containers, often used to configure containerized applications, such as database connection strings or API keys
Log configuration
defines how logs from containers are managed. ECS can send logs to AWS services like CloudWatch or to a local file
Volumes
Specifies data volumes used by containers, defining where data is stored and shared between containers within the same task
Network Mode
defines how the container’s networking is configured. Options include bridge, host, awsvpc, and none
Task Placement Strategy
Rules that determine where tasks s are placed within a cluster, such as binpack, random, or spread strategies for balancing resources
Task Placement Contraints
Defines specific conditions that must be met for tasks to be placed on container instances, such as instance attributes or availability zones