4.7. 在受限网络中使用远程健康报告
您可以手动收集和上传 Insights Operator 存档,以便从受限网络中诊断问题。
要在受限网络中使用 Insights Operator,您必须:
- 创建 Insights Operator 归档的副本。
- 将 Insights Operator 存档上传到 console.redhat.com。
另外,您可以选择在上传前模糊处理 Insights Operator 数据。
4.7.1. 运行 Insights Operator 收集操作 复制链接链接已复制到粘贴板!
您必须运行收集操作来创建 Insights Operator 存档。
先决条件
-
以
cluster-admin
用户身份登录 OpenShift Container Platform。
流程
使用此模板创建名为
gather-job.yaml
的文件:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 复制
insights-operator
镜像版本:oc get -n openshift-insights deployment insights-operator -o yaml
$ oc get -n openshift-insights deployment insights-operator -o yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 指定
insights-operator
镜像版本。
将您的镜像版本粘贴到
gather-job.yaml
中:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 将任何现有值替换为您的
insights-operator
镜像版本。
创建收集作业:
oc apply -n openshift-insights -f gather-job.yaml
$ oc apply -n openshift-insights -f gather-job.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 查找作业 pod 的名称:
oc describe -n openshift-insights job/insights-operator-job
$ oc describe -n openshift-insights job/insights-operator-job
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 其中
-
insights-operator-job-<your_job>
是 pod 的名称。
验证操作是否已完成:
oc logs -n openshift-insights insights-operator-job-<your_job> insights-operator
$ oc logs -n openshift-insights insights-operator-job-<your_job> insights-operator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
I0407 11:55:38.192084 1 diskrecorder.go:34] Wrote 108 records to disk in 33ms
I0407 11:55:38.192084 1 diskrecorder.go:34] Wrote 108 records to disk in 33ms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 保存创建的归档:
oc cp openshift-insights/insights-operator-job-<your_job>:/var/lib/insights-operator ./insights-data
$ oc cp openshift-insights/insights-operator-job-<your_job>:/var/lib/insights-operator ./insights-data
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 清理作业:
oc delete -n openshift-insights job insights-operator-job
$ oc delete -n openshift-insights job insights-operator-job
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.7.2. 上传 Insights Operator 存档 复制链接链接已复制到粘贴板!
您可以将 Insights Operator 存档手动上传到 console.redhat.com,以诊断潜在的问题。
先决条件
-
以
cluster-admin
用户身份登录 OpenShift Container Platform。 - 您有一个没有互联网访问限制的工作站。
- 您已创建了 Insights Operator 归档的副本。
流程
下载
dockerconfig.json
文件:oc extract secret/pull-secret -n openshift-config --to=.
$ oc extract secret/pull-secret -n openshift-config --to=.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 复制来自
dockerconfig.json
文件的"cloud.openshift.com"
"auth"
令牌:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将存档上传到 console.redhat.com :
curl -v -H "User-Agent: insights-operator/one10time200gather184a34f6a168926d93c330 cluster/<cluster_id>" -H "Authorization: Bearer <your_token>" -F "upload=@<path_to_archive>; type=application/vnd.redhat.openshift.periodic+tar" https://console.redhat.com/api/ingress/v1/upload
$ curl -v -H "User-Agent: insights-operator/one10time200gather184a34f6a168926d93c330 cluster/<cluster_id>" -H "Authorization: Bearer <your_token>" -F "upload=@<path_to_archive>; type=application/vnd.redhat.openshift.periodic+tar" https://console.redhat.com/api/ingress/v1/upload
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 其中
<cluster_id>
是集群 ID,<your_token>
是来自 pull secret 的令牌,<path_to_archive>
是 Insights Operator 归档的路径。如果操作成功,该命令会返回
"request_id"
和"account_number"
:输出示例
* Connection #0 to host console.redhat.com left intact {"request_id":"393a7cf1093e434ea8dd4ab3eb28884c","upload":{"account_number":"6274079"}}%
* Connection #0 to host console.redhat.com left intact {"request_id":"393a7cf1093e434ea8dd4ab3eb28884c","upload":{"account_number":"6274079"}}%
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证步骤
- 登录到 https://console.redhat.com/openshift。
- 点左侧面板中的 Cluster 菜单。
- 要显示集群详情,点集群名称。
打开集群的 Insights Advisor 选项卡。
如果上传成功,标签会显示以下之一:
- 如果 Insights Advisor 没有发现任何问题,代表您的集群已通过了所有建议。
- Insights Advisor 检测到的问题列表,按风险级别排列(低、中、重要和严重)。
4.7.3. 启用 Insights Operator 数据模糊处理 复制链接链接已复制到粘贴板!
您可以启用模糊处理,以屏蔽敏感、可识别的 IPv4 地址以及 Insights Operator 发送到 console.redhat.com 的集群基础域。
虽然此功能可用,但红帽建议禁用混淆以获得更有效的支持体验。
模糊处理会将非标识值分配给集群 IPv4 地址,并使用保留在内存中的转换表,在将数据上传到 console.redhat.com 之前,在整个 Insights Operator 归档中将 IP 地址更改为其模糊的版本。
对于集群基础域,模糊处理会将基域更改为硬编码子字符串。例如,cluster-api.openshift.example.com
变为 cluster-api.<CLUSTER_BASE_DOMAIN>
。
以下流程使用 openshift-config
命名空间中的 support
secret 启用混淆。
先决条件
-
以
cluster-admin
用户身份登录到 OpenShift Container Platform Web 控制台。
流程
-
导航到 Workloads
Secrets。 - 选择 openshift-config 项目。
-
使用 Search by name 字段搜索 support secret。如果不存在,请点击 Create
Key/value secret 创建它。 -
点击 Options 菜单
,然后点 Edit Secret。
- 单击 Add Key/Value。
-
创建名为
enableGlobalObfuscation
的键,值为true
,然后点 Save。 -
进入 Workloads
Pods -
选择
openshift-insights
项目。 -
查找
insights-operator
pod。 -
要重启
insights-operator
pod,点 Options 菜单,然后点 Delete Pod。
验证
-
导航到 Workloads
Secrets。 - 选择 openshift-insights 项目。
- 使用 Search by name 字段搜索 obfuscat ion-translation-table secret。
如果 obfuscat ion-translation-table
secret 存在,则启用混淆并正常工作。
或者,您可以在 Insights Operator 存档中检查 /insights-operator/gathers.json
的值 "is_global_obfuscation_enabled": true
。