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 Step 1: Enable Managed Service for Prometheus.
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.
Event | Value of the type parameter |
ACK event related to a ConfigMap | cs:k8s:ConfigMapRelatedEvent |
ACK event related to a CRON job | cs:k8s:CronJobRelatedEvent |
ACK event related to a DaemonSet | cs:k8s:DaemonSetRelatedEvent |
ACK event related to a Deployment | cs:k8s:DeploymentRelatedEvent |
ACK event related to an Ingress | cs:k8s:IngressRelatedEvent |
ACK event related to a job | cs:k8s:JobRelatedEvent |
cs:k8s:k8s-event-via-arms | |
ACK event related to a namespace | cs:k8s:NamespaceRelatedEvent |
ACK event related to a node | cs: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 |
cs:k8s:PodRelatedEvent | |
ACK event related to a ReplicaSet | cs:k8s:ReplicaSetRelatedEvent |
ACK event related to a ReplicationController | cs:k8s:ReplicationControllerRelatedEvent |
ACK event related to a StatefulSet | cs:k8s:StatefulSetRelatedEvent |
An operation is performed on a resource | cs:ActionTrail:AliyunServiceEvent |
An API operation is called | cs:ActionTrail:ApiCall |
An operation is performed in the console | cs:ActionTrail:ConsoleOperation |
Notifications indicating that resource change logs are delivered | cs:Config:ConfigurationItemChangeNotification |
Notifications indicating that a resource is evaluated as non-compliant are delivered | cs:Config:NonCompliantNotification |
For more information about the parameters defined in the CloudEvents specification, see Overview.
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.
Parameter | Type | Example | Description |
reason | String | FailedCreatePodSandBox | The reason why the ACK event was reported. |
involvedObject | Struct | The object involved in the event. | |
uid | String | e0a7e4b6-5331-487f-bb0a-e69647a9**** | The unique ID of the resource. |
apiVersion | String | v1 | The version number of the API. |
kind | String | Pod | The type of the resource. |
resourceVersion | String | 40326010 | The version number of the resource. |
namespace | String | kube-system | The namespace in which the resource resides. |
name | String | alicloud-application-controller-798784bf49-v88hc | The name of the resource. |
count | Integer | 1 | The total number of occurrences of the event. |
source | Struct | The resource that detects the event. | |
component | String | kubelet | The type of the event source that the source parameter specifies. |
host | String | cn-hangzhou.192.168.XX.XX | The unique ID of the event source that the source parameter specifies. |
message | String | Failed to create pod sandbox | The description of the event. |
type | String | Warning | The severity of the event. Valid values:
|
firstTimestamp | Timestamp | 2020-11-19T21:04:41Z | The time of the first occurrence of the event. |
lastTimestamp | Timestamp | 2020-11-19T21:04:41Z | The 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.
Parameter | Type | Example | Description |
reason | String | BackOff | The reason why the ACK event related to a pod occurred. |
metadata | Struct | The metadata of the event. | |
uid | String | 0a2d6413-ea4a-414b-a813-aa9b6a17**** | The unique ID of the event in the Kubernetes cluster. |
resourceVersion | Integer | 1163710 | The version number of the event. The version number sequentially increases each time the event is modified. |
creationTimestamp | Timestamp | 2021-01-08T07:11:52Z | The timestamp when the event was created for the first time. |
name | String | oom-test | The name of the event. |
namespace | String | default | The namespace to which the event belongs. |
involvedObject | Struct | The object involved in the event. | |
uid | String | 3438fea9-1e54-4f71-aec5-6e874136**** | The unique ID of the resource. |
apiVersion | String | v1 | The version number of the API. |
kind | String | Pod | The type of the resource. |
resourceVersion | String | 40326010 | The version number of the resource. |
namespace | String | default | The namespace in which the resource resides. |
name | String | oom-test-85b6c9494b-hpllq | The name of the resource. |
reportingInstance | String | N/A | The instance that initiated the event. |
count | Integer | 197 | The total number of occurrences of the event. |
source | Struct | The resource that detects the event. | |
component | String | kubelet | The type of the event source that the source parameter specifies. |
host | String | cn-hangzhou.172.16.XX.XX | The unique ID of the event source that the source parameter specifies. |
message | String | Back-off restarting failed container | The description of the event. |
type | String | Warning | The severity of the event. Valid values:
|
reportingComponent | String | N/A | The component that initiated the event. |
firstTimestamp | Timestamp | 2021-01-08T07:11:52Z | The time of the first occurrence of the event. |
lastTimestamp | Timestamp | 2021-01-08T07:56:41Z | The time of the last occurrence of the event. |
Install the NPD component
Log on to the ACK console.
In the left-side navigation pane, choose .
On the Marketplace page, click the App Catalog tab. In the search box, enter ack-node-problem-detector and click the icon.
Click the ack-node-problem-detector card. On the component details page, click Deploy.
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.