Updated on 2024-11-12 GMT+08:00

Collecting Kubernetes Events

Billing

LTS does not charge you for creating log groups and offers a free quota for log collection every month. You pay only for log volume that exceeds the quota.

Reporting Kubernetes Events to LTS

Cloud Native Logging is not installed in a cluster.

During add-on installation, you can select Kubernetes events to create a default log collection policy, so that this add-on collects all events and reports them to LTS. For details about the add-on installation, see Collecting Data Plane Logs.

Cloud Native Logging has been installed in a cluster.

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. Click View Log Collection Policies in the upper right corner. All log policies reported to LTS in the current cluster are displayed.
  3. Click Create Log Policy and configure parameters as required.

    Policy Template: If Kubernetes events is not selected during add-on installation or the log collection policy is deleted, you can use this option to create a default log collection policy.

  4. On the logging management page, select the log stream configured in the log collection policy to view the events reported to LTS.

Reporting Kubernetes Events to AOM

For Huawei Cloud clusters v1.19.16, v1.21.11, v1.23.9, or v1.25.4, after Cloud Native Logging is installed, all warning events and some normal events are reported to AOM by default. The reported events can be used to configure alarms. For details about the add-on installation, see Collecting Data Plane Logs.

You can enable or disable this function when installing the add-on for an on-premises cluster.

Custom Event Reporting

If the reported events cannot meet requirements, you can modify the settings for the events.

  1. Run the following command on the cluster to modify the event collection settings:

    kubectl edit logconfig -n kube-system default-event-aom

  2. Modify the event collection settings as required.

    apiVersion: logging.openvessel.io/v1
    kind: LogConfig
    metadata:
      annotations:
        helm.sh/resource-policy: keep
      name: default-event-aom
      namespace: kube-system
    spec:
      inputDetail:    # Settings on UCS from which events are collected
        type: event    # Type of logs to be collected. Do not change the value.
        event:
          normalEvents:    # Used to configure normal events
            enable: true    # Whether to enable normal event collection
            includeNames:    # Names of events to be collected. If this parameter is not specified, all events will be collected.
            - NotTriggerScaleUp
            excludeNames:    # Names of events that are not collected. If this parameter is not specified, all events will be collected.
            - NotTriggerScaleUp
          warningEvents:    # Used to configure warning events
            enable: true    # Whether to enable warning event collection
            includeNames:    # Names of events to be collected. If this parameter is not specified, all events will be collected.
            - NotTriggerScaleUp
            excludeNames:    # Names of events that are not collected. If this parameter is not specified, all events will be collected.
            - NotTriggerScaleUp
      outputDetail:
        type: AOM    # Type of the system that receives the events. Do not change the value.
        AOM:
          events:
          - name: DeleteNodeWithNoServer    # Event name. This parameter is mandatory.
            resourceType: Namespace    # Type of the resource that operations are performed on.
            severity: Major    # Event severity after an event is reported to AOM, which can be Critical, Major, Minor, or Info. The default value is Major.