@@ -4,44 +4,49 @@ Clear Containers runtime launch a special virtual machine when a new pod is
44created. This VM uses a VM-agent to spawn processes on behalf of the
55pod/container(s) running inside the VM.
66
7- From Clear Containers 3.0-beta release a new agent is used ,
8- [ Clear Containers Agent ] ( https://github.com/clearcontainers/agent ) :
7+ The Clear Containers 3.0-beta release uses a new agent ( ` cc-agent ` ) ,
8+ https://github.com/clearcontainers/agent .
99
10- The Clear Containers Agent relies heavily on libcontainer used by runc
11- (standard program when running containers on bare metal).
10+ The Clear Containers agent relies heavily on [ ` libcontainer ` ] ( https://github.com/opencontainers/runc/tree/master/libcontainer )
11+ used by [ ` runc ` ] ( https://github.com/opencontainers/runc/ ) , which is the
12+ standard program when running containers on bare metal.
1213
1314To provide a debug log of any agent activity on a guest, the Clear Containers
14- agent sends logs through a QEMU serial console that are collected by [ cc-proxy] ( https://github.com/clearcontainers/proxy )
15- and shown in its logs. By default, the Clear Containers agent logs are not collected by
16- ` cc-proxy ` but can be enabled by adding the ` -log debug ` option to ` cc-proxy ` .
17-
18- 1- Add the ` -log debug ` option to ` cc-proxy `
19-
20- ```
21- mkdir -p /etc/systemd/system/cc-proxy.service.d/
22- cat << EOT > /etc/systemd/system/cc-proxy.service.d/proxy-debug.conf
23- [Service]
24- ExecStart=
25- ExecStart=/usr/libexec/clear-containers/cc-proxy -log debug
26- EOT
27- # Restart cc-proxy to provide debug logs.
28- systemctl daemon-reload
29- systemctl restart cc-proxy
30- ```
31- 2- Run a container to generate the agent debug logs
32-
33- ```
34- sudo docker run -ti busybox true
35- ```
36- 3- Filter the agent debug logs from the ` cc-proxy ` logs
37- The ` cc-proxy ` logs show the sources of its collated information. To only see
38- the agent debug logs, filter ` cc-proxy ` logs by the QEMU serial console (the
39- agent logs were sent through it). The QEMU serial console is represented by
40- ` source=qemu ` .
41-
42- ```
43- journalctl -u cc-proxy | grep source=qemu
44- ```
45-
46- The debug log format is:
47- DEBU[ 0019] * AGENT MESSAGE* source=qemu vm=* CONTAINER_ID*
15+ agent sends log data through a QEMU serial console, which is collected by
16+ [ cc-proxy] ( https://github.com/clearcontainers/proxy ) and shown in the proxy's
17+ logs.
18+
19+ By default, the Clear Containers agent logs are not collected by ` cc-proxy `
20+ but can be enabled by enabling the proxy debug option:
21+
22+ 1 . Enable proxy debug
23+
24+ Set the ` enable_debug= ` option in the ` [proxy.cc] ` section to ` true ` , which
25+ assumes a standard configuration file path:
26+
27+ ```
28+ $ 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
29+ ```
30+
31+ 1 . Run a container to generate the logs:
32+
33+ ```
34+ $ sudo docker run -ti busybox true
35+ ```
36+
37+ 1 . Filter the agent debug logs from the ` cc-proxy ` logs
38+
39+ The ` cc-proxy ` logs show the sources of its collated information. To only
40+ see the agent debug logs, filter ` cc-proxy ` logs by the QEMU serial console
41+ that sent the agent logs. The QEMU serial console is represented by
42+ ` source=qemu ` .
43+
44+ ```
45+ $ sudo journalctl -t cc-proxy | grep source=qemu | egrep '\<cc-agent\>'
46+ ```
47+
48+ To extract all logs entries for a particular container:
49+
50+ ```
51+ $ sudo sudo journalctl -t cc-proxy | grep source=qemu | grep vm=CONTAINER_ID | egrep '\<cc-agent\>'
52+ ```
0 commit comments