Logging
Overview
After workloads are scheduled to CCI, you can use the Cloud Native Logging add-on to collect pod logs, improving workload observability. This section describes how to enable logging for the workloads scheduled to CCI.
Constraints
Application Scenario |
How to Use |
---|---|
CCE and CCI container logs need to be collected. |
You can collect the following three types of logs:
NOTICE:
Only container file logs can be collected for pods scheduled to CCI. |
A pod has multiple types of storage directories mounted. |
Logs cannot be collected from specified directories such as the system, device, cgroup, and tmpfs directories. |
A pod scheduled to CCI has multiple log collection policies associated. |
To better collect logs, reserve the required amount of memory for the pod. Associate the pod with the first log collection policy and reserve at least 50 MB of memory. Reserve 5 MB of memory each time an additional log collection policy is associated. |
Ultra-long logs need to be collected. |
A log larger than 250 KB cannot be collected. |
The log file name is too long. |
|
Logging rate |
For each pod, no more than 10,000 single-line logs can be collected per second, and no more than 2,000 multiple-line logs can be collected per second. |
Maximum number of collected files |
On a single node, the logs of a maximum of 4,095 files can be collected by all log collection policies. |
Procedure
- Install two add-ons: CCE Cloud Bursting Engine for CCI and Cloud Native Logging.
- Log in to the CCE console.
- Click the name of the target CCE cluster to go to the cluster console.
- In the navigation pane on the left, choose Add-ons.
- Select the CCE Cloud Bursting Engine for CCI add-on and click Install.
- Select the Networking option.
- On the Add-ons page, select the Cloud Native Logging add-on and click Install.
- Create a workload on the CCE console.
- In the navigation pane on the left, choose Workloads.
- Click Create Workload. For details, see Creating a Workload.
- Configure the parameters. For details, see Scheduling Pods to CCI.
- Create a log collection policy.
- In the navigation pane on the left, choose Logging.
- Click View Log Collection Policies. On the displayed page, click Create Log Collection Policy.
- Configure the parameters and click OK.
Workloads scheduled to CCI do not support hot update of log policies. After a log collection policy is updated, redeploy the pods to apply the modification.
- View the YAML file of the pod that is scheduled to CCI.
To collect CCI pod logs, the cloud native logging add-on injects the following annotations to the pod.
Annotation
Example Value
coordinator.cci.io/inject-volumes
'[{"name":"log-agent-conf","configMap":{"name":"log-agent-cci-logging-config","defaultMode":384},"namespace":"monitoring"},{"name":"log-agent-cert","secret":{"secretName":"log-agent-ca-secret","defaultMode":384},"namespace":"monitoring"}]'
logconf.k8s.io/fluent-bit-configmap-reference
monitoring-log-agent-cci-logging-config
logconfigs.logging.openvessel.io
'{"testcci001":{"container_files":{"container-1":"/var/test/*/*.log"},"regulation":""}}''
sandbox-volume.openvessel.io/volume-names
log-agent-conf,log-agent-cert
- View the reported logs in Logging.
For details about logging, see Cloud Native Logging.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot