Skip to content

Commit ba23560

Browse files
authored
Merge pull request #39296 from palonsoro/bz2027332-kubelet-loglevel
Bug 2027332: Fixes for "Modifying the kubelet as a one-time scenario" section
2 parents 44f75ad + 1547252 commit ba23560

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

modules/modifying-kubelet-as-one-time-scenario.adoc

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ $ oc debug node/<node>
1717
----
1818
$ chroot /host
1919
----
20+
+
21+
Alternatively, it is possible to SSH to the node and become root.
2022

21-
. After access is established, check the content:
23+
. After access is established, check the default log level:
2224
+
2325
[source,terminal]
2426
----
@@ -28,25 +30,19 @@ $ systemctl cat kubelet
2830
.Example output
2931
[source,terminal]
3032
----
31-
# /etc/systemd/system/kubelet.service
32-
mode: 0644
33-
path: "/etc/systemd/system/kubelet.service.d/20-logging.conf"
34-
contents:
35-
inline: |
36-
[Service]
37-
Environment="KUBELET_LOG_LEVEL=2"
33+
# /etc/systemd/system/kubelet.service.d/20-logging.conf
34+
[Service]
35+
Environment="KUBELET_LOG_LEVEL=2"
3836
----
3937

40-
. Define the new verbosity required in the `/etc/systemd/system/kubelet.service.d/20-logging.conf` file. In this example, the verbosity is changed from `v=1` to `v=8`:
38+
. Define the new verbosity required in a new `/etc/systemd/system/kubelet.service.d/30-logging.conf` file, which overrides `/etc/systemd/system/kubelet.service.d/20-logging.conf`. In this example, the verbosity is changed from `2` to `8`:
4139
+
4240
[source,terminal]
4341
----
44-
$ vi -i -e 's/--v=1/--v=8/g' /etc/systemd/system/kubelet.service.d/20-logging.conf
42+
$ echo -e "[Service]\nEnvironment=\"KUBELET_LOG_LEVEL=8\"" > /etc/systemd/system/kubelet.service.d/30-logging.conf
4543
----
46-
+
47-
Editing the config file or installing a new `logging.conf` file overrides the log level.
4844

49-
. Restart the service:
45+
. Reload systemd and restart the service:
5046
+
5147
[source,terminal]
5248
----
@@ -58,9 +54,20 @@ $ systemctl daemon-reload
5854
$ systemctl restart kubelet
5955
----
6056

61-
. Gather the logs, then edit the kubelet log level to revert to the former value to prevent issues, such as this error:
57+
. Gather the logs, and then revert the log level increase:
58+
+
59+
[source,terminal]
60+
----
61+
$ rm -f /etc/systemd/system/kubelet.service.d/30-logging.conf
62+
----
63+
+
64+
[source,terminal]
65+
----
66+
$ systemctl daemon-reload
67+
----
6268
+
6369
[source,terminal]
6470
----
65-
E0514 12:47:17.998892 2281 daemon.go:1350] content mismatch for file /etc/systemd/system/kubelet.service: [Unit]
71+
$ systemctl restart kubelet
6672
----
73+

0 commit comments

Comments
 (0)