Sub topic 2
How EKS Is Put Together
This chapter assumes you know pods, deployments, services and namespaces, can use kubectl and YAML, and have basic familiarity with IAM, VPC and EC2. It explains who runs which part of an EKS cluster. Later chapters build on that split.
Two planes, two owners
An EKS cluster has a control plane and a data plane.
The control plane is the Kubernetes API server, the etcd datastore, the scheduler and the controller manager. AWS runs these components in an AWS-owned account. It spreads them across multiple Availability Zones, replaces failed instances and patches them. You never see these machines in your EC2 console.
The data plane is where your pods run. Your nodes are EC2 instances, or Fargate capacity, in subnets of your own VPC. You choose the instance types and pay for them. Depending on the compute option, you may also be responsible for patching them.
The two planes connect over the network. EKS creates cross-account elastic network interfaces (ENIs) in subnets of your VPC. Nodes use them to reach the API server, and the API server uses them to reach kubelets for kubectl logs and kubectl exec.
Responsibility split
| Area | AWS | You |
|---|---|---|
| API server, etcd, scheduler | Run, scale, patch, keep available | Choose the Kubernetes version and upgrade timing |
| Worker nodes | Nothing with self-managed nodes. Managed node groups provide AMIs and orchestrate updates. | Instance types, scaling limits, triggering updates |
| VPC, subnets, security groups | Nothing | Design and operate |
| Workloads and IAM | Nothing | Manifests, RBAC, pod permissions |
This model is often called shared responsibility. The control plane is a managed service. The data plane is only partly managed, and the amount depends on the compute option covered in a later chapter.
The API endpoint
The cluster endpoint is a public HTTPS URL by default. Access is still authenticated and authorized. You can restrict it in these ways:
- Limit the public endpoint to specific CIDR ranges.
- Enable the private endpoint, which is reachable only from inside the VPC or from networks connected to it.
- Disable the public endpoint when you have private connectivity such as VPN or Direct Connect.
Nodes need to reach the API server. If you disable the public endpoint, nodes use the private path. Make sure your VPC DNS settings allow this, or nodes will fail to join.
What is not in the control plane
Several things you might expect to be built in are separate components that run as pods or are configured by you:
- Networking: pod networking comes from the Amazon VPC CNI plugin, covered in the next chapter.
- DNS: CoreDNS runs as pods on your nodes.
- Load balancers and volumes: these need extra controllers and drivers.
- Autoscaling: the Kubernetes cluster does not add nodes by itself.
Many of these are installed as EKS add-ons, which a later chapter covers.
Checking the split yourself
After you create a cluster, you can see the boundary. Run these commands against a cluster:
aws eks describe-cluster --name demo --region us-east-1 \
--query 'cluster.{version:version,endpoint:endpoint,public:resourcesVpcConfig.endpointPublicAccess,private:resourcesVpcConfig.endpointPrivateAccess}'
kubectl get nodes -o wide
kubectl get pods -n kube-systemThe first command shows the managed endpoint and its access settings. The node list shows only your data plane. kube-system shows CoreDNS and other pods, but no kube-apiserver or etcd pods. Those run in the AWS-owned account.
Common errors
- Assuming AWS patches your nodes. With managed node groups, AWS supplies updated AMIs, but you must start the update.
- Subnets in too few zones. The control plane's availability does not make your workloads highly available. Spread nodes across at least two Availability Zones.
- Disabling the public endpoint without a private route. You lose
kubectlaccess from your laptop.
Exercise
A teammate says they cannot find the etcd pods in kube-system, and asks if the cluster is broken. What do you tell them?
Show answer
Nothing is broken. In EKS, AWS runs etcd and the API server in an AWS-managed account, so they do not appear as pods or instances in your cluster. Only data plane components such as CoreDNS and the VPC CNI appear in kube-system.
Exercise
You turn off the public API endpoint on a cluster that has no VPN. What happens to your laptop's kubectl, and what is the fix?
Show answer
kubectl can no longer reach the API server, because the private endpoint is only reachable from inside the VPC or connected networks. Re-enable the public endpoint (optionally limited to your CIDR range), or set up VPN or Direct Connect, or run kubectl from a host inside the VPC.