Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Logging

Updated on 2024-10-29 GMT+08:00

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.

NOTICE:

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:

  • Container standard output: stderr and stdout logs of a specified container in a cluster
  • Container file logs: file logs in a specified container in a cluster
  • Node file logs: file logs from a specified node path in a cluster
NOTICE:

Only container file logs can be collected for pods scheduled to CCI.

Types of logs that cannot be collected

  • Logs of soft link paths in containers
  • Logs 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 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

  1. Install two add-ons: CCE Cloud Bursting Engine for CCI and Cloud Native Logging.
    1. Log in to the CCE console.
    2. Click the name of the target CCE cluster to go to the cluster console.
    3. In the navigation pane, choose Add-ons.
    4. Select the CCE Cloud Bursting Engine for CCI add-on and click Install.
    5. Enable the Networking option.

    6. On the Add-ons page, select the Cloud Native Logging add-on and click Install.

  2. Create a workload on the CCE console.
    1. In the navigation pane, choose Workloads.
    2. Click Create Workload. For details, see Creating a Workload.
    3. Configure the parameters. For details, see Scheduling Pods to CCI.

  3. Create a log collection policy.
    1. In the navigation pane, choose Logging.
    2. Click View Log Collection Policies. On the displayed page, click Create Log Collection Policy.
    3. 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.

  4. 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

  5. View the reported logs in Logging.

    For details about logging, see Cloud Native Logging.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback