modules/hybrid-node-role sub-module to create the IAM role that remote nodes assume when they join the cluster, and configures remote_network_config to tell EKS the CIDR ranges used by the remote nodes and pods.
Prerequisites
- AWS credentials with permissions to create EKS, IAM, VPC, and SSM resources
- Terraform >= 1.5.7
- AWS provider >= 6.28
- Helm provider (example installs Cilium CNI on hybrid nodes)
- Remote nodes running a supported Linux distribution with
nodeadminstalled - Network connectivity (VPN, Direct Connect, or VPC peering) between your cluster VPC and the remote node network
Example code
EKS cluster (main.tf)
The following is the complete main.tf from examples/eks-hybrid-nodes.
Hybrid node role and remote resources (remote.tf)
The modules/hybrid-node-role sub-module creates the IAM role that remote nodes assume during registration. The example also creates SSM activation resources and (for demonstration only) EC2 instances that simulate remote nodes.
Key concepts
remote_network_config
This block tells EKS the IP ranges used by remote nodes and pods. EKS uses this information to route traffic correctly between the control plane, cloud nodes, and hybrid nodes.
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
HYBRID_LINUX access entry
Hybrid nodes use a special access entry type of HYBRID_LINUX instead of the default STANDARD. This grants the hybrid node IAM role the permissions needed to join and operate within the cluster:
create_node_security_group = false
Hybrid nodes cannot use the module-managed node security group because they are not EC2 instances in your VPC. Setting create_node_security_group = false and adding an ingress rule for the remote network CIDR on the cluster security group allows bidirectional traffic.
EKS Auto Mode system node pool
The example enables EKS Auto Mode with the system node pool to run system components (CoreDNS, etc.) on cloud nodes, while hybrid nodes handle application workloads.
Joining a node with nodeadm
Once the SSM activation is created, nodes join the cluster by running nodeadm with a configuration file:
Deploy
1
Initialize Terraform
2
Review the plan
3
Apply
4
Configure kubectl
5
Join remote nodes
Copy the generated
join.sh script to each remote node and execute it, or manually run nodeadm init with the SSM activation credentials from the Terraform output.6
Verify hybrid nodes are ready
Hybrid nodes appear with the label
eks.amazonaws.com/compute-type=hybrid.Key outputs
Full example on GitHub
View the complete example including the AMI build scripts in theami/ directory, VPC peering setup, and the full remote.tf with simulated hybrid nodes.