Serverless
AWS Fargate
Technology for running containers with Amazon ECS or Amazon EKS without managing servers or clusters of Amazon EC2 instances. You define the CPU, memory, networking, and permissions for each task or pod, and no longer have to choose server types or scale the cluster.
Exam phrases that point here
«run containers without provisioning or managing servers or EC2 instances»
With Fargate you define the CPU, memory, networking, and permissions of each task (ECS) or pod (EKS), and AWS provides the capacity: there are no instance types to choose, no cluster to scale, and no node operating system to patch.
When not: If the scenario requires GPUs, control over the instance (your own AMI, SSH access to the node), or Kubernetes DaemonSets, you use ECS or EKS on EC2 instances. If it is not about containers but about short code that reacts to events, think of AWS Lambda.
«interruption-tolerant container tasks at the lowest possible cost»
Fargate Spot runs ECS tasks on spare capacity at a discount compared with the regular Fargate price. AWS can reclaim it with a two-minute warning.
When not: If the tasks cannot be interrupted, use regular Fargate (and, if usage is steady, Savings Plans). Also, Amazon EKS does not support Fargate Spot: it applies only to Amazon ECS.
«each workload must run in isolation, without sharing a kernel, CPU, or memory with others»
In Fargate each task or pod runs in its own single-use compute environment, with its own kernel, resources, and network interface, separated from the others by a virtualization boundary.
When not: If the requirement is dedicated physical hardware (for example, for per-socket or per-core licenses), Fargate does not provide it: think of Amazon EC2 Dedicated Hosts.
«containers on Fargate need persistent, shared storage»
A task's or pod's ephemeral storage is erased when it stops, so anything that must persist or be shared across containers is stored in Amazon EFS, which Fargate can mount.
When not: If the data is needed only while the task is alive (temporary files), ephemeral storage is enough. If it is object data accessed through an API, Amazon S3. On EKS with Fargate, you cannot mount Amazon EBS volumes in pods.
«stop managing and patching the nodes of a Kubernetes cluster»
With Amazon EKS and a Fargate profile, the pods that match the profile run on Fargate: there are no EC2 nodes to create, update, or scale.
When not: Pods on Fargate do not support DaemonSets, privileged containers, GPUs, or public subnets. If the workload needs any of those, you use EC2 nodes (for example, managed node groups).