Skip to content

Commit cc6df19

Browse files
committed
Update README
Signed-off-by: mrrr61 <mrrr61@outlook.com>
1 parent 0a2844f commit cc6df19

3 files changed

Lines changed: 87 additions & 33 deletions

File tree

federated-learning-controller/README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,30 @@ curl -L https://raw.githubusercontent.com/open-cluster-management-io/clusteradm/
3939
#### 2. Create hub and managed clusters with `kind`
4040

4141
```bash
42-
curl -L https://raw.githubusercontent.com/open-cluster-management-io/OCM/main/solutions/setup-dev-environment/local-up.sh | bash
42+
bash ./local-up.sh
4343
```
4444

4545
#### 3. Verify cluster setup
4646

47+
After the script completes, you can verify that the clusters are registered with the hub:
48+
4749
```bash
48-
$ kubectl get mcl
49-
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE
50-
cluster1 true https://cluster1-control-plane:6443 True True 2m
51-
cluster2 true https://cluster2-control-plane:6443 True True 3m
50+
kubectl --context kind-hub get managedclusters
5251
```
5352

53+
You should see an output similar to this:
54+
55+
```text
56+
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE
57+
cluster1 true https://cluster1-control-plane:6443 True True 3h36m
58+
cluster2 true https://cluster2-control-plane:6443 True True 3h36m
59+
local-cluster true https://hub-control-plane:6443 True True 3h35m
60+
```
61+
62+
#### Optional: Install OTel Addon
63+
64+
Please refer to the [OTel Addon Installation](docs/Install-OTel-Addon.md) documentation for more details.
65+
5466
---
5567

5668
### Deploy Federated Learning Controller
@@ -91,10 +103,6 @@ cluster-manager-d9db64db5-wndd8 1/1 Running 0 5
91103
federated-learning-controller-d7df846c9-nb4wc 1/1 Running 0 3m
92104
```
93105

94-
### Optional: Install OTel Addon
95-
96-
Please refer to the [OTel Addon Installation](docs/Install-OTel-Addon.md) documentation for more details.
97-
98106
<details>
99107

100108
<summary><strong>Alternatively: Run the Controller Locally</strong></summary>

federated-learning-controller/docs/Install-OTel-Addon.md

Lines changed: 70 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3630
kubectl --context kind-hub get managedclusters
@@ -61,7 +55,7 @@ kubectl --context kind-hub create namespace monitoring
6155
Next, 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
6559
bash ./generate-certs.sh
6660
cd ../..
6761
```
@@ -110,19 +104,71 @@ After all components are deployed, you can verify that metrics are being collect
110104

111105
Run 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+
```
File renamed without changes.

0 commit comments

Comments
 (0)