- Documentation
Volcengine Kubernetes Engine
Volcengine Container Instance
User guide
Logs
Collecting VCI container logs via a sidecar
Logs
Collecting VCI container logs via a sidecar
Collecting VCI container logs via a sidecar
VCI supports collecting container logs by using a sidecar. This topic describes how to deploy a container log collection Agent using the sidecar method to collect standard output logs and file logs of containers on VCI.
Prerequisites
- A log project and log topic have been created in TLS. For detailed operations, see Log projects and Log topics.
- Log collection configuration has been created in TLS and associated with the host group created above. For detailed instructions, see Collecting container logs.
Procedure
This topic uses LogCollector, the log collection add-on provided by Volcano Engine TLS, as an example sidecar container. If you have your own log collection add-on, you can configure the Sidecar container yourself.
For details on configurable annotations for collecting container logs using the Sidecar method, see Pod annotations. - Create a configuration file for the sidecar container. The following logcollector-config.yaml file provides an example:
Warning
Replace the placeholder variables (${placeholder}) with your actual information based on the parameter table below and the comments in the YAML file.
- Parameter descriptions are as follows:
- Run the following command to create the configuration file for the sidecar container.
- Create a YAML manifest for a VCI pod that contains the sidecar container.
- The following are two YAML examples:
warning
Replace the parameter values with your actual information according to the comments in the YAML file.
- When creating the VCI pod, mount csi-driver and collect the standard output logs of the application container using the sidecar. The following sidecar-vci-pod-demo.yaml file provides an example:
- When creating the VCI pod, mount empty-dir and collect the file logs of the application container using the sidecar. The following sidecar-vci-pod-demo.yaml file provides an example:
- Execute the following command to create the VCI pod.
- Query pod information to verify whether the pod was created successfully.
- The expected response is as follows:
Last updated: 2026.08.19 17:57:59