$ oc adm must-gather --image=registry.redhat.io/openshift-gitops-1/must-gather-rhel8:v1.10.0
打开支持案例时,您必须向 Red Hat 支持团队提供有关集群的调试信息。您可以使用must-gather
工具收集项目级资源、集群级资源和 Red Hat OpenShift GitOps 组件的诊断信息。
为了获得及时的支持,请提供 OpenShift Container Platform 和 Red Hat OpenShift GitOps 的诊断信息。 |
oc adm must-gather
CLI 命令收集集群中最可能需要用于调试问题的的信息,包括:
资源定义
服务日志
默认情况下,oc adm must-gather
命令使用默认插件镜像并写入./must-gather.local
。
或者,您可以通过使用以下部分中描述的适当参数运行命令来收集特定信息。
要收集与一个或多个特定功能相关的数据,请使用带有镜像的--image
参数,如以下部分所列。
$ oc adm must-gather --image=registry.redhat.io/openshift-gitops-1/must-gather-rhel8:v1.10.0
要收集审计日志,请使用-- /usr/bin/gather_audit_logs
参数,如以下部分所述。
$ oc adm must-gather -- /usr/bin/gather_audit_logs
为了减小文件大小,审计日志不会作为默认信息集的一部分收集。 |
运行oc adm must-gather
时,会在集群上的新项目中创建一个具有随机名称的新 Pod。数据在该 Pod 上收集并在以must-gather.local
开头的新的目录中保存。此目录在当前工作目录中创建。
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
...
或者,您可以通过使用--run-namespace
选项在特定命名空间中运行oc adm must-gather
命令。
$ oc adm must-gather --image=registry.redhat.io/openshift-gitops-1/must-gather-rhel8:v1.10.0
使用oc adm must-gather
CLI 命令收集与 Red Hat OpenShift GitOps 关联的集群的以下详细信息:
Red Hat OpenShift GitOps Operator 的订阅和命名空间。
ArgoCD 对象可用的命名空间以及这些命名空间中的对象,例如ArgoCD
、Applications
、ApplicationSets
、AppProjects
和configmaps
。
Red Hat OpenShift GitOps Operator 管理的命名空间列表以及这些命名空间中的资源。
所有与 GitOps 相关的自定义资源对象和定义。
Operator 和 Argo CD 日志。
警告和错误级别事件。
您已以管理员身份登录 OpenShift Container Platform 集群。
您已安装 OpenShift Container Platform 命令行界面 (oc
)。
您已安装 Red Hat OpenShift GitOps Operator。
导航到您想要存储调试信息的目录。
使用 Red Hat OpenShift GitOps 的 must-gather
镜像运行 oc adm must-gather
命令。
$ oc adm must-gather --image=registry.redhat.io/openshift-gitops-1/must-gather-rhel8:<image_version_tag> (1)
1 | GitOps 的 must-gather 镜像。 |
$ oc adm must-gather --image=registry.redhat.io/openshift-gitops-1/must-gather-rhel8:v1.10.0
must-gather
工具会在当前目录下创建一个以 ./must-gather.local
开头的新的目录。例如,./must-gather.local.4157245944708210399
。
从刚刚创建的目录创建一个压缩文件。例如,在使用 Linux 操作系统的计算机上,运行以下命令:
$ tar -cvaf must-gather.tar.gz must-gather.local.4157245944708210399 (1)
1 | 将 must-gather-local.4157245944708210399 替换为实际的目录名称。 |
将压缩文件附加到您在 Red Hat 客户门户 上的支持案例中。