Fargate Profiles

Run pods on AWS Fargate — serverless compute where you manage no EC2 nodes at all.

AWS Fargate runs your pods without any EC2 instances to manage. You define a Fargate profile that matches pods by namespace and labels; matching pods each launch on their own right-sized, isolated micro-VM.

Fargate profile selecting pods to run on serverless computeFargate Profilenamespace: prodlabels:  compute=fargateselects matching podsFargate (serverless, no nodes to manage)micro-VM1 podmicro-VM1 podmicro-VM1 podEach pod is isolated; you pay per vCPU/memory per second.
Pods matching the profile's namespace and labels run on isolated Fargate micro-VMs — no EC2 nodes for you to patch or scale.

Limits to know

  • No DaemonSets, no privileged pods, and no persistent EBS volumes (use EFS instead).
  • Each pod gets its own kernel, so there is no bin-packing across pods.

Example

Example · bash
# Create a Fargate profile: pods in the 'prod' namespace run on Fargate
eksctl create fargateprofile \
  --cluster demo \
  --name fp-prod \
  --namespace prod \
  --labels compute=fargate

When to use it

  • A small team runs batch report-generation jobs on Fargate so they pay only for the seconds each pod runs, with no idle EC2 nodes.
  • A startup uses a Fargate profile to run the kube-system namespace pods without managing any EC2 infrastructure for the system components.
  • A security team prefers Fargate for sensitive workloads because each pod gets its own isolated Firecracker VM with no shared kernel.

More examples

Create a Fargate profile

Creates a Fargate profile that routes all pods in the 'batch' namespace to serverless Fargate compute.

Example · bash
aws eks create-fargate-profile \
  --cluster-name prod \
  --fargate-profile-name batch-profile \
  --pod-execution-role-arn arn:aws:iam::123456789012:role/EKSFargatePodRole \
  --subnets subnet-aaa subnet-bbb \
  --selectors namespace=batch

Fargate profile in eksctl config

Defines Fargate profiles in eksctl ClusterConfig that match pods by namespace, running them on serverless compute.

Example · yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: prod
  region: us-east-1
fargateProfiles:
- name: batch
  selectors:
  - namespace: batch
  - namespace: kube-system

Deploy a pod to Fargate

A pod in the 'batch' namespace is automatically scheduled on Fargate because the profile selector matches; no node selector needed.

Example · yaml
apiVersion: v1
kind: Pod
metadata:
  name: report-generator
  namespace: batch
spec:
  containers:
  - name: report
    image: my-reports:latest
    resources:
      requests:
        cpu: "1"
        memory: "2Gi"

Discussion

  • Be the first to comment on this lesson.