Clear Containers runtime launch a special virtual machine when a new pod is created. This VM uses a VM-agent to spawn processes on behalf of the pod/container(s) running inside the VM.
The Clear Containers 3.0-beta release uses a new agent (cc-agent
),
https://github.com/clearcontainers/agent.
The Clear Containers agent relies heavily on libcontainer
used by runc
, which is the
standard program when running containers on bare metal.
To provide a debug log of any agent activity on a guest, the Clear Containers agent sends log data through a QEMU serial console, which is collected by cc-proxy and shown in the proxy's logs.
By default, the Clear Containers agent logs are not collected by cc-proxy
but can be enabled by enabling the proxy debug option:
-
Enable proxy debug
Set the
enable_debug=
option in the[proxy.cc]
section totrue
, which assumes a standard configuration file path:$ sudo awk '{if (/^\[proxy\.cc\]/) {got=1}; if (got == 1 && /^#enable_debug/) {print "enable_debug = true"; got=0; next; } else {print}}' /usr/share/defaults/clear-containers/configuration.toml
-
Run a container to generate the logs:
$ sudo docker run -ti busybox true
-
Filter the agent debug logs from the
cc-proxy
logsThe
cc-proxy
logs show the sources of its collated information. To only see the agent debug logs, filtercc-proxy
logs by the QEMU serial console that sent the agent logs. The QEMU serial console is represented bysource=qemu
.$ sudo journalctl -t cc-proxy | grep source=qemu | egrep '\<cc-agent\>'
To extract all logs entries for a particular container:
$ sudo sudo journalctl -t cc-proxy | grep source=qemu | grep vm=CONTAINER_ID | egrep '\<cc-agent\>'