Study guide
Technical reference and lesson notes
Purpose of This Lesson
This lesson introduces Docker containers and the AWS services used to run containerized applications: Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS).
The central exam theme is service selection:
- Use containers when applications benefit from portability, fast startup, efficient resource usage, and microservices-oriented deployment.
- Use Amazon ECS when you want AWS-native container orchestration.
- Use Amazon EKS when you need managed Kubernetes control-plane capabilities or compatibility with existing Kubernetes environments.
Key Concepts
Docker containers versus virtual machines
A virtual machine includes a complete guest operating system running on virtualized hardware. A Docker container packages an application and its dependencies while sharing the host operating system kernel with other containers.
This difference generally makes containers:
- Faster to start than virtual machines
- More lightweight in their use of compute and memory resources
- Easier to package consistently across environments
- Well suited to independently deployable microservices
Containers are not automatically the correct choice for every workload. Applications with strong operating-system isolation requirements, incompatible kernel dependencies, or traditional server assumptions may still be better suited to virtual machines.
Amazon ECS
Amazon ECS is AWS’s container orchestration service. It manages the scheduling and operation of containerized workloads and can be used with different compute models.
At a high level, ECS supports two important operating approaches:
- Serverless container execution: Use AWS Fargate so AWS manages the underlying container infrastructure.
- Customer-managed compute: Run ECS tasks on Amazon EC2 instances when you need more control over the underlying hosts, operating system, instance types, or capacity model.
The choice is therefore not simply whether to use containers. It also includes how much infrastructure management the organization wants to retain.
Amazon EKS
Amazon Elastic Kubernetes Service (EKS) is AWS’s managed Kubernetes service. It is intended for organizations that use Kubernetes APIs, tooling, deployment patterns, and ecosystem integrations.
EKS can be particularly relevant when an organization:
- Is migrating an existing Kubernetes platform to AWS
- Needs Kubernetes-specific orchestration capabilities
- Wants to preserve Kubernetes operational skills and deployment tooling
- Requires portability across Kubernetes environments
ECS and EKS both run containers, but they are not interchangeable orchestration interfaces. ECS is AWS-native, while EKS provides managed Kubernetes.
Containers and microservices
Containers are commonly used to package individual microservices. Each service can be built, deployed, scaled, and updated independently, provided that the application architecture supports that model.
Containerization does not itself create a microservices architecture. It is an implementation and packaging approach that can support microservices, modular applications, and repeatable deployments.
Exam-Relevant Takeaways
- Docker containers package applications and dependencies without requiring a complete guest operating system for each instance.
- Containers typically start quickly and use fewer underlying resources than virtual machines.
- Amazon ECS is the AWS-native container orchestration service.
- ECS can use AWS Fargate for serverless container execution or Amazon EC2 for more direct infrastructure control.
- Amazon EKS is the managed Kubernetes option on AWS.
- Existing Kubernetes workloads or teams with strong Kubernetes requirements commonly point toward EKS.
- The exam may test the distinction between a container orchestration service and the compute capacity used to run containers.
Architecture Decision Guide
| Requirement | Likely choice | Reason |
|---|---|---|
| Run containers without managing worker servers | ECS with AWS Fargate | AWS manages the underlying compute infrastructure for the container tasks |
| Run containers with control over EC2 instance types and host configuration | ECS with Amazon EC2 | The customer manages the ECS container instances and their capacity |
| Adopt an AWS-native container orchestration model | Amazon ECS | Avoids introducing Kubernetes-specific control-plane and operational concepts |
| Migrate an existing Kubernetes environment to AWS | Amazon EKS | Provides managed Kubernetes control-plane capabilities and Kubernetes compatibility |
| Package a service with its runtime dependencies and start it quickly | Docker container | Containers are lightweight, portable application units |
| Require full guest operating-system isolation or specialized VM behavior | Virtual machines may be more appropriate | Containers share the host kernel and are not a universal replacement for VMs |
Common Exam Traps
- Confusing ECS with Fargate: ECS is the orchestration service; Fargate is a serverless compute option that can run ECS tasks.
- Assuming all containers are serverless: Containers can run on customer-managed EC2 instances or on Fargate.
- Treating ECS and EKS as identical: ECS is AWS-native orchestration, while EKS is managed Kubernetes.
- Choosing EKS solely because it is more familiar: If the scenario does not require Kubernetes compatibility, ECS may be the simpler AWS-native choice.
- Assuming containers eliminate all infrastructure concerns: With EC2-backed ECS, teams still manage host capacity and the underlying instances.
- Assuming containers always provide stronger isolation than VMs: Containers share the host kernel; virtual machines generally provide a stronger isolation boundary.
- Equating containers with microservices: Containers can support microservices, but the architecture still requires appropriate service boundaries and operational design.
Real-World Engineer Notes
- Separate the orchestration decision from the compute decision. First decide whether ECS or EKS fits the operating model; then decide whether the workloads should run on Fargate or EC2 where applicable.
- Fargate reduces host-management work, which can simplify operations for teams that want to focus on application deployments.
- EC2-backed container platforms may be preferable when workloads need specialized instance types, detailed host control, or an established capacity-management model.
- Kubernetes compatibility can be strategically important during migration, but it also introduces Kubernetes-specific platform skills and operational processes.
- Containerizing an application may expose hidden dependencies on local storage, host networking, operating-system packages, or long-lived processes. Validate these dependencies before selecting a deployment model.
Quick Reference Summary
- Docker: Packages an application and its dependencies into a portable container image.
- Container benefit: Lightweight execution, rapid startup, and efficient resource usage compared with full virtual machines in many scenarios.
- ECS: AWS-native container orchestration service.
- Fargate: Serverless compute option for running containers without managing the underlying servers.
- ECS on EC2: Container orchestration with customer-managed EC2 capacity.
- EKS: Managed Kubernetes service for Kubernetes-based workloads and migrations.
- Primary decision: Choose based on orchestration requirements, Kubernetes compatibility, infrastructure control, and operational overhead.
Flashcards
- Q: What is a Docker container?
A: A packaged application and its dependencies that runs in an isolated process environment while sharing the host operating system kernel.
- Q: Why can containers start faster than virtual machines?
A: Containers do not normally boot a complete guest operating system for each application instance.
- Q: What AWS service provides AWS-native container orchestration?
A: Amazon Elastic Container Service, or ECS.
- Q: What is AWS Fargate in relation to ECS?
A: Fargate is a serverless compute option that runs container tasks while AWS manages the underlying infrastructure.
- Q: Why would an organization run ECS on Amazon EC2?
A: To retain control over the underlying instances, capacity, operating system, or instance types.
- Q: What AWS service provides managed Kubernetes?
A: Amazon Elastic Kubernetes Service, or EKS.
- Q: When is EKS a natural choice?
A: When an organization already uses Kubernetes or requires Kubernetes APIs, tools, and operating practices.
- Q: Are containers and microservices the same thing?
A: No. Containers are a packaging and execution technology; microservices are an architectural approach that containers can support.
- Q: What is a key isolation difference between containers and VMs?
A: Containers share the host kernel, while each VM generally includes its own guest operating system.
- Q: What is the main ECS versus EKS distinction?
A: ECS is AWS-native orchestration; EKS is managed Kubernetes orchestration.
Practice Questions
Question 1
A company wants to deploy containerized applications on AWS but does not want to provision, patch, or scale the underlying container servers. Which option best fits this requirement?
A. ECS tasks running on customer-managed EC2 instances
B. ECS tasks running on AWS Fargate
C. Docker containers installed directly on an on-premises server
D. EKS worker nodes managed entirely by the customer
Correct answer: B. ECS tasks running on AWS Fargate
Explanation: Fargate provides serverless compute for containers, removing the need to manage the underlying container hosts. ECS remains the orchestration service in this design.
Question 2
An enterprise is migrating an existing Kubernetes platform to AWS. It wants to continue using Kubernetes APIs and existing Kubernetes deployment tools while reducing control-plane management. Which service should the architect recommend?
A. Amazon ECS
B. Amazon EC2 without an orchestration service
C. Amazon EKS
D. AWS Lambda
Correct answer: C. Amazon EKS
Explanation: EKS is AWS’s managed Kubernetes service and is designed for Kubernetes-compatible workloads and migration scenarios.
Question 3
A workload consists of containerized services, and the platform team requires control over EC2 instance types and host configuration. The team does not require Kubernetes compatibility. Which option is most appropriate?
A. ECS on Amazon EC2
B. EKS on Fargate only
C. AWS Lambda functions
D. A separate virtual machine for every container with no orchestration
Correct answer: A. ECS on Amazon EC2
Explanation: ECS provides AWS-native orchestration, while EC2-backed ECS allows the team to control the underlying instances and capacity. Kubernetes is not required by the scenario.
Question 4
Which statement best describes a fundamental difference between a Docker container and a virtual machine?
A. A container always has stronger isolation than a virtual machine.
B. A virtual machine cannot run a microservice.
C. A container typically shares the host kernel, while a virtual machine includes a guest operating system.
D. Containers require more resources because each one boots a full operating system.
Correct answer: C. A container typically shares the host kernel, while a virtual machine includes a guest operating system.
Explanation: Containers are generally lighter because they share the host kernel. VMs provide a separate guest operating system and may provide a stronger isolation boundary.
Question 5
A solutions architect is choosing between ECS and EKS for a new AWS-native application. The requirements do not include Kubernetes compatibility, and the team wants the simplest AWS-specific container orchestration approach. Which service is the better starting point?
A. Amazon ECS
B. Amazon EKS
C. Amazon EC2 with manually started Docker processes
D. An on-premises Kubernetes cluster
Correct answer: A. Amazon ECS
Explanation: ECS is AWS-native container orchestration and avoids introducing Kubernetes-specific platform requirements when those capabilities are not needed.