3.3. 覆盖资源利用率测量
资源利用率的基线测量集合在每个托管的集群中可能会有所不同。
3.3.1. 覆盖托管集群的资源利用率测量 复制链接链接已复制到粘贴板!
您可以根据集群工作负载的类型和节奏覆盖资源利用率测量。
流程
运行以下命令来创建
ConfigMap
资源:oc create -f <your-config-map-file.yaml>
$ oc create -f <your-config-map-file.yaml>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将
<your-config-map-file.yaml>
替换为包含hcp-sizing-baseline
配置映射的 YAML 文件的名称。在
local-cluster
命名空间中创建hcp-sizing-baseline
配置映射,以指定您要覆盖的测量。您的配置映射可能类似以下 YAML 文件:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 运行以下命令,删除
hypershift-addon-agent
部署以重启hypershift-addon-agent
pod:oc delete deployment hypershift-addon-agent \ -n open-cluster-management-agent-addon
$ oc delete deployment hypershift-addon-agent \ -n open-cluster-management-agent-addon
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
观察
hypershift-addon-agent
pod 日志。运行以下命令,验证配置映射中是否更新了覆盖的测量:oc logs hypershift-addon-agent -n open-cluster-management-agent-addon
$ oc logs hypershift-addon-agent -n open-cluster-management-agent-addon
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 您的日志可能类似以下输出:
输出示例
2024-01-05T19:41:05.392Z INFO agent.agent-reconciler agent/agent.go:793 setting cpuRequestPerHCP to 5 2024-01-05T19:41:05.392Z INFO agent.agent-reconciler agent/agent.go:802 setting memoryRequestPerHCP to 18 2024-01-05T19:53:54.070Z INFO agent.agent-reconciler agent/hcp_capacity_calculation.go:141 The worker nodes have 12.000000 vCPUs 2024-01-05T19:53:54.070Z INFO agent.agent-reconciler agent/hcp_capacity_calculation.go:142 The worker nodes have 49.173369 GB memory
2024-01-05T19:41:05.392Z INFO agent.agent-reconciler agent/agent.go:793 setting cpuRequestPerHCP to 5 2024-01-05T19:41:05.392Z INFO agent.agent-reconciler agent/agent.go:802 setting memoryRequestPerHCP to 18 2024-01-05T19:53:54.070Z INFO agent.agent-reconciler agent/hcp_capacity_calculation.go:141 The worker nodes have 12.000000 vCPUs 2024-01-05T19:53:54.070Z INFO agent.agent-reconciler agent/hcp_capacity_calculation.go:142 The worker nodes have 49.173369 GB memory
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果在
hcp-sizing-baseline
配置映射中没有正确更新覆盖的测量,您可能会在hypershift-addon-agent
pod 日志中看到以下错误信息:错误示例
2024-01-05T19:53:54.052Z ERROR agent.agent-reconciler agent/agent.go:788 failed to get configmap from the hub. Setting the HCP sizing baseline with default values. {"error": "configmaps \"hcp-sizing-baseline\" not found"}
2024-01-05T19:53:54.052Z ERROR agent.agent-reconciler agent/agent.go:788 failed to get configmap from the hub. Setting the HCP sizing baseline with default values. {"error": "configmaps \"hcp-sizing-baseline\" not found"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.2. 禁用指标服务监控 复制链接链接已复制到粘贴板!
启用 hypershift-addon
受管集群附加组件后,会默认配置指标服务监控,以便 OpenShift Container Platform 监控可以从 hypershift-addon
收集指标。
流程
您可以通过完成以下步骤禁用指标服务监控:
运行以下命令登录到您的 hub 集群:
oc login
$ oc login
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 运行以下命令来编辑
hypershift-addon-deploy-config
附加组件部署配置规格:oc edit addondeploymentconfig hypershift-addon-deploy-config \ -n multicluster-engine
$ oc edit addondeploymentconfig hypershift-addon-deploy-config \ -n multicluster-engine
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在规格中添加
disableMetrics=true
自定义变量,如下例所示:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
disableMetrics=true
自定义变量为新的和现有的hypershift-addon
受管集群附加组件禁用指标服务监控。
运行以下命令,将更改应用到配置规格:
oc apply -f <filename>.yaml
$ oc apply -f <filename>.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow