You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Logs
Collecting VCI container logs via TLS
Copy page
Download PDF
Collecting VCI container logs via TLS
VCI supports collecting container logs via Volcano Engine TLS. This topic describes how to collect the standard output logs and file-based logs of VCI containers to TLS.​
Prerequisites​
  • A log project and log topic have been created in TLS. For detailed operations, see Log projects and Log topics.​
  • The log-collector add-on has been installed in the VKE cluster, or a host group with the identifier k8s-vke-${cluster_id} has been created.​
Enabling log collection for VCI​
VCI supports two log collection methods:​
  • Add a Kubernetes pod annotation to enable log collection. You need to redeploy existing VCIs after adding the pod annotation to them.​
  • Enable log collection when creating a workload in the console.​
Using Kubernetes configuration​
When creating pods or workloads (including Deployments, StatefulSets, Jobs, and CronJobs), enable log collection by adding the specified pod annotation.​
The annotation description is as follows.​
​
Annotation Key​
Annotation sample value​
Description​
vci.volcengine.com/tls-enable​
true​
Whether to collect VCI logs to TLS. Valid values:​
  • false: Disable log collection.​
  • true: Enable log collection.​
​
The following sample code shows how to create a Deployment.​
​
apiVersion: apps/v1​
kind: Deployment​
metadata:​
name: nginx-deployment​
spec:​
replicas: 2​
selector:​
matchLabels:​
app: nginx​
template:​
metadata:​
annotations:​
vke.volcengine.com/burst-to-vci: enforce # Force use of VCI​
vci.volcengine.com/tls-enable: "true" # Enable log collection to collect logs to TLS​
labels:​
app: nginx​
spec:​
containers:​
- name: nginx​
image: doc-cn-beijing.cr.volces.com/vke/nginx-demo:v1.0 # The address and version of the application image. Replace it with your own image address and version.​
ports:​
- containerPort: 80​
resources:​
requests: # Specify the vCPU and memory for the container.​
cpu: "500m" ​
memory: "1024Mi"​
limits:​
cpu: "1" ​
memory: "2048Mi"​
​
Using the console​
  1. Create a cluster that uses VCI. For detailed operations, see Creating clusters.​
  1. When creating a workload, in the Basic information step, select Volcengine Container Instance for Computing power type and switch on Log collection to collect VCI logs into TLS.​
Viewing logs​
Log in to the TLS console to query and analyze the collected log data. For a detailed description, see Analysis overview.​
​
Last updated: 2026.08.19 17:57:45