Kubernetes — The course

Guide 01 / 3

Kubernetes glossary

Understand orchestration and the role of Kubernetes resources through simple definitions and concrete examples.

Expected outcome :

Explain the cluster → nodes → Pods relationship and identify controllers, services and storage mechanisms.

Reading
0%

01 · Understanding the cluster

Kubernetes does not build images: it organises the running of containerised applications across several machines.

Kubernetes (K8s)

An orchestration platform that deploys, monitors and adjusts applications running as containers. It continuously tries to bring reality closer to the requested configuration.

Demander 3 répliques : Kubernetes tente de maintenir 3 Pods.
Remember :

Kubernetes complements Docker and other engines; it does not replace a Dockerfile.

Cluster

A set of machines and Kubernetes components that cooperate to run applications. It includes a control plane and worker nodes.

Un cluster de TP : 1 control plane et 2 workers.

Control plane

The set of components that make the decisions: receiving requests, storing objects, scheduling and correcting the cluster's state.

API server + etcd + scheduler + controller manager.
Remember :

It is not necessarily a single machine.

Worker node

A physical or virtual machine that hosts the Pods and runs the tasks assigned by the cluster.

Un worker héberge les Pods web et api.

API server

The Kubernetes API's entry point. It validates requests and lets you create, view or modify resources.

kubectl get pods interroge l’API server.

etcd

A key-value database used to keep the cluster's state and configuration.

Les objets Deployment sont stockés via le plan de contrôle.
Remember :

Its backups are critical for recovering a self-managed cluster.

Scheduler

A control plane component that chooses the node on which an unassigned Pod can run.

Tient compte des ressources, affinités, contraintes et taints.

Controller / reconciliation

A control loop that observes the actual state and acts to reach the desired state (reconciliation).

Un contrôleur recrée un Pod perdu pour maintenir 3 répliques.

Kubelet

An agent present on each node, responsible for running the Pods assigned to the node and reporting their state.

Kubelet supervise les conteneurs d’un Pod.

Container runtime

Software present on the nodes that runs the containers (often containerd or CRI-O) through the CRI interface.

Kubelet demande à containerd de démarrer un conteneur.
Remember :

Docker Engine is not essential on modern Kubernetes nodes.

02 · Pods and workloads

The Pod is the unit of execution; controllers make that execution durable, repeatable or scheduled.

Pod

The smallest deployable unit in Kubernetes. It groups one or more containers that share an IP address, ports and certain volumes.

Un Pod nginx avec son conteneur web.
Remember :

A Pod is not a machine; its IP and identity can change.

Container

An isolated application process started from an image inside a Pod.

Le Pod web exécute nginx:stable.

Deployment

A control object suited to applications without a stable identity. It manages a ReplicaSet, the replicas and rolling updates.

Un Deployment web avec replicas: 3.

ReplicaSet

A controller that maintains a desired number of Pods matching a label selector. It is generally created by a Deployment.

Le ReplicaSet du Deployment web maintient 3 Pods.

StatefulSet

A controller intended for applications that need a stable network identity and/or storage per replica.

Une base de données distribuée avec des Pods db-0, db-1.
Remember :

A backup is still necessary: a StatefulSet does not automatically protect data.

DaemonSet

A controller that usually places one Pod on each eligible node, notably for technical agents.

Agent de logs ou de supervision sur chaque worker.

Job

An object that runs a task to completion, rather than keeping a server running permanently.

Traitement d’un fichier ou migration ponctuelle.

CronJob

An object that creates Jobs on a schedule in cron format.

Planifier un rapport chaque nuit à 02:00.
Remember :

The time depends on the time zone specified or on the controller's.

Replica

A desired instance of an application: in practice, a replica corresponds to a Pod managed by a controller.

replicas: 3 demande 3 Pods.

Init container / sidecar

An init container prepares the Pod before the application starts; a sidecar accompanies the main container, for example for a proxy or logs.

Init : préparer un fichier ; sidecar : collecter des traces.
Remember :

Their lifecycle and configuration are not identical.

03 · Objects, labels and configuration

You describe what you want to obtain in API resources, often written in YAML.

Kubernetes object / resource

A record in the API representing an intent: Pod, Service, ConfigMap, Deployment, etc.

kubectl get deployments retourne des objets Deployment.

YAML manifest

A declarative text file describing one or more Kubernetes resources, with keys and significant indentation.

kubectl apply -f web.yaml
Remember :

Use spaces, never YAML tabs.

apiVersion / kind

apiVersion identifies the API version for a resource type; kind specifies which type of object it is.

apiVersion: apps/v1 ; kind: Deployment.
Remember :

apiVersion depends on the kind; it is not the cluster's version.

metadata / name

An object's identification block: name, namespace, labels and annotations.

metadata:
  name: web

spec / status

spec describes the state expected by the user; status reflects the state observed by Kubernetes.

spec.replicas: 3 ; status.readyReplicas: 2.
Remember :

Avoid editing status manually.

Namespace

A logical scope that organises many resources and makes access rules and quotas easier; it is not a separate cluster.

Namespace dev et namespace prod.
Remember :

Resources such as Node and PersistentVolume are not namespaced.

Label / selector

A label is a key-value pair attached to an object; a selector filters or links the objects carrying the expected labels.

app: web ; selector.matchLabels.app: web.
Remember :

The consistency of labels determines which Pods a Service targets.

Annotation

A text metadata item for storing context or auxiliary configuration, not mainly meant for selection.

Description, référence de build ou indication d’un contrôleur.

Declarative configuration

An approach where you describe the desired end state and then leave it to Kubernetes to maintain it.

kubectl apply -f deployment.yaml
Remember :

Prefer versioned files for durable resources.

04 · Communication and network exposure

A Pod has an ephemeral IP; a Service provides a stable point of contact for Pods that may be replaced.

Service

An object that offers stable network access to a set of Pods, generally selected by their labels.

Le Service web route le trafic vers les Pods app: web.
Remember :

A Service is not an extra container.

ClusterIP

A Service type reachable via an address internal to the cluster; it is the default type.

L’API appelle http://web:80 à l’intérieur du cluster.

NodePort

A Service type reachable on a TCP/UDP port assigned on each node, in addition to ClusterIP.

http://IP-du-noeud:30080
Remember :

The firewall and the network topology can prevent this access.

LoadBalancer

A Service type that requests a load balancer provided by a cloud or a compatible network integration.

Exposition d’un service par IP externe.
Remember :

On a local cluster, a suitable solution is needed.

Ingress / Ingress controller

Ingress describes HTTP/HTTPS routes by host and path; a controller installed in the cluster applies these rules.

app.exemple.test → Service web.
Remember :

Creating an Ingress alone is not enough; Gateway API is worth studying for new projects.

Gateway API

A more expressive family of APIs for configuring network access, distinct from the controllers that actually implement it.

HTTPRoute associé à une Gateway.
Remember :

Requires a compatible implementation to be installed.

Cluster DNS

Name resolution that lets you find a Service by name, typically via CoreDNS.

web.dev.svc.cluster.local pointe vers le Service web.

NetworkPolicy

A network rule describing which inbound and/or outbound traffic the selected Pods may accept or send.

Limiter les flux vers la base aux Pods de l’API.
Remember :

Requires a network plugin (CNI) that enforces NetworkPolicies.

05 · Storage, security and availability

Orchestration does not excuse you from protecting data, access to the cluster and application health.

Volume / emptyDir

Storage mounted in a Pod; emptyDir is created for a Pod and deleted when that Pod is removed from the node.

Fichiers temporaires partagés entre conteneurs du Pod.
Remember :

emptyDir is not suitable for durable business data.

PersistentVolume (PV)

A storage resource available in the cluster, provided manually or through dynamic provisioning.

Disque associé à une capacité de 10 Gi.

PersistentVolumeClaim (PVC)

A request for storage capacity issued by an application; the PVC is bound to a compatible PV.

Demander 2Gi pour les données d’un Pod.
Remember :

Deleting a PVC can lead to storage loss depending on the reclaim policy.

StorageClass

A profile describing how to request and automatically provision persistent storage depending on the infrastructure.

StorageClass fast pour des volumes rapides.

ConfigMap

An object that stores non-confidential configuration, usable as environment variables or files.

MODE=production
Remember :

Do not put passwords in it.

Secret

An object for sensitive data, injectable into Pods via variables or volumes.

Mot de passe de base de données.
Remember :

Base64 is not encryption; secure RBAC and etcd storage.

ServiceAccount / RBAC

A ServiceAccount is a workload identity; RBAC grants permissions to subjects via Role/ClusterRole and RoleBinding/ClusterRoleBinding.

Autoriser un agent à lire des Pods dans dev.
Remember :

Apply the principle of least privilege.

Request / limit

Request = resources guaranteed for scheduling; limit = usage ceiling, which can cause CPU throttling or a memory kill.

requests.cpu: 100m ; limits.memory: 256Mi.
Remember :

Excess memory use can cause OOMKilled.

Readiness / liveness / startup

Readiness indicates whether the Pod accepts traffic; liveness indicates whether the container should be restarted; startup gives slow starters time.

/ready et /health interrogés par le kubelet.
Remember :

Poor settings = restart loops.

Rolling update / rollback

A rolling update replaces Pods in stages; rollback lets you return to a previous revision of the Deployment.

kubectl rollout undo deployment/web.
Remember :

Check the compatibility of data and migrations.