Amazon EKS — Fargate Profiles
Fargate Profiles
A Fargate profile tells EKS which pods should run on Fargate. It uses namespace and label selectors to match pods.
How Profiles Work
Pod Scheduling Decision
┌────────────────────────────────────────────┐
│ New pod created │
│ │ │
│ ▼ │
│ Does it match a Fargate profile? │
│ (namespace + labels) │
│ │ │
│ ┌────┴────┐ │
│ │ Yes │ No │
│ │ │ │
│ ▼ ▼ │
│ Fargate EC2 node │
│ (microVM) (if available) │
└────────────────────────────────────────────┘
Create Fargate Profiles
By Namespace
fargateProfiles:
- name: batch-profile
selectors:
- namespace: batch # All pods in 'batch' namespace → Fargate
By Namespace + Labels
fargateProfiles:
- name: app-profile
selectors:
- namespace: production
labels:
compute: fargate # Only matching pods → Fargate
Multiple Selectors
fargateProfiles:
- name: multi-profile
selectors:
- namespace: default
- namespace: staging
- namespace: batch
labels:
type: job
Manage Profiles with eksctl
# Create profile
$ eksctl create fargateprofile \
--cluster demo \
--name batch \
--namespace batch
# List profiles
$ eksctl get fargateprofile --cluster demo
# Delete profile
$ eksctl delete fargateprofile --cluster demo --name batch
Common Mistakes
| Mistake | Fix |
|---|---|
| Forgetting kube-system profile | CoreDNS can’t run on Fargate without it |
| Too broad selectors | All pods go to Fargate (expensive) |
| No profile for namespace | Pods stay Pending if no EC2 nodes exist |
What’s Next?
Before going all-in on Fargate, understand the limits: Fargate Limitations.