- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
- User Guide
- Best Practices
-
Developer Guide
- Overview
- Using Native kubectl (Recommended)
- Namespace and Network
- Pod
- Label
- Deployment
- EIPPool
- EIP
- Pod Resource Monitoring Metric
- Collecting Pod Logs
- Managing Network Access Through Service and Ingress
- Using PersistentVolumeClaim to Apply for Persistent Storage
- ConfigMap and Secret
- Creating a Workload Using Job and Cron Job
- YAML Syntax
-
API Reference
- Before You Start
- Calling APIs
- Getting Started
- Proprietary APIs
-
Kubernetes APIs
- ConfigMap
- Pod
- StorageClass
- Service
-
Deployment
- Querying All Deployments
- Deleting All Deployments in a Namespace
- Querying Deployments in a Namespace
- Creating a Deployment
- Deleting a Deployment
- Querying a Deployment
- Updating a Deployment
- Replacing a Deployment
- Querying the Scaling Operation of a Specified Deployment
- Updating the Scaling Operation of a Specified Deployment
- Replacing the Scaling Operation of a Specified Deployment
- Querying the Status of a Deployment
- Ingress
- OpenAPIv2
- VolcanoJob
- Namespace
- ClusterRole
- Secret
- Endpoint
- ResourceQuota
- CronJob
-
API groups
- Querying API Versions
- Querying All APIs of v1
- Querying an APIGroupList
- Querying APIGroup (/apis/apps)
- Querying APIs of apps/v1
- Querying an APIGroup (/apis/batch)
- Querying an APIGroup (/apis/batch.volcano.sh)
- Querying All APIs of batch.volcano.sh/v1alpha1
- Querying All APIs of batch/v1
- Querying All APIs of batch/v1beta1
- Querying an APIGroup (/apis/crd.yangtse.cni)
- Querying All APIs of crd.yangtse.cni/v1
- Querying an APIGroup (/apis/extensions)
- Querying All APIs of extensions/v1beta1
- Querying an APIGroup (/apis/metrics.k8s.io)
- Querying All APIs of metrics.k8s.io/v1beta1
- Querying an APIGroup (/apis/networking.cci.io)
- Querying All APIs of networking.cci.io/v1beta1
- Querying an APIGroup (/apis/rbac.authorization.k8s.io)
- Querying All APIs of rbac.authorization.k8s.io/v1
- Event
- PersistentVolumeClaim
- RoleBinding
- StatefulSet
- Job
- ReplicaSet
- Data Structure
- Permissions Policies and Supported Actions
- Appendix
- Out-of-Date APIs
- Change History
-
FAQs
- Product Consulting
-
Basic Concept FAQs
- What Is CCI?
- What Are the Differences Between Cloud Container Instance and Cloud Container Engine?
- What Is an Environment Variable?
- What Is a Service?
- What Is Mcore?
- What Are the Relationships Between Images, Containers, and Workloads?
- What Are Kata Containers?
- Can kubectl Be Used to Manage Container Instances?
- What Are Core-Hours in CCI Resource Packages?
- Workload Abnormalities
-
Container Workload FAQs
- Why Service Performance Does Not Meet the Expectation?
- How Do I Set the Quantity of Instances (Pods)?
- How Do I Check My Resource Quotas?
- How Do I Set Probes for a Workload?
- How Do I Configure an Auto Scaling Policy?
- What Do I Do If the Workload Created from the sample Image Fails to Run?
- How Do I View Pods After I Call the API to Delete a Deployment?
- Why an Error Is Reported When a GPU-Related Operation Is Performed on the Container Entered by Using exec?
- Can I Start a Container in Privileged Mode When Running the systemctl Command in a Container in a CCI Cluster?
- Why Does the Intel oneAPI Toolkit Fail to Run VASP Tasks Occasionally?
- Why Are Pods Evicted?
- Why Is the Workload Web-Terminal Not Displayed on the Console?
- Why Are Fees Continuously Deducted After I Delete a Workload?
-
Image Repository FAQs
- Can I Export Public Images?
- How Do I Create a Container Image?
- How Do I Upload Images?
- Does CCI Provide Base Container Images for Download?
- Does CCI Administrator Have the Permission to Upload Image Packages?
- What Permissions Are Required for Uploading Image Packages for CCI?
- What Do I Do If Authentication Is Required During Image Push?
-
Network Management FAQs
- How Do I View the VPC CIDR Block?
- Does CCI Support Load Balancing?
- How Do I Configure the DNS Service on CCI?
- Does CCI Support InfiniBand (IB) Networks?
- How Do I Access a Container from a Public Network?
- How Do I Access a Public Network from a Container?
- What Do I Do If Access to a Workload from a Public Network Fails?
- What Do I Do If Error 504 Is Reported When I Access a Workload?
- What Do I Do If the Connection Timed Out?
- Storage Management FAQs
- Log Collection
- Account
- SDK Reference
- Videos
- General Reference
Show all
Copied.
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.
By default, for workloads scaled to CCI, container stdout logs will be collected and reported to AOM. AOM provides 500-MB free log storage space for each account each month. If the log storage space exceeds 500 MB, you will be billed based on the actual usage. For details about pricing, see Product Pricing Details.
To disable container stdout log collection, specify log.stdoutcollection.kubernetes.io: '{"collectionContainers": []}' in the pod annotation. The following is an example:
kind: Deployment apiVersion: apps/v1 metadata: name: test namespace: default spec: replicas: 1 template: metadata: annotations: log.stdoutcollection.kubernetes.io: '{"collectionContainers": []}' spec: containers: - name: container-1 image: nginx:latest
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. |
Types of logs that cannot be collected |
|
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 MiB of memory. Reserve 5 MiB 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. |
Log file name |
By default, the audit.log, oss.icAgent.trace, oss.script.trace, and audit_*.log files are not collected. Do not use these names for the logs. |
The log file name is too long. |
In a container, if a log name exceeds 190 characters, the log will not be collected. If there are logs whose name contains 180 to 190 characters, only the first log can be collected. |
Log collection 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 |
In a single pod, no more than 2,000 log files can be collected by all log collection policies. |
Log collection before a container is stopped |
When a container is stopped, if log collection is delayed due to network latency or high resource usage, some logs generated before the container is stopped may be lost. |
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, choose Add-ons.
- Select the CCE Cloud Bursting Engine for CCI add-on and click Install.
- Enable 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, 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, choose Logging.
- Click View Log Collection Policies. On the displayed page, click Create Log Collection Policy.
- Configure the parameters and click OK.
NOTE:
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