Skip to content

Commit cd4cad9

Browse files
authored
Merge pull request #40890 from windsonsea/enventp
Fix tab tags and indentations in switch-to-evented-pleg.md
2 parents 2fc1c0b + fc6d3b6 commit cd4cad9

File tree

1 file changed

+55
-48
lines changed

1 file changed

+55
-48
lines changed
Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Switching From Polling to CRI Event-based Updates to Container Status
2+
title: Switching from Polling to CRI Event-based Updates to Container Status
33
min-kubernetes-server-version: 1.26
44
content_type: task
55
weight: 90
@@ -8,84 +8,91 @@ weight: 90
88
{{< feature-state for_k8s_version="v1.26" state="beta" >}}
99

1010
<!-- overview -->
11+
1112
This page shows how to migrate notes to use event based updates for container status. The event-based
1213
implementation reduces node resource consumption by the kubelet, compared to the legacy approach
1314
that relies on polling.
1415
You may know this feature as _evented Pod lifecycle event generator (PLEG)_. That's the name used
1516
internally within the Kubernetes project for a key implementation detail.
1617

17-
1818
## {{% heading "prerequisites" %}}
1919

2020
* You need to run a version of Kubernetes that provides this feature.
21-
Kubernetes {{< skew currentVersion >}} includes beta support for event-based container
22-
status updates. The feature is beta and is disabled by default.
23-
{{< version-check >}}
24-
If you are running a different version of Kubernetes, check the documentation for that release.
25-
21+
Kubernetes {{< skew currentVersion >}} includes beta support for event-based container
22+
status updates. The feature is beta and is disabled by default.
23+
{{< version-check >}}
24+
If you are running a different version of Kubernetes, check the documentation for that release.
2625

2726
<!-- steps -->
2827

2928
## Why switch to Evented PLEG?
3029

3130
* The current `Generic PLEG` incurs non-negligible overhead due to frequent polling of container statuses.
32-
* This overhead is exacerbated by Kubelet's parallelism, limiting its scalability and causing poor performance and reliability problems.
31+
* This overhead is exacerbated by Kubelet's parallelism, limiting its scalability
32+
and causing poor performance and reliability problems.
3333
* The goal of `Evented PLEG` is to reduce unnecessary work during inactivity by replacing periodic polling.
3434

3535
## Switching to Evented PLEG
3636

37+
1. Start the Kubelet with the [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
38+
`EventedPLEG` enabled. In Kubelet feature gates can be enabled by editing
39+
[config file](/docs/tasks/administer-cluster/kubelet-config-file/) and restarting the Kubelet service.
3740

38-
1. Start the Kubelet with the [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) `EventedPLEG` enabled. In Kubelet feature gates can be enabled by editing [config file](https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/) and restarting the Kubelet service.
41+
2. Please make sure the node is [drained](/docs/tasks/administer-cluster/safely-drain-node/) before proceeding.
3942

40-
2. Please make sure the node is [drained](https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/) before proceeding.
43+
3. Start the `CRI Runtime` with the `Evented PLEG` support.
4144

42-
3. Start the `CRI Runtime` with the `Evented PLEG` support.
43-
{{< tabs name="tab_with_code" >}}
44-
{{< tab name="Containerd" codelang="bash" >}}
45-
Version 1.7+
46-
{{< /tab >}}
47-
{{< tab name="CRI-O" codelang="bash" >}}
48-
Version 1.26+
49-
50-
Check if the CRI-O is already configured to emit `CRI Events` by verifying the configuration,
51-
```
52-
$ crio config | grep enable_pod_events
53-
```
54-
If its enabled it should show,
55-
```
56-
# enable_pod_events = true
57-
```
45+
{{< tabs name="tab_with_code" >}}
5846

59-
To enable it, start the cri-o daemon with the flag `--enable-pod-events=true` or using a drop in config like,
60-
61-
[crio.runtime]
62-
enable_pod_events: true
63-
47+
{{% tab name="containerd" %}}
48+
Version 1.7+
49+
{{% /tab %}}
6450

65-
{{< /tab >}}
66-
{{< /tabs >}}
51+
{{% tab name="CRI-O" %}}
52+
Version 1.26+
6753

54+
Check if the CRI-O is already configured to emit `CRI Events` by verifying the configuration:
6855

69-
{{< version-check >}}
56+
```shell
57+
crio config | grep enable_pod_events
58+
```
7059

71-
4. Verify that `Evented PLEG` is in use by looking for the term `EventedPLEG` in the kubelet logs
60+
If it is enabled it should show:
7261

73-
The output is similar to this:
74-
```
75-
I0314 11:10:13.909915 1105457 feature_gate.go:249] feature gates: &{map[EventedPLEG:true]}
76-
```
62+
```
63+
enable_pod_events = true
64+
```
7765

78-
If you have set LOG_LEVEL to 4 and above, you might see more entries that indicate `Evented PLEG` is in use by the kubelet.
79-
80-
```
81-
I0314 11:12:42.009542 1110177 evented.go:238] "Evented PLEG: Generated pod status from the received event" podUID=3b2c6172-b112-447a-ba96-94e7022912dc
82-
I0314 11:12:44.623326 1110177 evented.go:238] "Evented PLEG: Generated pod status from the received event" podUID=b3fba5ea-a8c5-4b76-8f43-481e17e8ec40
83-
I0314 11:12:44.714564 1110177 evented.go:238] "Evented PLEG: Generated pod status from the received event" podUID=b3fba5ea-a8c5-4b76-8f43-481e17e8ec40
84-
```
66+
To enable it, start the cri-o daemon with the flag `--enable-pod-events=true` or using a drop in config like:
8567

86-
## {{% heading "whatsnext" %}}
68+
```
69+
[crio.runtime]
70+
enable_pod_events: true
71+
```
72+
73+
{{% /tab %}}
74+
{{< /tabs >}}
8775

88-
* Learn more about [KEP 3386](https://github.com/kubernetes/enhancements/blob/5b258a990adabc2ffdc9d84581ea6ed696f7ce6c/keps/sig-node/3386-kubelet-evented-pleg/README.md).
76+
{{< version-check >}}
8977

78+
4. Verify that `Evented PLEG` is in use by looking for the term `EventedPLEG` in the kubelet logs.
9079

80+
The output is similar to this:
81+
82+
```
83+
I0314 11:10:13.909915 1105457 feature_gate.go:249] feature gates: &{map[EventedPLEG:true]}
84+
```
85+
86+
If you have set LOG_LEVEL to 4 and above, you might see more entries that
87+
indicate `Evented PLEG` is in use by the kubelet.
88+
89+
```
90+
I0314 11:12:42.009542 1110177 evented.go:238] "Evented PLEG: Generated pod status from the received event" podUID=3b2c6172-b112-447a-ba96-94e7022912dc
91+
I0314 11:12:44.623326 1110177 evented.go:238] "Evented PLEG: Generated pod status from the received event" podUID=b3fba5ea-a8c5-4b76-8f43-481e17e8ec40
92+
I0314 11:12:44.714564 1110177 evented.go:238] "Evented PLEG: Generated pod status from the received event" podUID=b3fba5ea-a8c5-4b76-8f43-481e17e8ec40
93+
```
94+
95+
## {{% heading "whatsnext" %}}
9196

97+
* Learn more about
98+
[KEP 3386](https://github.com/kubernetes/enhancements/blob/5b258a990adabc2ffdc9d84581ea6ed696f7ce6c/keps/sig-node/3386-kubelet-evented-pleg/README.md).

0 commit comments

Comments
 (0)