1. The control plane #
The brain of the cluster.
The components #
| Component | Role |
|---|---|
| kube-apiserver | REST API, authentication, authorization, admission; the only access point to etcd |
| etcd | Distributed key/value store holding the entire cluster state (back it up!) |
| kube-scheduler | Chooses a pod's node based on resources, affinities and constraints |
| kube-controller-manager | Control loops: replicas, nodes, endpoints, jobs... |
| cloud-controller-manager | Integration with the cloud provider (load balancers, volumes) |
2. Worker nodes #
Where pods run.
kubelet, runtime and kube-proxy #
- kubelet: the node agent; starts the containers described by pods and reports their status.
- Container runtime (containerd, CRI-O): actually runs the containers through the CRI interface.
- kube-proxy: programs the network rules (iptables/IPVS) for Services.
kubectl get nodes -o wide
kubectl describe node <noeud> | sed -n '/Capacity/,/Allocated resources/p'
kubectl get --raw='/readyz?verbose' | head -20 # santé de l'API server
kubectl -n kube-system get pods -o wide # composants système
kubectl cluster-info
crictl ps # sur un nœud : conteneurs (runtime CRI)3. The reconciliation loop #
The declarative principle.
Desired state vs observed state #
Kubernetes is declarative: you describe the desired state (« 3 replicas of this application ») and controllers act continuously so that the actual state converges toward the desired state. If a pod disappears, another one is recreated without intervention.
kubectl create deployment web --image=nginx --replicas=3
kubectl delete pod -l app=web --wait=false # supprimer les pods
kubectl get pods -l app=web -w # de nouveaux pods apparaissent aussitôt
kubectl get events --sort-by=.lastTimestamp | tail4. The basic objects #
The vocabulary to know.
Overview #
| Object | Role | Example |
|---|---|---|
| Pod | Smallest deployable unit (1 or more containers) | kubectl run |
| ReplicaSet / Deployment | Maintains N pods; handles updates | kubectl create deployment |
| Service | Stable access point to pods | ClusterIP, NodePort, LoadBalancer |
| Ingress / Gateway | HTTP routing from outside | nginx, HAProxy, Traefik |
| ConfigMap / Secret | Configuration and sensitive data | variables, files |
| PersistentVolumeClaim | Request for persistent storage | StorageClass |
| Namespace | Logical isolation | dev, prod |
| Job / CronJob | One-off or scheduled tasks | backups |
kubectl api-resources | head -30 # toutes les ressources disponibles
kubectl explain deployment.spec.strategy # documentation intégrée d'un champ
kubectl explain pod.spec.containers --recursive | head -40