Docker & Kubernetes · Module 08
Kubernetes – API Objects, Namespaces and Pods
Read and write manifests, split a cluster with namespaces, create and debug pods, select objects with labels, set requests/limits and use init containers.
What you will learn
- Recognise apiVersion, kind, metadata, spec, status and look up schemas with kubectl explain
- Work with namespaces and understand their scope
- Create pods, configure probes and debug with describe, logs and exec
- Add labels, filter with selectors and set nodeSelector
- Set resource requests/limits and use init containers
Lessons
- The Kubernetes API and object model
Everything in Kubernetes is an API object; a manifest declares desired state with apiVersion, kind, metadata and spec.
- Namespaces
Namespaces split one cluster into logical areas to separate environments, set quotas and assign permissions.
- Pods — spec, probes and debugging
A pod is the smallest unit; declare containers and probes, then debug with describe, logs, exec and port-forward.
- Labels and selectors
Labels are key=value pairs that group objects; selectors use labels to pick objects, from kubectl to Services and Deployments.
- Resource requests/limits and init containers
A request is the guaranteed share used for scheduling; a limit is the ceiling; init containers finish before the main containers start.