@@ -24,13 +24,7 @@ Before you begin, ensure you have the following tools installed:
2424
2525## Test Environment Setup
2626
27- A setup script is provided to create a complete three-cluster OCM test environment (1 hub, 2 spokes).
28-
29- ``` bash
30- bash ./local-up.sh
31- ```
32-
33- After the script completes, you can verify that the clusters are registered with the hub:
27+ Please verify that the clusters are registered with the hub:
3428
3529``` bash
3630kubectl --context kind-hub get managedclusters
@@ -61,7 +55,7 @@ kubectl --context kind-hub create namespace monitoring
6155Next, run the certificate generation script. This script automates the creation of the necessary Certificate Authorities (CAs) and TLS certificates for securing communication (mTLS) between Prometheus and the OTel collectors. It will also create the required Kubernetes secrets.
6256
6357``` bash
64- cd hack/certs
58+ cd federated-learning-controller/deploy/otel_addon/ hack/certs
6559bash ./generate-certs.sh
6660cd ../..
6761```
@@ -110,19 +104,71 @@ After all components are deployed, you can verify that metrics are being collect
110104
111105Run a query for a Kepler metric, such as ` kepler_container_joules_total ` . The results should show time series with distinct ` cluster_name ` labels (` hub ` , ` cluster1 ` , ` cluster2 ` ), confirming that metrics are being successfully aggregated from all clusters.
112106
113- ### Example PromQL Queries
114-
115- * ** Power consumption rate on the hub cluster:**
116- ``` promql
117- rate(kepler_container_joules_total{cluster_name="hub"}[5m])
118- ```
119-
120- * **CPU usage rate on cluster1:**
121- ```promql
122- rate(container_cpu_usage_seconds_total{cluster_name="cluster1"}[5m])
123- ```
124-
125- * **CPU usage from a specific namespace on cluster2:**
126- ```promql
127- container_cpu_usage_seconds_total{exported_namespace="open-cluster-management", cluster_name="cluster2"}
128- ```
107+ ``` bash
108+ $ curl -ksS https://172.18.0.2:30090/api/v1/query? query=kepler_container_joules_total | jq
109+ {
110+ " status" : " success" ,
111+ " data" : {
112+ " resultType" : " vector" ,
113+ " result" : [
114+ {
115+ " metric" : {
116+ " __name__" : " kepler_container_joules_total" ,
117+ " cluster_name" : " local-cluster" ,
118+ " container_id" : " 037ac5839960d853b607d77a8501c6ddc244cbe22f3e6994508662b5ea1376eb" ,
119+ " container_name" : " klusterlet" ,
120+ " container_namespace" : " open-cluster-management" ,
121+ " instance" : " 10.244.0.42:9102" ,
122+ " job" : " kepler" ,
123+ " k8s_container_name" : " kepler-exporter" ,
124+ " k8s_daemonset_name" : " kepler-exporter" ,
125+ " k8s_namespace_name" : " open-cluster-management-agent-addon" ,
126+ " k8s_node_name" : " hub-control-plane" ,
127+ " k8s_pod_name" : " kepler-exporter-sdljk" ,
128+ " k8s_pod_uid" : " 9c846e33-5e18-4150-9b9e-1517104b6972" ,
129+ " mode" : " dynamic" ,
130+ " pod_name" : " klusterlet-7d8bd449cc-zftcw" ,
131+ " server_address" : " 10.244.0.42" ,
132+ " server_port" : " 9102" ,
133+ " service_instance_id" : " 10.244.0.42:9102" ,
134+ " service_name" : " kepler" ,
135+ " url_scheme" : " http"
136+ },
137+ " value" : [
138+ 1753535725.037,
139+ " 5.778"
140+ ]
141+ },
142+ {
143+ " metric" : {
144+ " __name__" : " kepler_container_joules_total" ,
145+ " cluster_name" : " local-cluster" ,
146+ " container_id" : " 8abc271d1180f59ee706546513f07e34f2dac64f3c9d91d3641007e90c5fefc3" ,
147+ " container_name" : " klusterlet" ,
148+ " container_namespace" : " open-cluster-management" ,
149+ " instance" : " 10.244.0.42:9102" ,
150+ " job" : " kepler" ,
151+ " k8s_container_name" : " kepler-exporter" ,
152+ " k8s_daemonset_name" : " kepler-exporter" ,
153+ " k8s_namespace_name" : " open-cluster-management-agent-addon" ,
154+ " k8s_node_name" : " hub-control-plane" ,
155+ " k8s_pod_name" : " kepler-exporter-sdljk" ,
156+ " k8s_pod_uid" : " 9c846e33-5e18-4150-9b9e-1517104b6972" ,
157+ " mode" : " idle" ,
158+ " pod_name" : " klusterlet-7d8bd449cc-cj52x" ,
159+ " server_address" : " 10.244.0.42" ,
160+ " server_port" : " 9102" ,
161+ " service_instance_id" : " 10.244.0.42:9102" ,
162+ " service_name" : " kepler" ,
163+ " url_scheme" : " http"
164+ },
165+ " value" : [
166+ 1753535725.037,
167+ " 0"
168+ ]
169+ },
170+ ...
171+ ]
172+ }
173+ }
174+ ```
0 commit comments