Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Latest commit

 

History

History
52 lines (37 loc) · 1.95 KB

debug-agent.md

File metadata and controls

52 lines (37 loc) · 1.95 KB

Get Clear Containers Agent debug logs

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:

  1. Enable proxy debug

    Set the enable_debug= option in the [proxy.cc] section to true, 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
    
  2. Run a container to generate the logs:

    $ sudo docker run -ti busybox true
    
  3. Filter the agent debug logs from the cc-proxy logs

    The cc-proxy logs show the sources of its collated information. To only see the agent debug logs, filter cc-proxy logs by the QEMU serial console that sent the agent logs. The QEMU serial console is represented by source=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\>'