This topic describes the Container Service for Kubernetes (ACK) events that can be published to EventBridge.

Usage notes

ACK events are from the following two event sources:

  • Application Real-Time Monitoring Service (ARMS)
    • You must install the ARMS Prometheus component in Kubernetes clusters. For more information, see Enable Prometheus Service.
    • These events are of the cs:k8s:K8s-event-via-arms type and are not classified into specific types.
  • Node Problem Detector (NPD)
    • You must install the ack-node-problem-detector component in Kubernetes clusters and configure EventBridge as a sink. For more information, see Install the NPD component.
    • These events are classified by resource type. For example, events of the cs:k8s:PodRelatedEvent type are events related to pods.

Events

The following table describes the ACK events that can be published to EventBridge.

EventValue of the type parameter
ACK event related to a ConfigMapcs:k8s:ConfigMapRelatedEvent
ACK event related to a CRON jobcs:k8s:CronJobRelatedEvent
ACK event related to a DaemonSetcs:k8s:DaemonSetRelatedEvent
ACK event related to a Deploymentcs:k8s:DeploymentRelatedEvent
ACK event related to an Ingresscs:k8s:IngressRelatedEvent
ACK event related to a jobcs:k8s:JobRelatedEvent
ACK events collected by ARMScs:k8s:k8s-event-via-arms
ACK event related to a namespacecs:k8s:NamespaceRelatedEvent
ACK event related to a nodecs:k8s:NodeRelatedEvent
ACK event related to a persistent volume claim (PVC)cs:k8s:PersistentVolumeClaimRelatedEvent
ACK event related to a persistent volume (PV)cs:k8s:PersistentVolumeRelatedEvent
ACK event related to a podcs:k8s:PodRelatedEvent
ACK event related to a ReplicaSetcs:k8s:ReplicaSetRelatedEvent
ACK event related to a ReplicationControllercs:k8s:ReplicationControllerRelatedEvent
ACK event related to a StatefulSetcs:k8s:StatefulSetRelatedEvent
An operation is performed on a resourcecs:ActionTrail:AliyunServiceEvent
An API operation is calledcs:ActionTrail:ApiCall
An operation is performed in the consolecs:ActionTrail:ConsoleOperation
Notifications indicating that resource change logs are deliveredcs:Config:ConfigurationItemChangeNotification
Notifications indicating that a resource is evaluated as non-compliant are deliveredcs:Config:NonCompliantNotification

For more information about the parameters defined in the CloudEvents specification, see Overview.

Important The preceding table describes only frequent ACK events. You can use a custom rule to match the events that are not described in the preceding table. You can also filter and view all the events.

The types of ACK events are named in the format of cs:k8s:{Resource type name}RelatedEvent. For example, for ACK events related to pods, the value of the type parameter is cs:k8s:PodRelatedEvent.

ACK events collected by ARMS

The following sample code shows an ACK event collected by ARMS and received by EventBridge:

{
    "id":"4cf9678d-dfec-4d6e-9fd1-a9a2d205****",
    "source":"acs.cs",
    "time":"2020-11-19T21:04:41+08:00",
    "data":{
        "reason":"FailedCreatePodSandBox",
        "involvedObject":{
            "uid":"e0a7e4b6-5331-487f-bb0a-e69647a9****",
            "apiVersion":"v1",
            "kind":"Pod",
            "resourceVersion":"40326010",
            "namespace":"kube-system",
            "name":"alicloud-application-controller-798784bf49-v88hc"
        },
        "count":1,
        "source":{
            "component":"kubelet",
            "host":"cn-hangzhou.192.168.XX.XX"
        },
        "message":"Failed to create pod sandbox",
        "type":"Warning",
        "firstTimestamp":"2020-11-19T21:04:41Z",
        "lastTimestamp":"2020-11-19T21:04:41Z"
    },
    "specversion":"1.0",
    "datacontenttype":"application/json",
    "type":"cs:k8s:K8s-event-via-arms",
    "aliyunaccountid":"123456789098****",
    "aliyuneventbusname":"default",
    "aliyunpublishtime":"2020-11-19T21:04:42Z",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

The following table describes the parameters in the data field.

ParameterTypeExampleDescription
reasonStringFailedCreatePodSandBoxThe reason why the ACK event was reported.
involvedObjectStructThe object involved in the event.
uidStringe0a7e4b6-5331-487f-bb0a-e69647a9****The unique ID of the resource.
apiVersionStringv1The version number of the API.
kindStringPodThe type of the resource.
resourceVersionString40326010The version number of the resource.
namespaceStringkube-systemThe namespace in which the resource resides.
nameStringalicloud-application-controller-798784bf49-v88hcThe name of the resource.
countInteger1The total number of occurrences of the event.
sourceStructThe resource that detects the event.
componentStringkubeletThe type of the event source that the source parameter specifies.
hostStringcn-hangzhou.192.168.XX.XXThe unique ID of the event source that the source parameter specifies.
messageStringFailed to create pod sandboxThe description of the event.
typeStringWarningThe severity of the event.
Valid values:
  • Warning
  • Normal
firstTimestampTimestamp2020-11-19T21:04:41ZThe time of the first occurrence of the event.
lastTimestampTimestamp2020-11-19T21:04:41ZThe time of the last occurrence of the event.

ACK event related to a pod

The following sample code shows an ACK event related to a pod and received by EventBridge:

{
    "datacontenttype":"application/json",
    "aliyunaccountid":"123456789098****",
    "data":{
        "reason":"BackOff",
        "metadata":{
            "uid":"0a2d6413-ea4a-414b-a813-aa9b6a17****",
            "resourceVersion":"1163710",
            "creationTimestamp":"2021-01-08T07:11:52Z",
            "name":"oom-test",
            "namespace":"default"
        },
        "involvedObject":{
            "uid":"3438fea9-1e54-4f71-aec5-6e874136****",
            "apiVersion":"v1",
            "kind":"Pod",
            "resourceVersion":"425592514",
            "name":"oom-test-85b",
            "namespace":"default"
        },
        "reportingInstance":"",
        "count":197,
        "source":{
            "component":"kubelet",
            "host":"cn-hangzhou.172.16.XX.XX"
        },
        "message":"Back-off restarting failed container",
        "type":"Warning",
        "reportingComponent":"",
        "firstTimestamp":"2021-01-08T07:11:52Z",
        "lastTimestamp":"2021-01-08T07:56:41Z"
    },
    "subject":"acs:cs:cn-hangzhou:123456789098****:abc/apis/v1/namespaces/default/pods/oom-test-85b",
    "source":"acs.cs",
    "type":"cs:k8s:PodRelatedEvent",
    "aliyunpublishtime":"2021-01-18T09:43:58.785Z",
    "specversion":"1.0",
    "aliyuneventbusname":"default",
    "id":"af182bae-16b8-4327-bb3a-a972de72****",
    "time":"2021-01-08T15:57:00+08:00",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

The following table describes the parameters in the data field.

ParameterTypeExampleDescription
reasonStringBackOffThe reason why the ACK event related to a pod occurred.
metadataStructThe metadata of the event.
uidString0a2d6413-ea4a-414b-a813-aa9b6a17****The unique ID of the event in the Kubernetes cluster.
resourceVersionInteger1163710The version number of the event. The version number sequentially increases each time the event is modified.
creationTimestampTimestamp2021-01-08T07:11:52ZThe timestamp when the event was created for the first time.
nameStringoom-testThe name of the event.
namespaceStringdefaultThe namespace to which the event belongs.
involvedObjectStructThe object involved in the event.
uidString3438fea9-1e54-4f71-aec5-6e874136****The unique ID of the resource.
apiVersionStringv1The version number of the API.
kindStringPodThe type of the resource.
resourceVersionString40326010The version number of the resource.
namespaceStringdefaultThe namespace in which the resource resides.
nameStringoom-test-85b6c9494b-hpllqThe name of the resource.
reportingInstanceStringN/AThe instance that initiated the event.
countInteger197The total number of occurrences of the event.
sourceStructThe resource that detects the event.
componentStringkubeletThe type of the event source that the source parameter specifies.
hostStringcn-hangzhou.172.16.XX.XXThe unique ID of the event source that the source parameter specifies.
messageStringBack-off restarting failed containerThe description of the event.
typeStringWarningThe severity of the event.
Valid values:
  • Warning
  • Normal
reportingComponentStringN/AThe component that initiated the event.
firstTimestampTimestamp2021-01-08T07:11:52ZThe time of the first occurrence of the event.
lastTimestampTimestamp2021-01-08T07:56:41ZThe time of the last occurrence of the event.

Install the NPD component

  1. Log on to the ACK console.
  2. In the left-side navigation pane, choose Marketplace > Marketplace.
  3. On the Marketplace page, click the App Catalog tab. In the search box, enter ack-node-problem-detector and click the search icon.
  4. Click the ack-node-problem-detector card. On the component details page, click Deploy.
  5. In the Deploy panel, configure the parameters and click OK.
    • In the Basic Information step, select a cluster and a namespace, and then click Next.
    • In the Parameters step, change the value of enabled to true for eventbridge in the Sink parameter in the code editor.