Sub topic 2
How EKS Is Put Together
This chapter assumes you know the basic Kubernetes objects (pods, deployments, services, namespaces). It also assumes you can use kubectl and have met IAM, VPC and EC2 in AWS. Here you will learn which parts of a cluster AWS runs, which parts you run, and where the two connect.
The two halves of a cluster
A Kubernetes cluster has a control plane and a data plane. The control plane decides what should run. The data plane is the set of machines that run it.
- The control plane holds the API server, the etcd database, the scheduler and the controller manager. etcd stores all cluster state.
- The data plane is the worker nodes, which run the kubelet, a container runtime and your pods.
EKS runs the control plane for you and leaves the data plane to you. You never get a shell on a control plane machine. You also can't see etcd, tune the API server flags, or patch the control plane operating system. Your interface is the Kubernetes API endpoint and the EKS API.
What AWS operates
For every cluster, AWS runs the API server and etcd instances across multiple Availability Zones in an account that it owns. This is where the high availability comes from. If one AZ has a problem, the other API server instances keep answering. AWS also does the following:
- It replaces unhealthy control plane instances.
- It scales the API server and etcd as the cluster grows.
- It patches the control plane.
- It carries out the control plane part of a version upgrade when you ask for one.
AWS publishes an availability commitment for the control plane. Check the current EKS service terms for the exact figure, because it is a contract detail that can change.
You pay a flat hourly fee for each cluster, plus whatever the data plane costs. The fee is higher for versions in extended support. The "Keeping EKS Costs Under Control" chapter covers this.
What you operate
You own everything on the data plane side:
- The worker nodes: their size, count, AMI, and the OS patches that reach them.
- The VPC, subnets, route tables and security groups.
- Add-ons and controllers that you install. Examples are the load balancer controller and storage drivers.
- The workloads and their manifests.
- Who is allowed to call the API (the "Who Can Talk to the Cluster" chapter).
Managed node groups, Fargate and EKS add-ons move some of this work to AWS, but the boundary always sits at the nodes. The next table shows the split.
| Area | AWS | You |
|---|---|---|
| API server and etcd availability | Runs, scales, repairs | Chooses the Kubernetes version |
| Control plane patching | Applies | Triggers version upgrades |
| Worker nodes | Provides AMIs and, for managed node groups, drives the upgrade | Chooses capacity, rolls out new AMIs |
| Networking | Provides the VPC CNI plugin as an add-on | Designs subnets, CIDR ranges, security groups |
| Workload security | Provides IAM integration | Writes RBAC, pod permissions, network policies |
| Application | Nothing | Everything |
How the two halves connect
The control plane is in an account you can't see into, yet it must talk to nodes in your VPC. EKS solves this with cross-account elastic network interfaces (ENIs). When you create a cluster, you give EKS at least two subnets in different AZs. EKS creates network interfaces in those subnets, and the interfaces belong to your VPC but are managed by EKS. Traffic between the control plane and the kubelets flows through them.
This produces some practical consequences:
- The subnets you pick at creation need free IP addresses. A subnet that is nearly full can block cluster updates.
- Don't delete or edit the EKS-managed ENIs. Their description starts with "Amazon EKS", which helps you recognise them.
- Subnets in at least two AZs are required. Spread them across three if the region has them.
EKS also creates a cluster security group. Managed node groups and Fargate pods get it by default, and it allows traffic between the control plane and the nodes. If you build your own security group rules, keep this traffic path open.
The API endpoint
Every cluster has one Kubernetes API endpoint, a public DNS name. You can control who can reach it:
| Mode | Public access | Private access | Who can reach the API |
|---|---|---|---|
| Public only (default) | On | Off | Anyone on the internet who can authenticate, optionally limited to CIDR ranges |
| Public and private | On | On | The internet, plus traffic from inside the VPC stays on the private network |
| Private only | Off | On | Only networks connected to the VPC (VPN, Direct Connect, peering, a bastion) |
Authentication still applies in every mode. A public endpoint is not an open one. The endpoint is protected by IAM-based authentication, and you can narrow it further with publicAccessCidrs. Private-only is the strictest option, but you lose kubectl access from your laptop unless it is on a connected network. It also affects nodes: they must reach the endpoint through the VPC.
Inspect the current settings of a cluster with the AWS CLI:
aws eks describe-cluster \
--name demo \
--region us-east-1 \
--query 'cluster.{version:version,endpoint:endpoint,public:resourcesVpcConfig.endpointPublicAccess,private:resourcesVpcConfig.endpointPrivateAccess,clusterSecurityGroup:resourcesVpcConfig.clusterSecurityGroupId}' \
--output tableTo switch a cluster to public and private access, run:
aws eks update-cluster-config \
--name demo \
--region us-east-1 \
--resources-vpc-config endpointPublicAccess=true,endpointPrivateAccess=trueThe update is asynchronous. The command returns an update ID, and you can follow progress with aws eks describe-update.
Authentication and authorization in brief
EKS reuses IAM for the question "who are you?". A request to the API server carries a token derived from an IAM identity. The cluster maps that identity to a Kubernetes user and groups, and Kubernetes RBAC then decides what the user may do. So there are two layers: IAM proves identity, and RBAC (or access policies) grants permissions inside the cluster. The "Who Can Talk to the Cluster" chapter covers the details. For now, remember that having eks:* permissions in IAM does not by itself let you read pods. Calling the EKS API and calling the Kubernetes API are separate permission checks.
Kubernetes versions and support
EKS supports several Kubernetes minor versions at a time. Each version has a standard support window, followed by a longer paid extended support window. After that, EKS upgrades the cluster for you, so it's better to plan your own upgrade first. The control plane version and the node versions may differ, but nodes must not be newer than the control plane. The kubelet may lag the API server by a limited number of minor versions. The "Upgrading Kubernetes Versions Safely" chapter returns to this.
Common errors and gotchas
- Nodes never join. Nodes need a route to the API endpoint, the right IAM role, and the cluster security group or equivalent rules. A private-only endpoint with no route is a frequent cause.
kubectlsays "Unauthorized". Your IAM identity is not mapped to a Kubernetes user. The cluster creator gets admin rights, but other identities do not.kubectltimes out. Public access is off, or your IP is outsidepublicAccessCidrs.- Subnet runs out of IPs. Pod networking uses VPC addresses, and EKS's own ENIs need room too. The next chapter explains how the VPC CNI uses addresses.
- Expecting control plane logs by default. They are off until you enable them per log type.
Exercise
A teammate says, "EKS manages Kubernetes for us, so AWS also patches our worker nodes." Is that correct? Name one case where the statement is partly true and say what remains your job.
Show answer
It is mostly incorrect. AWS patches and operates the control plane (API server, etcd, scheduler, controllers). Worker nodes belong to the data plane and to you. It is partly true for managed node groups, where AWS provides updated AMIs and performs the rolling replacement, but you must still choose to start the update, pick the AMI version, and make sure your workloads survive the node replacement.
Exercise
You set a cluster to private-only endpoint access and then kubectl get nodes from your laptop times out. The nodes are healthy. What is the cause, and give two ways to restore access without making the endpoint public.
Show answer
The API endpoint is now reachable only from networks connected to the VPC, and your laptop is not on one. You can connect through a VPN or Direct Connect link into the VPC, or run kubectl from a bastion host or CI runner inside the VPC (or a peered network).