|
6 | 6 | [id="sandboxed-containers-enable-debug-logs_{context}"]
|
7 | 7 | = Enabling debug logs for {sandboxed-containers-first}
|
8 | 8 |
|
9 |
| -As a cluster administrator, you can collect a more detailed level of logs for {sandboxed-containers-first}. Enhance logging by changing the `log_level` in the CRI-O runtime for the worker nodes running {sandboxed-containers-first}. |
| 9 | +As a cluster administrator, you can collect a more detailed level of logs for {sandboxed-containers-first}. You can also enhance logging by changing the `logLevel` field in the `KataConfig` CR. This changes the `log_level` in the CRI-O runtime for the worker nodes running {sandboxed-containers-first}. |
10 | 10 |
|
11 | 11 | .Procedure
|
12 | 12 |
|
13 |
| -. Create a YAML file for the `ContainerRuntimeConfig` CR with the following manifest: |
14 |
| -+ |
15 |
| -[source,yaml] |
16 |
| ----- |
17 |
| -apiVersion: machineconfiguration.openshift.io/v1 |
18 |
| -kind: ContainerRuntimeConfig |
19 |
| -metadata: |
20 |
| - name: crio-debug |
21 |
| -spec: |
22 |
| - machineConfigPoolSelector: |
23 |
| - matchLabels: |
24 |
| - pools.operator.machineconfiguration.openshift.io/worker: '' <1> |
25 |
| - containerRuntimeConfig: |
26 |
| - logLevel: debug |
27 |
| ----- |
28 |
| -<1> Specify a label for the machine config pool that you want you want to modify. |
| 13 | +. Change the `logLevel` field in your existing `KataConfig` CR to `debug`: |
29 | 14 |
|
30 |
| -. Create the `ContainerRuntimeConfig` CR: |
31 |
| -+ |
32 | 15 | [source,terminal]
|
33 | 16 | ----
|
34 |
| -$ oc create -f ctrcfg.yaml |
| 17 | +$ oc patch kataconfig <name_of_kataconfig_file> --type merge --patch '{"spec":{"logLevel":"debug"}}' |
35 | 18 | ----
|
36 | 19 |
|
37 |
| -+ |
38 | 20 | [NOTE]
|
39 | 21 | ====
|
40 |
| -The file name listed above is a suggestion. You can create this file using another name. |
| 22 | +When running this command, reference the name of your `KataConfig` CR. This is the name you used to create the CR when setting up {sandboxed-containers-first}. |
41 | 23 | ====
|
42 | 24 |
|
43 |
| -. Verify the CR is created: |
44 |
| -+ |
45 |
| -[source,terminal] |
46 |
| ----- |
47 |
| -$ oc get ctrcfg |
48 |
| ----- |
49 |
| -+ |
50 |
| -.Example output |
51 |
| -[source,terminal] |
52 |
| ----- |
53 |
| -NAME AGE |
54 |
| -crio-debug 3m19s |
55 |
| ----- |
56 |
| - |
57 | 25 | .Verification
|
58 | 26 |
|
59 |
| -. Monitor the machine config pool until the `UPDATED` field for all worker nodes appears as `True`: |
| 27 | +. Monitor the `kata-oc` machine config pool until the `UPDATED` field appears as `True`, meaning all worker nodes are updated: |
60 | 28 | +
|
61 | 29 | [source,terminal]
|
62 | 30 | ----
|
63 |
| -$ oc get mcp worker |
| 31 | +$ oc get mcp kata-oc |
64 | 32 | ----
|
65 | 33 | +
|
66 | 34 | .Example output
|
67 | 35 | [source,terminal]
|
68 | 36 | ----
|
69 |
| -NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE |
70 |
| -worker rendered-worker-169 False True False 3 1 1 0 9h |
| 37 | +NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE |
| 38 | +kata-oc rendered-kata-oc-169 False True False 3 1 1 0 9h |
71 | 39 | ----
|
72 | 40 |
|
73 | 41 | . Verify that the `log_level` was updated in CRI-O:
|
|
0 commit comments