This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 7. Collecting OpenShift sandboxed containers data
When troubleshooting OpenShift sandboxed containers, you can open a support case and provide debugging information using the must-gather tool.
If you are a cluster administrator, you can also review logs on your own, enabling a more detailed level of logs.
7.1. Collecting OpenShift sandboxed containers data for Red Hat Support Copier lienLien copié sur presse-papiers!
When opening a support case, it is helpful to provide debugging information about your cluster to Red Hat Support.
The must-gather tool enables you to collect diagnostic information about your OpenShift Container Platform cluster, including virtual machines and other data related to OpenShift sandboxed containers.
For prompt support, supply diagnostic information for both OpenShift Container Platform and OpenShift sandboxed containers.
7.1.1. About the must-gather tool Copier lienLien copié sur presse-papiers!
The oc adm must-gather CLI command collects the information from your cluster that is most likely needed for debugging issues, including:
- Resource definitions
- Service logs
By default, the oc adm must-gather command uses the default plugin image and writes into ./must-gather.local.
Alternatively, you can collect specific information by running the command with the appropriate arguments as described in the following sections:
To collect data related to one or more specific features, use the
--imageargument with an image, as listed in a following section.For example:
oc adm must-gather --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v4.10.0
$ oc adm must-gather --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v4.10.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow To collect the audit logs, use the
-- /usr/bin/gather_audit_logsargument, as described in a following section.For example:
oc adm must-gather -- /usr/bin/gather_audit_logs
$ oc adm must-gather -- /usr/bin/gather_audit_logsCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteAudit logs are not collected as part of the default set of information to reduce the size of the files.
When you run oc adm must-gather, a new pod with a random name is created in a new project on the cluster. The data is collected on that pod and saved in a new directory that starts with must-gather.local. This directory is created in the current working directory.
For example:
NAMESPACE NAME READY STATUS RESTARTS AGE ... openshift-must-gather-5drcj must-gather-bklx4 2/2 Running 0 72s openshift-must-gather-5drcj must-gather-s8sdh 2/2 Running 0 72s ...
NAMESPACE NAME READY STATUS RESTARTS AGE
...
openshift-must-gather-5drcj must-gather-bklx4 2/2 Running 0 72s
openshift-must-gather-5drcj must-gather-s8sdh 2/2 Running 0 72s
...
To collect OpenShift sandboxed containers data with must-gather, you must specify the OpenShift sandboxed containers image:
--image=registry.redhat.io/openshift-sandboxed-containers/osc-must-gather-rhel8:1.2.0
--image=registry.redhat.io/openshift-sandboxed-containers/osc-must-gather-rhel8:1.2.0
7.2. About OpenShift sandboxed containers log data Copier lienLien copié sur presse-papiers!
When you collect log data about your cluster, the following features and objects are associated with OpenShift sandboxed containers:
- All namespaces and their child objects that belong to any OpenShift sandboxed containers resources
- All OpenShift sandboxed containers custom resource definitions (CRDs)
The following OpenShift sandboxed containers component logs are collected for each pod running with the kata runtime:
- Kata agent logs
- Kata runtime logs
- QEMU logs
- Audit logs
- CRI-O logs
7.3. Enabling debug logs for OpenShift sandboxed containers Copier lienLien copié sur presse-papiers!
As a cluster administrator, you can collect a more detailed level of logs for OpenShift sandboxed containers. Enhance logging by changing the log_level in the CRI-O runtime for the worker nodes running OpenShift sandboxed containers.
Procedure
Create a YAML file for the
ContainerRuntimeConfigCR with the following manifest:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify a label for the machine config pool that you want you want to modify.
Create the
ContainerRuntimeConfigCR:oc create -f ctrcfg.yaml
$ oc create -f ctrcfg.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe file name listed above is a suggestion. You can create this file using another name.
Verify the CR is created:
oc get ctrcfg
$ oc get ctrcfgCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME AGE crio-debug 3m19s
NAME AGE crio-debug 3m19sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Monitor the machine config pool until the
UPDATEDfield for all worker nodes appears asTrue:oc get mcp worker
$ oc get mcp workerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE worker rendered-worker-169 False True False 3 1 1 0 9h
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE worker rendered-worker-169 False True False 3 1 1 0 9hCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
log_levelwas updated in CRI-O:Open an
oc debugsession to a node in the machine config pool and runchroot /host.oc debug node/<node_name>
$ oc debug node/<node_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow chroot /host
sh-4.4# chroot /hostCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the changes in the
crio.conffile:crio config | egrep 'log_level
sh-4.4# crio config | egrep 'log_levelCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
log_level = "debug"
log_level = "debug"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3.1. Viewing debug logs for OpenShift sandboxed containers Copier lienLien copié sur presse-papiers!
Cluster administrators can use the enhanced debug logs for OpenShift sandboxed containers to troubleshoot issues. The logs for each node are printed to the node journal.
You can review the logs for the following OpenShift sandboxed containers components:
- Kata agent
-
Kata runtime (
containerd-shim-kata-v2) - virtiofsd
Logs for QEMU do not print to the node journal. However, a QEMU failure is reported to the runtime, and the console of the QEMU guest is printed to the node journal. You can view these logs together with the Kata agent logs.
Prerequisites
-
You have installed the OpenShift CLI (
oc). -
You have access to the cluster as a user with the
cluster-adminrole.
Procedure
To review the Kata agent logs and guest console logs, run:
oc debug node/<nodename> -- journalctl -D /host/var/log/journal -t kata -g “reading guest console”
$ oc debug node/<nodename> -- journalctl -D /host/var/log/journal -t kata -g “reading guest console”Copy to Clipboard Copied! Toggle word wrap Toggle overflow To review the kata runtime logs, run:
oc debug node/<nodename> -- journalctl -D /host/var/log/journal -t kata
$ oc debug node/<nodename> -- journalctl -D /host/var/log/journal -t kataCopy to Clipboard Copied! Toggle word wrap Toggle overflow To review the virtiofsd logs, run:
oc debug node/<nodename> -- journalctl -D /host/var/log/journal -t virtiofsd
$ oc debug node/<nodename> -- journalctl -D /host/var/log/journal -t virtiofsdCopy to Clipboard Copied! Toggle word wrap Toggle overflow