# ECS/EKS

## **What is ECS and EKS?**

* ECS = Elastic Container Service → AWS’s own container orchestration system.
* EKS = Elastic Kubernetes Service → AWS’s managed Kubernetes service.

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FO28xdM7og0qjXtI86X6u%2Fimage.png?alt=media&#x26;token=543c8c56-44a6-4b62-aca2-ad8c43c4e4cf" alt=""><figcaption></figcaption></figure>

**Docker Image**

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FwkznfIzAIpeptWpOShHq%2Fimage.png?alt=media&#x26;token=f111b7f0-9695-46b8-9440-9a05703aad78" alt=""><figcaption></figcaption></figure>

**Container Registry**

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FECNVWc19ijNphbXpgHDy%2Fimage.png?alt=media&#x26;token=e012c4f3-b7de-453c-ad0e-8b3c5f4e0a85" alt=""><figcaption></figcaption></figure>

### **ECS-**

* AWS’s simpler container management tool.
* You tell ECS:
  * Which container image to run.
  * How many copies (tasks) to run.
  * ECS handles the rest.

**How ECS Runs Containers:**

* EC2 Launch Type → You manage EC2 instances, ECS puts containers on them.
* Fargate Launch Type → AWS runs the servers for you (serverless containers)

**ECS Key Terms**

* Cluster → A logical group of container-running resources (EC2 or Fargate).
* Task Definition → Recipe describing:
  * Which Docker image
  * CPU & memory
  * Environment variables
* Task → A running container instance from a task definition.
* Service → Keeps the desired number of tasks running

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FMosiYnaYlPQP7k19EfCo%2Fimage.png?alt=media&#x26;token=41f86613-b470-434e-99c4-42e2288cc5b1" alt=""><figcaption></figcaption></figure>

### **EKS-**

* AWS’s managed Kubernetes service.
* Kubernetes is more powerful & flexible than ECS, but also more complex.
* AWS runs the control plane for you, you manage the worker nodes (or use Fargate).

How EKS Runs Containers

* You still use Pods, Deployments, Services (Kubernetes terms).
* EKS is just Kubernetes — but you don’t install or manage the control plane.

EKS Key Terms

* Cluster → Set of worker nodes + AWS-managed control plane.
* Node Group → EC2 instances where your Pods run.
* Pod → Smallest deployable unit in Kubernetes (holds 1 or more containers).
* Service (K8s) → How Pods talk to each other or the outside world.

**Cluster Structure**

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FshYJ8tml59UQkoVLifdl%2Fimage.png?alt=media&#x26;token=84e07090-719d-4698-8722-b9aeb12f4482" alt=""><figcaption></figcaption></figure>

**Cluster detail**

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FUBr4j2bBIL7xFPaUc7ey%2Fimage.png?alt=media&#x26;token=7ddaf2cf-97c8-4ff5-ac44-a87352201463" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1856860631-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsNc001Xcz63mWjGXymkd%2Fuploads%2FOBLHSuQacUcGrVCqhXzQ%2Fimage.png?alt=media&#x26;token=59ec8ce2-3963-4766-83ac-560615092640" alt=""><figcaption></figcaption></figure>

### **ECS vs EKS**

| Feature       | ECS                                        | EKS                                       |
| ------------- | ------------------------------------------ | ----------------------------------------- |
| Complexity    | Easier to learn, AWS-specific              | More complex, industry-standard           |
| Orchestration | AWS’s own system                           | Kubernetes                                |
| Portability   | AWS only                                   | Any Kubernetes platform                   |
| Flexibility   | Less customizable                          | Very flexible & extensible                |
| Best For      | Small to medium apps, fast AWS integration | Large, complex, multi-cloud architectures |
