KUBERNETESNOTES
A comprehensive collection of Kubernetes concepts, explained in simple words with clear diagrams and examples. Perfect for quick revision and interview preparation!
What's Inside?
- Core Concepts
- Architecture
- Pods and Deployments
- Services and Ingress
- Config and Storage
- GitOps and Certificates
- Autoscaling, Gateway API
- Serverless, Identity
- Observability
- Controllers, Operators, RBAC
Why This Notes?
- Easy to understand
- Well-structured
- Interview focused
- Quick revision
- Handwritten style for better retention
“Learn, Deploy, and Scale with Kubernetes!”
Start here
Contents
Part 2.Beyond Core
GitOps and delivery
- Flux CD v2GitOps sync from Git, plus a web UI
- Argo CDGitOps apps with a live web UI
- Argo CD Image Updaterbumps image tags for Argo CD apps
CI and builds
- Actions Runner ControllerGitHub runners, one Pod per job
- Gitea Actions Runnersa polling runner pool for Gitea
- Building Images in the Clusterdind, BuildKit, Buildah or kaniko
Certificates and secrets
- cert-managerautomatic TLS certificates
- External Secrets Operatorsecrets from Vault and clouds
Data
- CloudNativePG OperatorPostgres clusters as CRDs
Cloud infrastructure
- Crossplanecloud resources declared in YAML
Scaling and metrics
- KEDAevent driven autoscaling
- Karpenteradds nodes for pending Pods
- metrics-serverCPU and memory for HPA
- kube-state-metricsobject state as metrics
Networking and traffic
- MetalLBLoadBalancer IPs on bare metal
- Gateway API CRDsthe standard routing types
- Gateway APIsuccessor to Ingress
- kgatewayEnvoy based gateway
Serverless
- Knative Operatorinstalls and upgrades Knative
- Knativescale to zero services
Part 2.Beyond Core (continued)
Observability
- OpenTelemetry Operatorcollectors and auto-instrumentation
- Prometheus and ServiceMonitorsmetrics, PromQL, scrape by selector
- Alertmanager Routinggroup, route and silence alerts
- Loki and Log Pipelines with Alloylabel-indexed logs, Alloy pipelines
- Kubernetes Events as a Signalwhy it changed, kept past 1h
- Tracing with Tempospans, TraceQL, trace to logs
- Continuous Profiling with Pyroscopeflame graphs, eBPF, span profiles
Part 3.Advanced Concepts
Under the hood: the machinery that core objects and every add-on rely on, grouped by topic.
Extending the API
- Controllers and Reconciliationwatch, compare, fix, repeat
- Custom Resources (CRDs)your own kinds in the API
- Operatorsapp know-how in a controller
API machinery
- API Machinery and Server-Side Applyversions, watches, field owners
- Owners, Finalizers and Garbage Collectionwho cleans up, and when
- Admission Controlmutate and check each request
Security
- RBAC and Service Accountswho can do what, and as whom
- Pod Securityprivileged, baseline, restricted
Top to bottom is the path of one change. Blue names are the topics that explain each step.
In short : Part 2 ends with observability: metrics, alerts, logs, events, traces and profiles. Part 3 starts with the API itself: how it is extended, how each request is checked, and who may do what.
Part 3.Advanced Concepts (continued)
Who you are and what you trust, trusted images, where Pods run and how they are sized and scaled, then the network and storage under every Pod.
Identity and trust
- OIDC Authentication for the API Serverkubectl login with ID tokens
- Keycloak and Single Sign-Onone login for every app
- OpenBao: Secrets as a Serviceshort-lived secrets behind policies
- Private PKI and Trust Distributionyour own CA, trusted everywhere
- Pod Certificatesa cert per Pod, from the kubelet
Supply chain security
- Images, Registries and Pullsdigests, pull policy, credentials
- Image Signing: Sigstore and Notationwho published this digest
- SBOMs, Provenance and Attestationssigned claims about a digest
- Enforcing Image Policyverify at admission and on the node
Scheduling
- Advanced Schedulingaffinity, taints, spread, priority
- Dynamic Resource AllocationGPUs and other devices, by claim
Resources and autoscaling
- Requests, Limits and QoSreserve, cap, and who is evicted first
- In-Place Pod Resizenew CPU and memory, same Pod
- Vertical Pod Autoscalerrequests sized from real usage
- Horizontal Pod Autoscaler in Depthreplica math, behavior, scale to zero
Networking internals
- Pod Networking and CNIhow a Pod gets an IP and a route
- The Service Dataplanefrom a Service IP to one Pod
- Cluster DNS in Depthfrom a name to a Service IP
- Network Policy in Depthwho may talk to whom, proven
Storage internals
- CSI Drivers and the Volume Lifecyclesidecars, attach, stage, publish
- Volume Topology and Schedulingzones, capacity, attach limits
- Volume Operations and Failure Modesresize, mount cost, stuck detach
- Snapshots, Clones and Backupsnapshots, restores, Velero backups
One Pod, end to end
Top half: traffic on its way to the Pod. Bottom half: the life of its volume.
In short : Part 3 continues under the hood: identity and trust, trusted images, placement, sizing and autoscaling, then the network and storage under every Pod.
Part 3.Advanced Concepts (continued)
Cluster management
- Cluster APIwhole clusters as Kubernetes objects
GitOps
- GitOps with Flux: Deep Diverunning Flux at scale, across clusters
- Secrets in Git with SOPSencrypted Secrets that Flux decrypts
Tip.Start from a question
Start with Part 1. Then read each topic's In short first.
| Situation | Read |
|---|---|
| A Pod cannot reach a Service by name | Cluster DNS, Service Dataplane |
| Only some Pods should reach a database | Network Policy |
| A Pod is Pending: its volume is in another zone | Volume Topology |
| A volume is stuck attaching or detaching | Volume Operations, CSI Drivers |
| You need yesterday's data back | Snapshots and Backup |
| Keep a password in Git safely | Secrets in Git with SOPS, External Secrets |
| A GitHub Actions job waits, no runner picks it up | ARC |
| A Gitea runner rollout cancels running jobs | Gitea Runners |
| CI must build images, but privileged Pods are banned | Image Builds, Pod Security |
| Only signed images may run | Image Signing, Image Policy |
| An object will not delete | Finalizers and GC |
| Two tools fight over the same field | API Machinery |
| Pods need GPUs or other devices | DRA, Scheduling |
| A ServiceMonitor is ignored, no targets appear | Prometheus |
| Too many alert messages, or none at all | Alertmanager |
| Logs are rejected or slow to query | Loki and Alloy |
| A Pod failed an hour ago and its Events are gone | Events |
| One request is slow, but which service and which line ? | Tempo, Pyroscope |
| kubectl should log you in with your company account | OIDC Auth, Keycloak |
| Every app asks for its own password | Keycloak |
| A Pod needs a database password that expires | OpenBao, External Secrets |
| Internal TLS fails with "unknown authority" | Private PKI |
| Each Pod needs its own short-lived certificate | Pod Certificates, SPIRE |
| A container is OOMKilled, or slow under a CPU limit | Requests and Limits |
| A running Pod needs more CPU, without a restart | In-Place Resize |
| Nobody knows what requests to set | VPA, Requests and Limits |
| The HPA scales too late, too often, or not at all | HPA in Depth |
In short : Part 1 teaches the core of Kubernetes in 13 topics.
Part 2 adds 29 topics, grouped by what they do.
Part 3 looks under the hood, with 34 topics on how it all fits together.
Part 2 adds 29 topics, grouped by what they do.
Part 3 looks under the hood, with 34 topics on how it all fits together.