How selectors work
Each Fargate profile contains one or more selectors. A selector matches pods by:- namespace (required) — the Kubernetes namespace the pod runs in
- labels (optional) — a map of label key-value pairs that must all be present on the pod
Basic example
Selector configuration examples
- Namespace only
- Namespace + labels
- Multiple selectors
- Multiple profiles
Match all pods in the
kube-system namespace:IAM role configuration
The module creates a dedicated IAM role for each Fargate profile by default. The role is granted theAmazonEKSFargatePodExecutionRolePolicy and, when iam_role_attach_cni_policy = true (default), the AmazonEKS_CNI_Policy to allow the VPC CNI to configure networking for Fargate pods.
To use an existing IAM role:
Subnet configuration
By default, Fargate profiles use the subnets specified at the cluster level (subnet_ids). To use different subnets for a specific profile:
Limitations and caveats
No DaemonSets
No DaemonSets
Fargate does not support DaemonSets. Any DaemonSet pods (e.g., log collectors, monitoring agents) need to be deployed differently — typically using sidecar containers or as node-level services on EC2-based node groups.
No privileged containers
No privileged containers
Fargate does not support privileged containers or
hostNetwork, hostPID, or hostIPC pod security contexts.EBS volumes not supported
EBS volumes not supported
Fargate pods cannot mount EBS volumes. Use EFS (Amazon Elastic File System) or other network-attached storage for persistent workloads on Fargate.
Resource limits required
Resource limits required
Each Fargate pod is allocated a dedicated vCPU and memory combination based on the pod’s resource requests and limits. Always set resource
requests on containers — Fargate uses these to select the appropriate compute configuration.One pod per Fargate instance
One pod per Fargate instance
Each Fargate instance runs exactly one pod. Multi-container pods (with sidecars) run all containers on the same Fargate instance. This means bin-packing multiple pods onto a single compute unit is not possible.
Key variables reference
| Variable | Default | Description |
|---|---|---|
selectors | null | List of namespace and label selectors for pod matching |
subnet_ids | [] | Subnets for the Fargate profile; falls back to cluster subnets |
create_iam_role | true | Create a dedicated IAM execution role |
iam_role_arn | null | ARN of an existing IAM role (when create_iam_role = false) |
iam_role_attach_cni_policy | true | Attach the EKS CNI IAM policy to the role |
iam_role_additional_policies | {} | Additional IAM policy ARNs to attach to the role |
