# Kubernetes Architecture and kubectl

> Understand the control plane, nodes, the reconciliation loop and the declarative API before touching workloads. Free notes, key concepts, resources and a mini...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/kubernetes-architecture
Last updated: 2026-11-28

Understand the control plane, nodes, the reconciliation loop and the declarative API before touching workloads.

Intermediate · about 10 hours · difficulty 3/5

Learn first: [Containers and Docker Basics](https://www.internhack.in/roadmaps/tracks/devops/container-fundamentals), [Container Registries](https://www.internhack.in/roadmaps/tracks/devops/container-registries)

Kubernetes is a platform for running containers across a cluster of machines. Its central idea is **declarative desired state**: you tell the API what should exist, and controllers continuously reconcile reality toward it.

### Components

- **Control plane**: the **API server** (everything goes through it), **etcd** (the state store), the **scheduler** (places pods on nodes), and the **controller manager** (runs reconciliation loops).
- **Nodes**: the **kubelet** (starts pods via a container runtime like containerd), **kube-proxy** or an eBPF replacement for service networking, and a **CNI** plugin for pod networking.
- Managed offerings (EKS, GKE, AKS) run the control plane for you.

### Working with the API

- Everything is an object with `apiVersion`, `kind`, `metadata` and `spec`, stored as YAML manifests.
- `kubectl apply -f`, `get`, `describe`, `logs`, `exec`, `port-forward`, `explain`, `get events --sort-by=.lastTimestamp`.
- **Namespaces**, **labels** and **selectors** organise and connect objects.
- Contexts in `~/.kube/config` choose which cluster you talk to.

### Local practice

kind, minikube or k3d give you a cluster on a laptop in a minute.

### Pitfalls

Imperative `kubectl edit` changes that drift from git, and running commands against the wrong context (show it in your prompt).

**Good enough to move on:** you can explain what happens from `kubectl apply` to a running container, and debug a pending or crashing pod using describe, events and logs.

## Key concepts

- **API server, etcd, scheduler, controllers**
- **kubelet, runtime and CNI**
- **Declarative manifests and reconciliation**
- **kubectl essentials**
- **Namespaces, labels, selectors**
- **kind / minikube / k3d**
- **Managed Kubernetes (EKS, GKE, AKS)**
- **k9s and kubectx**

## Mini project

Create a local cluster with kind, deploy a pod with a deliberately wrong image name, and use describe, events and logs to diagnose and fix it; then write down each control plane component that was involved.

## Check yourself

If you delete a pod created by a Deployment, why does a new one appear, and which component makes that happen?

## Free resources

- [Kubernetes documentation](https://kubernetes.io/docs/home/) (kubernetes.io)
- [Kubernetes components](https://kubernetes.io/docs/concepts/overview/components/) (kubernetes.io)
- [kind quick start](https://kind.sigs.k8s.io/) (Kubernetes SIGs)

Previous: [Container Security Essentials](https://www.internhack.in/roadmaps/tracks/devops/container-security) · Next: [Workloads, Probes and Autoscaling](https://www.internhack.in/roadmaps/tracks/devops/k8s-workloads)

## More in Orchestrating Containers with Kubernetes

- [Kubernetes Architecture and kubectl](https://www.internhack.in/roadmaps/tracks/devops/kubernetes-architecture)
- [Workloads, Probes and Autoscaling](https://www.internhack.in/roadmaps/tracks/devops/k8s-workloads)
- [Services, Ingress and Network Policy](https://www.internhack.in/roadmaps/tracks/devops/k8s-networking)
- [Configuration, Secrets, Storage and RBAC](https://www.internhack.in/roadmaps/tracks/devops/k8s-config-storage)
- [Packaging with Helm and Kustomize](https://www.internhack.in/roadmaps/tracks/devops/helm)
- [Operators and Custom Resources](https://www.internhack.in/roadmaps/tracks/devops/k8s-operators)
- [Service Mesh](https://www.internhack.in/roadmaps/tracks/devops/service-mesh)
- [Beyond Kubernetes: Nomad and ECS](https://www.internhack.in/roadmaps/tracks/devops/nomad-ecs)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
