A container packages an application. Kubernetes runs many of them reliably. You describe the state you want, for example "run three copies of this image, reachable on port 443, each with 512 MiB of memory", and Kubernetes keeps working to make the cluster match: it restarts crashed containers, moves work off machines that fail and rolls out new versions gradually.
Core concepts
- Cluster: a control plane plus a set of worker nodes.
- Control plane: the API server, etcd (the key-value store that holds cluster state), the scheduler and the controller manager.
- Node: a machine, physical or virtual, running the kubelet agent and a container runtime.
- Pod: the smallest unit Kubernetes runs; one or more containers that share a network address and storage.
- Deployment: keeps a set number of identical pods running and handles rolling updates and rollbacks. StatefulSets, DaemonSets, Jobs and CronJobs cover stateful apps, one-per-node agents and batch work.
- Service: a stable name and virtual IP that load-balances traffic to a changing set of pods. Ingress and the Gateway API route outside HTTP traffic in.
- Namespace: a logical partition of the cluster, often one per team or environment.
- ConfigMap and Secret: configuration and credentials, kept separate from images.
What Kubernetes automates
- Scheduling pods onto nodes with enough CPU and memory
- Self-healing: restarting failed containers and rescheduling pods from failed nodes
- Horizontal scaling based on CPU, memory or custom metrics
- Rolling updates and rollbacks
- Service discovery and load balancing
- Mounting storage from local disks or cloud volumes
What to monitor in Kubernetes
Kubernetes adds layers, and problems can start in any of them:
- Cluster and nodes: node readiness, CPU, memory and disk pressure, control plane health.
- Workloads: desired vs. available replicas, pods stuck in Pending, restarts, CrashLoopBackOff and OOMKilled containers, failed jobs.
- Containers: CPU throttling and memory use against requests and limits.
- Storage: persistent volume capacity.
- Applications: latency, errors and traces of the services running in the pods.
- Events and logs: Kubernetes events explain why something was killed or not scheduled.
More on this: Kubernetes monitoring tools, kubectl top and Kubernetes logging.
Kubernetes monitoring with Atatus
Kubernetes monitoring installs with one Helm chart as a DaemonSet and covers clusters, nodes, pods, containers, Deployments, StatefulSets, DaemonSets, Jobs, persistent volumes, events and container logs, across multiple clusters. It alerts on restarts, resource use, replica counts and job status, and shows the reason behind a CrashLoopBackOff. APM covers the applications running inside the pods.