Skip to content

Commit 521f757

Browse files
committed
[OSDOCS-11001]: Migrating HCP resource utilization content from RHACM to OCP
1 parent 1f231be commit 521f757

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

hosted_control_planes/hcp-prepare/hcp-override-resource-util.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9+
The set of baseline measurements for resource utilization can vary in every hosted cluster.
10+
11+
include::modules/hcp-override.adoc[leveloffset=+1]
12+
include::modules/hcp-disable-metrics.adoc[leveloffset=+1]

modules/hcp-disable-metrics.adoc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-prepare/hcp-override-resource-util.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-disable-metrics_{context}"]
7+
= Disabling the metric service monitoring
8+
9+
After enabling the `hypershift-addon` managed cluster addon, the metric service monitoring is configured by default so that {product-title} monitoring can gather metrics from `hypershift-addon`.
10+
11+
.Procedure
12+
13+
You can disable the metric service monitoring by completing the following steps:
14+
15+
. Log in to your hub cluster by running the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc login
20+
----
21+
22+
. Open the `hypershift-addon-deploy-config` add-on deployment configuration specification for editing by running the following command:
23+
+
24+
[source,terminal]
25+
----
26+
$ oc edit addondeploymentconfig hypershift-addon-deploy-config -n multicluster-engine
27+
----
28+
29+
. Add the `disableMetrics=true` customized variable to the specification, as shown in the following example:
30+
+
31+
[source,yaml]
32+
----
33+
apiVersion: addon.open-cluster-management.io/v1alpha1
34+
kind: AddOnDeploymentConfig
35+
metadata:
36+
name: hypershift-addon-deploy-config
37+
namespace: multicluster-engine
38+
spec:
39+
customizedVariables:
40+
- name: hcMaxNumber
41+
value: "80"
42+
- name: hcThresholdNumber
43+
value: "60"
44+
- name: disableMetrics <1>
45+
value: "true"
46+
----
47+
+
48+
<1> The `disableMetrics=true` customized variable disables the metric service monitoring configuration for both new and existing `hypershift-addon` managed cluster add-ons.
49+
50+
. Save the changes.

modules/hcp-override.adoc

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-prepare/hcp-override-resource-util.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-override_{context}"]
7+
= Overriding resource utilization measurements for a hosted cluster
8+
9+
You can override the resource utilization measurements based on the type and pace of your cluster workload. Complete the following steps:
10+
11+
.Procedure
12+
13+
. Create the `ConfigMap` resource by running the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ oc create -f <your-config-map-file.yaml>
18+
----
19+
+
20+
Replace `<your-config-map-file.yaml>` with the name of your YAML file that contains your `hcp-sizing-baseline` config map.
21+
22+
. Create the `hcp-sizing-baseline` config map in the `local-cluster` namespace to specify the measurements you want to override. Your config map might resemble the following YAML file:
23+
+
24+
[source,yaml]
25+
----
26+
kind: ConfigMap
27+
apiVersion: v1
28+
metadata:
29+
name: hcp-sizing-baseline
30+
namespace: local-cluster
31+
data:
32+
incrementalCPUUsagePer1KQPS: "9.0"
33+
memoryRequestPerHCP: "18"
34+
minimumQPSPerHCP: "50.0"
35+
----
36+
37+
. Delete the `hypershift-addon-agent` deployment to restart the `hypershift-addon-agent` pod by running the following command:
38+
+
39+
[source,terminal]
40+
----
41+
$ oc delete deployment hypershift-addon-agent -n open-cluster-management-agent-addon
42+
----
43+
44+
.Verification
45+
46+
* Observe the `hypershift-addon-agent` pod logs. Verify that the overridden measurements are updated in the config map by running the following command:
47+
+
48+
[source,terminal]
49+
----
50+
$ oc logs hypershift-addon-agent -n open-cluster-management-agent-addon
51+
----
52+
+
53+
Your logs might resemble the following output:
54+
+
55+
.Example output
56+
[source,terminal]
57+
----
58+
2024-01-05T19:41:05.392Z INFO agent.agent-reconciler agent/agent.go:793 setting cpuRequestPerHCP to 5
59+
2024-01-05T19:41:05.392Z INFO agent.agent-reconciler agent/agent.go:802 setting memoryRequestPerHCP to 18
60+
2024-01-05T19:53:54.070Z INFO agent.agent-reconciler agent/hcp_capacity_calculation.go:141 The worker nodes have 12.000000 vCPUs
61+
2024-01-05T19:53:54.070Z INFO agent.agent-reconciler agent/hcp_capacity_calculation.go:142 The worker nodes have 49.173369 GB memory
62+
----
63+
+
64+
If the overridden measurements are not updated properly in the `hcp-sizing-baseline` config map, you might see the following error message in the `hypershift-addon-agent` pod logs:
65+
+
66+
.Example error
67+
[source,terminal]
68+
----
69+
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"}
70+
----

0 commit comments

Comments
 (0)