DevOps.Academy
CoursesCurriculumInterview prepPricing
◔My learningSign in
DevOps.Academy

Free, hands-on DevOps lessons. Made with care in India.

System status

Learn

All coursesLinux roadmapCurriculumInterview questionsCheat sheetsMy learning

Academy

PricingCertificates

Legal

PrivacyTermsContact

devops.rajeev.pro

Kubernetes & HelmLesson 15 of 16
Your progress · 0%
On this page
  1. The control plane
  2. Worker nodes
  3. CRDs and operators
  4. More than one cluster
↖ Course roadmap
Lesson 15 · Advanced topics

Advanced: inside the cluster, CRDs and many clusters

Under the hood: what the control plane and nodes run, how EKS splits the work, a CustomResourceDefinition with validation, what operators add, and when to run more than one cluster.

30 min read · intermediate · hands-on

By the end of this lesson you'll be able to

0 of 4 complete
Lab status

Verified lab: control plane health, node capacity, the system DaemonSets, and a CRD with schema validation (including a real ordering error), on the course's EKS cluster. The output shown is real.
Code walkthrough: writing an operator, and multi-cluster tooling (explained).
Cloud lab: the control plane checks show EKS specifics; CRDs work the same on kind.

You've used Kubernetes for fourteen lessons. This one opens it up: what the machines actually run, how you add your own resource types, and what changes when one cluster isn't enough.

The control plane

The control plane is the cluster's brain. Its parts:

ComponentJob
kube-apiserverThe front door. Every kubectl command and every controller talks only to it.
etcdThe database holding every object's desired and current state.
kube-schedulerPicks a node for each new Pod (lesson 11).
kube-controller-managerRuns the loops that make reality match the spec: Deployments, ReplicaSets, nodes, jobs.
cloud-controller-managerTalks to the cloud: nodes, load balancers, routes.

© The Kubernetes Authors · CC BY 4.0 · converted to WebP · Source ↗

© The Kubernetes Authors · CC BY 4.0 · converted to WebP · Source ↗

On EKS, AWS runs all of this across several availability zones, and you never see the machines:

$ aws eks describe-cluster --name academy --query "cluster.{version:version,platform:platformVersion,status:status,endpointPublic:resourcesVpcConfig.endpointPublicAccess}" --output table
| endpointPublic  | platform  | status  |  version  |
|  True           |  eks.7    |  ACTIVE |  1.37     |
$ kubectl get --raw='/readyz?verbose'
[+]ping ok
[+]log ok
[+]etcd ok
[+]etcd-readiness ok
[+]kms-providers ok
[+]informer-sync ok
...
[+]shutdown ok
readyz check passed
aws eks describe-cluster --name academy --query "cluster.{version:version,platform:platformVersion,status:status,endpointPublic:resourcesVpcConfig.endpointPublicAccess}" --output table
  • awsthe AWS command line
  • --querypick fields from the JSON response
  • --outputoutput format
kubectl get --raw='/readyz?verbose'
  • kubectltalk to a Kubernetes cluster
  • getlist objects

/readyz is the API server reporting its own health, including its connection to etcd. That's the extent of your view into a managed control plane, and the point of paying $0.10 an hour for it: upgrades, backups of etcd and high availability are AWS's job. On a self-managed cluster (kubeadm), these run as Pods on your control plane nodes and backing up etcd is your job.

This lab's endpoint was public, reachable from the internet, protected by IAM authentication. Production clusters usually make it private or restrict it to known IP ranges.

Worker nodes

Every worker node runs the kubelet (starts containers and reports status), a container runtime (containerd), and kube-proxy (Service networking, lesson 5). On EKS, a few more agents run on every node as DaemonSets:

$ kubectl get daemonsets -n kube-system
NAME                     DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR              AGE
aws-node                 3         3         3       3            3           <none>                     61m
ebs-csi-node             3         3         3       3            3           kubernetes.io/os=linux     58m
ebs-csi-node-windows     0         0         0       0            0           kubernetes.io/os=windows   58m
eks-pod-identity-agent   3         3         3       3            3           <none>                     61m
kube-proxy               3         3         3       3            3           <none>                     58m
kubectl get daemonsets -n kube-system
  • kubectltalk to a Kubernetes cluster
  • getlist objects
  • -nin this namespace

aws-node is the VPC CNI, which gives every Pod a real VPC IP address; ebs-csi-node mounts EBS disks (lesson 12); eks-pod-identity-agent hands Pods their IAM credentials. Three nodes, three of each: a DaemonSet puts one Pod on every node that matches, including new ones the autoscaler adds.

Put the two halves together and you can follow one kubectl apply through the whole cluster:

What a node can hold:

$ kubectl describe node ip-10-42-0-115.ap-south-1.compute.internal
Capacity:
  cpu:                2
  memory:             3927880Ki
  pods:               17
Allocatable:
  cpu:                1930m
  memory:             3372872Ki
  pods:               17
System Info:
  Container Runtime Version:  containerd://2.3.7+unknown
  Kubelet Version:            v1.37.1-eks-6e7947a
kubectl describe node ip-10-42-0-115.ap-south-1.compute.internal
  • kubectltalk to a Kubernetes cluster
  • describeshow details and events

(trimmed). Allocatable is capacity minus what's reserved for the kubelet and the OS: 70m of CPU and about 540Mi of memory here. The scheduler only hands out Allocatable, which is why the 600m Pods in lesson 10 fit three per node, not more. And pods: 17: with the VPC CNI each Pod takes an IP from the node's network interfaces, and a t3.medium has room for 17. Small instances run out of Pod slots before they run out of CPU, a common surprise on EKS. (Prefix delegation on the VPC CNI raises the limit.)

CRDs and operators

The API has about 88 built-in and add-on resource types (kubectl api-resources | wc -l printed 88, header included). A CustomResourceDefinition adds your own. This one defines a Website:

# 15-crd.yaml (CRD part)
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: websites.academy.example.com
spec:
  group: academy.example.com
  scope: Namespaced
  names:
    plural: websites
    singular: website
    kind: Website
    shortNames: ['ws']
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              required: ['domain', 'replicas']
              properties:
                domain:
                  type: string
                replicas:
                  type: integer
                  minimum: 1
                  maximum: 10

The same file also held a Website named shop. Applying both at once:

$ kubectl apply -f 15-crd.yaml
customresourcedefinition.apiextensions.k8s.io/websites.academy.example.com created
error: resource mapping not found for name: "shop" namespace: "" from "15-crd.yaml": no matches for kind "Website" in version "academy.example.com/v1"
ensure CRDs are installed first
$ kubectl get crd websites.academy.example.com
NAME                           SCOPE        VERSIONS      CREATED AT
websites.academy.example.com   Namespaced   v1(storage)   2026-11-09T06:49:50Z
kubectl apply -f 15-crd.yaml
  • kubectltalk to a Kubernetes cluster
  • applycreate or update from a file
  • -ffrom this file
kubectl get crd websites.academy.example.com
  • getlist objects

A real gotcha: the CRD was created, but the API server hadn't started serving the new kind when kubectl sent the Website a moment later. Apply CRDs first, wait (kubectl wait --for=condition=Established crd/...), then apply the resources. Helm keeps CRDs in a separate crds/ folder and Argo CD has sync waves for the same reason.

The schema is enforced by the API server like any built-in type:

$ kubectl apply -f bad-ws.yaml     # replicas: 50
The Website "too-big" is invalid: spec.replicas: Invalid value: 50: spec.replicas in body should be less than or equal to 10
kubectl apply -f bad-ws.yaml
  • kubectltalk to a Kubernetes cluster
  • applycreate or update from a file
  • -ffrom this file

The cluster already had CRDs from add-ons, such as the load balancer controller's targetgroupbindings.elbv2.k8s.aws. That's the pattern: a CRD alone only stores objects. An operator is a controller, code running in the cluster, that watches those objects and makes the world match them. The load balancer controller watches Ingresses and TargetGroupBindings and creates ALBs. A database operator (CloudNativePG, for example) watches a Cluster object and creates StatefulSets, backups and failover. Operators are usually written in Go with Kubebuilder or Operator SDK; you'll use far more of them than you write.

More than one cluster

One cluster is simplest. Teams add more when they need:

  • Isolation of environments: separate clusters for dev, staging and production, so a bad change in dev can't touch production. This is the most common reason.
  • Blast radius and upgrades: a broken cluster upgrade takes down one cluster, not everything.
  • Regions: serve users from nearby, or survive a region outage.
  • Hard tenancy: teams or customers who must not share nodes or a control plane.

The cost is more to run: upgrades, add-ons and policies times N. The tools that make it manageable are the ones from this course: Terraform modules to create identical clusters (lesson 3), Helm charts and GitOps (Argo CD ApplicationSet deploys one app to many clusters), and kubeconfig contexts to switch between them (kubectl config get-contexts, kubectl config use-context). Always check which context you're in before a destructive command; kubectl happily deletes in production if that's where it points.

Where to go next

You now have the whole path: containers, a cluster, workloads, networking, config, resources, security, troubleshooting, autoscaling, scheduling, storage, Helm and releases. Build the capstone from these pieces on kind, or on EKS if you're ready to pay for a few hours, and destroy it when you're done.

⌘
Mini mission

Look inside and extend the API

Record the control plane's readyz result, one node's Capacity and Allocatable, and the kube-system DaemonSets. Then apply the Website CRD on its own, wait for it, create a valid Website and try one with replicas 50.

Input: 15-crd.yamlOutput: ~/advanced.txt
Reveal one safe solution
$ kubectl get --raw='/readyz?verbose' | tail -1 > ~/advanced.txt
$ kubectl describe node $(kubectl get nodes -o name | head -1 | cut -d/ -f2) | sed -n '/^Capacity:/,/^System Info:/p' >> ~/advanced.txt
$ kubectl get daemonsets -n kube-system >> ~/advanced.txt
$ kubectl apply -f 15-crd.yaml 2>&1 | tee -a ~/advanced.txt
$ kubectl wait --for=condition=Established crd/websites.academy.example.com
$ kubectl apply -f 15-crd.yaml && kubectl get websites >> ~/advanced.txt
$ kubectl create -f - <<'EOF' 2>> ~/advanced.txt
apiVersion: academy.example.com/v1
kind: Website
metadata: { name: too-big }
spec: { domain: big.example.com, replicas: 50 }
EOF
$ kubectl delete crd websites.academy.example.com
kubectl get --raw='/readyz?verbose' | tail -1 > ~/advanced.txt
  • kubectltalk to a Kubernetes cluster
  • getlist objects
  • |pipe: send output to the next command
  • tailshow the last lines
  • >write output to a file, replacing it
kubectl describe node $(kubectl get nodes -o name | head -1 | cut -d/ -f2) | sed -n '/^Capacity:/,/^System Info:/p' >> ~/advanced.txt
  • describeshow details and events
  • $(kubectl get nodes -o name | head -1 | cut -d/ -f2)the output of another command
  • >>append output to a file
kubectl get daemonsets -n kube-system >> ~/advanced.txt
  • -nin this namespace
kubectl apply -f 15-crd.yaml 2>&1 | tee -a ~/advanced.txt
  • applycreate or update from a file
  • -ffrom this file
  • 2>&1send errors to the same place as output
  • teewrite input to a file and pass it on
  • -aappend
kubectl apply -f 15-crd.yaml && kubectl get websites >> ~/advanced.txt
  • &&run the next command only if this one worked
kubectl create -f - <<'EOF' 2>> ~/advanced.txt
  • createcreate an object
  • -the previous directory
kubectl delete crd websites.academy.example.com
  • deletedelete an object

The first apply should create the CRD and fail on the Website; the second should succeed. Deleting the CRD deletes every Website with it.

Try it yourself

0 of 5 steps done

Run each task in your own account or terminal, then tick it off.

Knowledge check

Quick check

Question 1 of 3

On EKS, who runs etcd and the API server?

Go deeper

Official reading for this lesson

  • DocsKubernetes componentsKubernetes ↗
  • DocsCustom resourcesKubernetes ↗
  • DocsOperator patternKubernetes ↗
  • DocsAmazon EKS architectureAWS Docs ↗
  • DocsEKS best practices guideAWS Docs ↗

Or get every quiz answer right and it completes itself.

Something unclear, wrong or out of date in this lesson? Tell me, and I'll fix it.

← PreviousDeployment patterns: rolling, blue-green, canary, GitOpsNext lesson →Capstone: a production-ready release of shop-web