@@ -5,94 +5,104 @@ content_type: task
5
5
weight : 90
6
6
---
7
7
8
- {{< feature-state for_k8s_version="v1.26 " state="beta" >}}
8
+ {{< feature-state for_k8s_version="v1.27 " state="beta" >}}
9
9
10
10
<!-- overview -->
11
11
12
- This page shows how to migrate notes to use event based updates for container status. The event-based
12
+
13
+ This page shows how to migrate nodes to use event based updates for container status. The event-based
13
14
implementation reduces node resource consumption by the kubelet, compared to the legacy approach
14
15
that relies on polling.
15
16
You may know this feature as _ evented Pod lifecycle event generator (PLEG)_ . That's the name used
16
17
internally within the Kubernetes project for a key implementation detail.
17
18
19
+ The polling based approach is referred to as _ generic PLEG_ .
20
+
18
21
## {{% heading "prerequisites" %}}
19
22
20
23
* 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
+ Kubernetes v1.27 includes beta support for event-based container
25
+ status updates. The feature is beta but is _ disabled_ by default
26
+ because it requires support from the container runtime.
27
+ * {{< version-check >}}
24
28
If you are running a different version of Kubernetes, check the documentation for that release.
29
+ * The container runtime in use must support container lifecycle events.
30
+ The kubelet automatically switches back to the legacy generic PLEG
31
+ mechanism if the container runtime does not announce support for
32
+ container lifecycle events, even if you have this feature gate enabled.
25
33
26
34
<!-- steps -->
27
35
28
36
## Why switch to Evented PLEG?
29
37
30
- * The current ` Generic PLEG ` incurs non-negligible overhead due to frequent polling of container statuses.
31
- * This overhead is exacerbated by Kubelet's parallelism, limiting its scalability
32
- and causing poor performance and reliability problems.
33
- * The goal of ` Evented PLEG ` is to reduce unnecessary work during inactivity by replacing periodic polling.
38
+ * The _ Generic PLEG_ incurs non-negligible overhead due to frequent polling of container statuses.
39
+ * This overhead is exacerbated by Kubelet's parallelized polling of container states, thus limiting
40
+ its scalability and causing poor performance and reliability problems.
41
+ * The goal of _ Evented PLEG_ is to reduce unnecessary work during inactivity
42
+ by replacing periodic polling.
34
43
35
44
## Switching to Evented PLEG
36
45
37
46
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.
47
+ ` EventedPLEG ` enabled. You can manage the kubelet feature gates editing the kubelet
48
+ [ config file] ( /docs/tasks/administer-cluster/kubelet-config-file/ ) and restarting the kubelet service.
49
+ You need to do this on each node where you are using this feature.
40
50
41
- 2 . Please make sure the node is [ drained] ( /docs/tasks/administer-cluster/safely-drain-node/ ) before proceeding.
51
+ 2 . Make sure the node is [ drained] ( /docs/tasks/administer-cluster/safely-drain-node/ ) before proceeding.
42
52
43
- 3 . Start the ` CRI Runtime ` with the ` Evented PLEG ` support.
53
+ 3 . Start the container runtime with the container event generation enabled.
44
54
45
55
{{< tabs name="tab_with_code" >}}
46
-
47
- {{% tab name="containerd" %}}
56
+ {{% tab name="Containerd" %}}
48
57
Version 1.7+
49
58
{{% /tab %}}
50
-
51
59
{{% tab name="CRI-O" %}}
52
60
Version 1.26+
53
61
54
- Check if the CRI-O is already configured to emit ` CRI Events ` by verifying the configuration:
62
+ Check if the CRI-O is already configured to emit CRI events by verifying the configuration,
55
63
56
64
``` shell
57
65
crio config | grep enable_pod_events
58
66
```
59
67
60
- If it is enabled it should show :
68
+ If it is enabled, the output should be similar to the following :
61
69
62
- ```
70
+ ``` none
63
71
enable_pod_events = true
64
72
```
65
73
66
- To enable it, start the cri-o daemon with the flag ` --enable-pod-events=true ` or using a drop in config like:
74
+ To enable it, start the CRI-O daemon with the flag ` --enable-pod-events=true ` or
75
+ use a dropin config with the following lines:
67
76
68
- ```
77
+ ``` toml
69
78
[crio .runtime ]
70
79
enable_pod_events: true
71
80
```
72
-
73
81
{{% /tab %}}
74
82
{{< /tabs >}}
75
83
76
84
{{< version-check >}}
77
85
78
- 4 . Verify that ` Evented PLEG ` is in use by looking for the term ` EventedPLEG ` in the kubelet logs.
86
+ 4 . Verify that the kubelet is using event-based container stage change monitoring.
87
+ To check, look for the term ` EventedPLEG ` in the kubelet logs.
79
88
80
- The output is similar to this:
89
+ The output should be similar to this:
81
90
82
- ```
91
+ ``` console
83
92
I0314 11:10:13.909915 1105457 feature_gate.go:249] feature gates: &{map[EventedPLEG:true]}
84
93
```
85
94
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 .
95
+ If you have set ` --v ` to 4 and above, you might see more entries that indicate
96
+ that the kubelet is using event-based container state monitoring .
88
97
89
- ```
98
+ ``` console
90
99
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
100
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
101
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
102
```
94
103
95
104
## {{% heading "whatsnext" %}}
96
105
97
- * Learn more about
98
- [ KEP 3386] ( http://github.com/kubernetes/enhancements/blob/5b258a990adabc2ffdc9d84581ea6ed696f7ce6c/keps/sig-node/3386-kubelet-evented-pleg/README.md ) .
106
+ * Learn more about the design in the Kubernetes Enhancement Proposal (KEP):
107
+ [ Kubelet Evented PLEG for Better Performance] ( http://github.com/kubernetes/enhancements/blob/5b258a990adabc2ffdc9d84581ea6ed696f7ce6c/keps/sig-node/3386-kubelet-evented-pleg/README.md ) .
108
+
0 commit comments