liveBook · Manning

Log

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A log is time-based behavioral data recorded as text to provide information about events or problems in a running system.

Logs are time-based behavioral data recorded as text. For Kubernetes applications, stdout and stderr provide details about activity and failures inside a container; container logs are written on the node under /var/log/containers. section 1.4.5 section 8.1

Use `kubectl logs POD` to inspect a container’s output. In a multi-container pod, specify one with `-c CONTAINER`, or request output from all containers with `--all-containers`. section 8.1.1

Diagnose a failing MySQL pod

When a MySQL pod enters CrashLoopBackOff, `kubectl logs` reveals that no database password option was specified. Add the required environment variable to the Deployment, then check that the pod reaches Running. section 8.1

Figure 8.1 The stdout and stderr container logs are sent to a log file managed by kubelet in /var/log/containers.
figure

Trace how container stdout and stderr become log files on the node. section 8.1

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Traces stdout and stderr to node log files and demonstrates retrieval for one or all pod containers.
Examples
Uses a MySQL CrashLoopBackOff diagnosis and a two-container BusyBox pod to demonstrate log retrieval.
What you can do after
Diagnose pod failures by retrieving container logs with kubectl and identifying error messages.
How it connects
Connects application logs with containers, pods, stdout, stderr, and Kubernetes troubleshooting.

Also explained in

Compare how 14 books explain log →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.