Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Know the control plane and the nodes
The control plane decides; the worker nodes run the containers.
| Component | Runs on | Job |
|---|---|---|
| kube-apiserver | Control plane | The front door: every request goes through its REST API |
| etcd | Control plane | The database of the whole cluster state |
| kube-scheduler | Control plane | Chooses a node for every new pod |
| kube-controller-manager | Control plane | Loops that fix differences (replicas, nodes, endpoints) |
| cloud-controller-manager | Control plane | Talks to the cloud (load balancers, disks) |
| kubelet | Every node | Starts the pods the API server assigned to this node |
| kube-proxy | Every node | Service networking rules (or replaced by the CNI) |
| Container runtime | Every node | containerd or CRI-O, starts containers |
| CNI plugin | Every node | Pod networking (Calico, Cilium, Flannel …) |
kubectl get nodes -o wide
kubectl get pods -n kube-system
kubectl cluster-info
ls /etc/kubernetes/manifests/
etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yamlOnthoud
In a kubeadm cluster the control-plane parts run as static pods from /etc/kubernetes/manifests/. The kubelet starts them; change the file and the kubelet restarts the pod.
Know the main objects
Everything in Kubernetes is an object with a kind, metadata (name, namespace, labels) and a spec.
| Object | Meaning |
|---|---|
| Pod | One or more containers that share network and storage — the smallest unit |
| Deployment | Keeps N pods of a stateless app, with rolling updates |
| StatefulSet | Pods with fixed names and own storage (databases) |
| DaemonSet | One pod on every node (log agents, CNI) |
| Job / CronJob | Run to completion / on a schedule |
| Service | A stable name and IP in front of pods |
| ConfigMap / Secret | Configuration and sensitive data |
| PersistentVolumeClaim | A request for storage |
| Namespace | A folder for objects, for teams and limits |
Talk to the API with kubectl
kubectl sends requests to the API server, using a kubeconfig file (~/.kube/config) with clusters, users and contexts.
Write objects in YAML
Every object has the same four top fields.
apiVersion: v1
kind: Pod
metadata:
name: web
namespace: shop
labels:
app: web
spec:
containers:
- name: nginx
image: nginx:1.27
ports:
- containerPort: 80kubectl apply -f pod.yaml
kubectl run web --image=nginx:1.27 --dry-run=client -o yaml > pod.yaml
kubectl delete -f pod.yamlExamentip
Never write YAML from zero in the exam. Generate it with --dry-run=client -o yaml, then edit.
Understand labels and selectors
Labels are key/value tags on objects. Selectors find objects by labels — that is how a Service finds its pods and a Deployment its ReplicaSets.