Cluster Endpoint Access
EKS exposes a Kubernetes API server endpoint for the cluster. You control who can reach that endpoint through two variables.| Variable | Type | Default | Description |
|---|---|---|---|
endpoint_private_access | bool | true | Enable the private API server endpoint inside your VPC |
endpoint_public_access | bool | false | Enable the public API server endpoint reachable from the internet |
endpoint_public_access_cidrs | list(string) | ["0.0.0.0/0"] | CIDR blocks allowed to reach the public endpoint |
Endpoint Configurations
- Private Only (default)
- Public Only
- Public + Private (Recommended)
Nodes communicate with the control plane entirely within your VPC. No public internet exposure for the API server.
Ensure VPC DNS resolution and DNS hostnames are enabled when using the private endpoint. Nodes must be able to resolve the private endpoint hostname.
Restricting Public Access CIDRs
Whenendpoint_public_access = true, you can restrict which IP addresses are allowed to reach the API server by setting endpoint_public_access_cidrs. When you restrict access this way, you must also ensure that your nodes and Fargate pods are included in the allowed CIDRs (or use the private endpoint alongside it), because EKS nodes also contact the public endpoint to register with the cluster.
Subnet Configuration
The module distinguishes between two subnet variables that serve different purposes.| Variable | Purpose |
|---|---|
subnet_ids | Subnets where node groups and Fargate profiles will be launched |
control_plane_subnet_ids | Subnets where EKS provisions the control plane ENIs |
control_plane_subnet_ids is not provided, the control plane ENIs are placed in subnet_ids. Providing separate control plane subnets lets you expand the node subnet pool later without replacing the control plane.
Security Group Architecture
The module creates two security groups by default:Cluster Security Group
An “additional” security group attached to the cluster control plane. Allows customizing inbound and outbound rules for control-plane-to-node communication. Defaults include the AWS minimum recommendations plus NTP and HTTPS egress.
Node Security Group
A shared security group attached to all node groups created by the module. Provides the minimum access needed for nodes to join the cluster. Enable recommended rules with
node_security_group_enable_recommended_rules.Extending the Cluster Security Group
Usesecurity_group_additional_rules to add rules to the cluster security group. Set source_node_security_group = true to reference the node security group as the source.
Extending the Node Security Group
Usenode_security_group_additional_rules to open up node-to-node communication or allow traffic from specific sources. Set source_cluster_security_group = true to reference the cluster security group.
Bringing Your Own Security Groups
You can disable the module-managed security groups and supply externally created ones instead.IP Family
Theip_family variable controls whether pods and services receive IPv4 or IPv6 addresses.
| Value | Behavior |
|---|---|
ipv4 (default) | Standard IPv4 addressing for pods and services |
ipv6 | IPv6 addressing; requires create_cni_ipv6_iam_policy = true |
Troubleshooting: Nodes Not Registering
Nodes are not joining the cluster
Nodes are not joining the cluster
Nodes failing to register with the EKS control plane is almost always a networking problem. Work through these checks in order:
Verify at least one endpoint is enabled
Check that either
endpoint_public_access or endpoint_private_access is true. Both cannot be false.Check node-to-endpoint reachability
- Private subnets: nodes need a NAT gateway (or NAT instance) and the correct route table entry to reach a public endpoint, or use the private endpoint.
- Public subnets: nodes must launch with a public IP. Enable this via the subnet default or on the launch template.
Check CIDR restrictions
If
endpoint_public_access_cidrs is set, node outbound IPs must be included. If nodes use a NAT gateway, add that gateway’s Elastic IP to the allowed CIDRs.Enable the private endpoint for internal traffic
Setting
endpoint_private_access = true allows nodes to communicate with the API server over the private network. Ensure VPC DNS resolution and DNS hostnames are enabled.Error: expect exactly one securityGroup tagged with kubernetes.io/cluster/<NAME>
Error: expect exactly one securityGroup tagged with kubernetes.io/cluster/<NAME>
This error (commonly triggered by the AWS Load Balancer Controller) occurs when multiple security groups attached to nodes carry the same Option 2: Do not attach the cluster primary security group (keep only the module node SG):If using Custom Networking, ensure your
kubernetes.io/cluster/<CLUSTER_NAME> = owned tag.By default, EKS creates a cluster primary security group with this tag. The error appears when you also attach the module-created node security group and set attach_cluster_primary_security_group = true, resulting in two tagged security groups on the same nodes.Resolution — choose one approach:Option 1: Disable the module node security group and use the cluster primary SG only:ENIConfig resources only reference the security group matching your chosen approach.